Merge several bays in object unique Array function

Hello

I have a multidimensional array database and I'm quite confused by bringing to the simple linear table. I know it requires some for loop to set the property and its value and some nested loop but I lost halfway.

Please take a look at who follows and guide me how can I solve this problem.

Thank you very much

I have the following data

records:Array = [0]
                    name = gender;
                    records:Array
                           [0] = male;
                           [1] = female;


                [1]
                    name = count;
                    records:Array
                           [0] = 35;
                           [1] = 40; 

I want to convert it into a single table as follows:

records : Array =
                [0] = [gender: male, count:35]
                [1] = [gender: female, count: 40]

If I'm following what you have and what you want, I think that the following is all you need...

Here's what you say, you have:

var records: Array = new Array(["male","female"],[35,40]);

so to convert, first create a place to create new version

var tempArray = new Array();

Then, wrap around the table of records and create objects in the tempArray

for (var i: uint = 0; i
tempArray [i] = {sex: files [0] [i], count: files [1] [i]};
}

Assign then the tempArray either the documents table

reviews = tempArray;

confirm the results

trace (records [0] .gender, records [0] .count);
trace (records [1] .gender, records [1] .count);

Tags: Adobe Animate

Similar Questions

  • hitTestObject with several bays

    Hello!

    I made a game and have a few problems

    I want to do a hitTestObject between several bays, I tried something like this:

    for (var i: Number = 0; i < array1.length; i ++)

    {

    array array1 [i] there-= 10; Moves an object to the top

    for (var a: number = 0; i < array2.length; a ++)

    {

    If (array1 [i] .hitTestObject (array2 [i]))

    {

    trace ("hit!");

    }

    }

    }

    When I run it, something which will detect the collision and will display 'hit', but some who will ignore. I also noticed that some opposes in array1 stop running the code for moving (array1 [i] there-= 10) after I added another picture.

    My question is: is at - it a more efficient way to do this? Or at least a way so that everything works fine

    Thanks in advance!

    There is a more correct way to do it... No I have

    If (array1 [i] .hitTestObject ([a] array2))

  • Save several bays of nested loops

    Hello

    My vi generates several bays in each iteration of the loop, and I would like to save the data. I did work with the files before recording, but it's never with nested loops. I don't know how to keep the information of the iteration of one loop at the other. I would like suggestions. I made this sample & simple vi (attached file) that simulates the question I have. I have a file with a time column and different columns of food beside him.

    The first question I have is that I generate the time table only once, but a table of signal several times, so how can I keep the time table to drop several times? The other question, as stated above, saves the data in the table signal getting lost in the nested loops...

    Thank you

    A

    1. the first element of the first matrix signal IS always zero.  The Signal to simulate always starts at zero.  You compare it to the indicator of "first date".  Who got by converting the dynamic data type to a scalar.  And it's always the last element of the actual data.  And since the "first out" is replaced with each iteration of the inner loop, the number you see at the end is actually the latest iteration of the data.  Look at "First release" in comparison with the last element of your last column of the table and you will see they are the same.

    2. the reason why you have a first column that consists of the steps is because that's what you have wired to initialize the shift register.  If you look at my example, you will see that I have an empty array.  (The zero is gray.)  You, the 0 is not dimmed meaning there is an element.  Expand this table to view more items and expand the digital field and you will see more digits.  They correspond to what is in your first column.

  • Bug in Array Function XNodes 1.4.0.24?

    Hello

    I have been using Array Function XNodes 1.4.0.24 for a while now and find it quite useful.

    However, I have met unexpected behavior which makes me doubt the filter table node (and so the whole package).

    The matrix of results 'False elements' of the node is too large, filled with identical nonsensical data after the apparently correct data elements.

    The amount of padding data depends on the array of Boolean.

    My input array is U8. Its size seems to be the problem. If it is less of a factor of 100 the vi will work as expected.

    Anyone who has installed the package can check this behavior with the vi attached?

    The package can be downloaded here:

    http://lavag.org/files/file/58-array-function-XNodes/

    Best regards

    Florian

    The CR of LAVA is a support for each download. You should ask it there - http://lavag.org/topic/10303-cr-array-function-xnodes/

  • LVOOP - 1 table of Parents in several bays of the child?

    I have 3 types of channels in my system. DI, I and AO.

    I want to create a Parent class that has 3 children for each of my types of channels.  It's because I want to store (on disk using flatten chain) all my channels together as an array of strings.  It's ok because I can use the 'to the more generic class"and a record in a table of my parents (CHANNEL class).

    The problem is when I read this array of objects.  I can read my array of objects parent but then I want to transform my array of objects of string into an array of objects, an array of objects HAVE and an array of objects of the DI AO.

    Any ideas?  Thank you.

    Lewis_G wrote:

    Hi nathand thanks for the ideas.  I've implemented it as you sugested.  Is there a way to make it more scalable?

    You might abuse the primitive preserve Run-Time class, as shown below. This divided the table parent tables separated for each class of the child, but the type of each element of these tables is always the parent type, even if they are transporting children. Not sure if that's what you want, or not.

    Lewis_G wrote:

    The child the more classes i, messier, fine.  Even if the code is the same for both, I can't have a Subvi generic because the child class is different for the two.  Don't you think it's a good idea to have a new class of table for each child.  For example, I could make a class with a method that has a channel enter parent and trys to add it to the guard?

    This could be very good, if it meets your needs.

    Intaris wrote:

    nathand wrote:

    Otherwise, add a method to the class called parent Type Get and override it in each class of the child, and then call on each element of the array to determine its type.

    And make sure that the type is a string, otherwise problems ensure later in life...

    I thought to mention that when I offered everything first, but then I thought that there could be situations in which an enum would work very well if you don't mind violating good OOP practices. Yes, the parent should know his children and you need to know about all children at design time, but if you can accept these terms then an enum is simple. I'm undecided about whether I would never apply this solution if I were to try to solve this problem in my own code.

  • Unexpected behavior of the chain of worksheet to the array function

    Hello

    I found a few quirks in LabVIEW 2011 I don't understand. In the vi attached, I provide a one-dimensional spreadsheet string separated by spaces. I use the string of worksheet to the array function to convert this spreadsheet string into an array of strings.

    I came across problems when I wanted to specify a space as the delimiter character.

    The conversion works as expected, if I do not specify a delimiter (i.e., the default tab delimiter is used). But if I specify the delimiter, only the first element of the string of spreadsheet is converted. I don't understand this behavior.

    Thanks for your help.

    Peter

    What a shame... Thanks for your time and this thin.

    Peter

  • How to merge several layers in one without destroying the layers of origin?

    How to merge several layers in one without destroying the layers of origin?

    joelb2995629 wrote:

    How to merge several layers in one without destroying the layers of origin?

    The solution is a very useful shortcut, but requires a bit of dexterity.

    Of is it: Ctrl + Alt + Shift + e. (Yes, 4 keys at the same time).

    This creates a new layer that is the fusion of visible layers.

    To be on the top layer and don't have ensure that active useful layers.

  • How "merge" several duplicate layers together to make a single image?

    How "merge" several duplicate layers in the same image, (each of them with a number painted on it) in an image, which shows all the numbers separated, that is are coalition? Believe me, I tried all means to do, but nothing helps, I just can't 'merge' into a single image. Help, please! I use Photoshop cc with windows 7.

    Select all layers, and then press ctrl-alt-shift-e. This will create a composite of all layers, leaving your only originals.

    Each layer must have a mask or pixels removed to create a transparent box that allows to display the image in the next layer below and so on. This must be done before you create the composite.

  • How to merge several documents to my e-mail to adobe in Windows?

    How to merge several documents to my e-mail to adobe in Windows?

    Hi lindas27936780,

    Download PDF attachments on your system & then combine them combine or merge files into a single PDF, Adobe Acrobat DC

    Kind regards

    Meenakshi

  • How to merge several pdf files into an editable word document?

    How to merge several pdf files into an editable word document?

    You will need either a subscription to the pack PDF to merge the files, then export to Word or you would need Adobe Acrobat (should not be confused with the free Adobe Acrobat Reader which can not do).

  • Hi, I currently pay monthly to the handset Lightrrom 5/Photoshop but I need to be able to merge several images in "Merging HDR" but is not one of the options I can choose currently highlighted.  I guess I'll have to move to Lr 6 but I"

    Hi, I currently pay monthly to the handset Lightrrom 5/Photoshop but I need to be able to merge several images in "Merging HDR" but is not one of the options I can choose currently highlighted.  I guess I'll have to move to Lr 6 but I am struggling to see online how to change the plan?

    I suppose you're running a 32-bit Windows version - if PS CC 2015 is available but LR CC 2015 is not.

    Help / System Info in LR 5 and look for Application Architecture and System Architecture a few lines down in the list of information.   Something with a 32 or x 86 is 32-bit.  Something with x 64 is 64-bit.

    You will need a 64 bit OS to run LR CC or LR 6.

  • How to merge several PDF files into a PDF file?

    How to merge several PDF files into a PDF file? for example, I've scanned 3 pages of the same document on my computer and they come up on top of the computer as a separate PDF files, but they are 3 pages that should be in the same PDF file?

    Hi m.zaffar,

    In order to combine the PDF you can subscribe to Adobe PDF to combine files of service https://cloud.acrobat.com/combinepdf

    KB doc. for help Document Cloud Help | Adobe PDF package using.

    Or

    You can use the Acrobat free trial download Adobe Acrobat application | Acrobat Pro DC.

    KB doc. using Acrobat help. Combine or merge files into a single PDF file.

    Kind regards

    Nicos

  • Concatenate several lines in a Unique identifier

    Hi all

    I need to concatenate several lines in a unique identifier

    So, my unique identifiers are name and email_id columns.


    It is 1:M relationship as eponymous and email_id can have n number of different products, now I should


    So let's say that the name = xyz and [email protected] has 5 rows with different product info for them.

    Product # #Name #email_id

    XYZ [email protected] Ora
    XYZ [email protected] sql
    XYZ [email protected] siebel
    XYZ [email protected] erp
    XYZ [email protected] crm

    My end result would be after concatenation (seen / as a delimiter between each concatenated row):

    Product # #Name #email_id
    XYZ [email protected] Ora/sql / / erp/crm siebel

    Need help please, after several attempts, I can't seem to make it work. I thank in advance

    Published by: user13080645 on January 22, 2011 07:33

    Hello

    You should look at using STRAGG or LISTAGG - take a look on: http://www.dba-oracle.com/t_display_multiple_column_values_same_rows.htm or search the Forum of SQL for these

    Andy

  • Can I merge several PDF on a list of PDF and order

    For example
    Let's say I have 5 pdf queries with 5 page report layouts
    I can do a page of APEX to select one or more to be put in a single PDF and also have the order in which they appear in the file a PDF?
    Help, please
    Thank you
    Doug

    BI Publisher comes with a java API that allows you to merge several PDF files.
    Made custom coding is possible - so I'm not an expert of the APEX - so I can't
    talk about how integrate it APEX.

    Klaus

  • Can I use several nulls in a unique key column

    Happy Pongal (SANKRANTHI) friends hi... Can you please help me in this regard...

    Can I use several nulls in a unique key column?

    Yes you can have

Maybe you are looking for