two-dimensional array

Hello

Sorry for this question but I am new to flex.

How do I declare a two-dimensional array?

You can do this:



  
    
  
  
    
    
    
  

If this post answers your question or assistance, please mark it as such.

Greg Lafrance - Flex 2 and 3 certified ACE

www.ChikaraDev.com

Flex / development, training, AIR and Support Services

Tags: Flex

Similar Questions

  • Extend the two-dimensional array

    Hi all

    How can I extend both the axis of a two-dimensional array?
    DECLARE
      TYPE num_array IS TABLE OF VARCHAR2(100);
      TYPE bidim_num_array IS TABLE OF num_array;
      l_array bidim_num_array;
    BEGIN
      ...
    END;
    in order to fill the two-dimensional table as a matrix:
    l_array(1)(1) := ...
    l_array(1)(2) := ...
    l_array(1)(3) := ...
    l_array(2)(1) := ...
    l_array(2)(2) := ...
    l_array(2)(3) := ...
    l_array(3)(1) := ...
    l_array(3)(2) := ...
    l_array(3)(3) := ...
    I don't know the size of the MxN matrix.

    Thanks in advance.

    Manuel Vidigal wrote:

    How can I extend both the axis of a two-dimensional array?

    Just as you would with one-dimensional, just twice - one for each dimension. You will also need to initialize second dimension table whenever you extend first dimension:

    SQL> DECLARE
      2    TYPE num_array IS TABLE OF VARCHAR2(100);
      3    TYPE bidim_num_array IS TABLE OF num_array;
      4    l_array bidim_num_array := bidim_num_array(); -- initialize two-dimensional array (this initializes first dimension only)
      5  BEGIN
      6    l_array.extend; -- extend two-dimensional array
      7    l_array(1) := num_array(); -- initialize second dimention array
      8    l_array(1).extend; -- extend second dimension array (this extends first dimension only)
      9    l_array(1)(1) := 'Row 1, Column1';
     10    l_array(1).extend; -- extend second dimension array
     11    l_array(1)(2) := 'Row 1, Column2';
     12    l_array.extend; -- extend two-dimensional array (this extends first dimension only)
     13    l_array(2) := num_array(); -- initialize second dimention array
     14    l_array(2).extend; -- extend second dimension array
     15    l_array(2)(1) := 'Row 2, Column1';
     16    l_array(2).extend; -- extend second dimension array
     17    l_array(2)(2) := 'Row 2, Column2';
     18    for i in 1..l_array.count loop
     19      for j in 1..l_array(i).count loop
     20        dbms_output.put_line(l_array(i)(j));
     21      end loop;
     22    end loop;
     23  END;
     24  /
    Row 1, Column1
    Row 1, Column2
    Row 2, Column1
    Row 2, Column2
    
    PL/SQL procedure successfully completed.
    
    SQL>  
    

    SY.

  • How to extract a single dimension of two two-dimensional array

    Hello

    Perhaps this question is too naïve and simple. I have two two-dimensional chart (256 rows and two columns). All I want is to retrieve one of these columns as a dimensional table a separate. It seems to be something very very basic that should cover just about any programming language. However, I couldn't find the right function in the list of functions of table. I don't know I'm missing something very obvious. I tried the Board index, subset of table, table of cluster and reshape the table. None of them is the right function for this. I have used LabVIEW for awhile now, but I can't find a solution to this fundamental problem. Can someone help out me.

    Thank you

    HI -.

    With the function Index Array you tried a number of cabling to the marked entry index (col)?

    See the vi attached for an example.

  • Problem of two-dimensional array

    I have problems assigning values to two dimension table. Here is an example:

    _Global.test = new Array (new Array, new Array);

    for (n = 1; n < = 3; n ++) {}

    _Global.test [n] ["txt"] = n;

    trace (_Global.test [n] ["txt"]);

    }


    Here is the trace output:
    1
    undefined
    undefined

    Can someone please tell me what I'm doing wrong?

    If you want to create a 2d array, which is an array with two elements, with each element of array, that you use:

  • Easy way to extract the line of two-dimensional array?

    Y at - it an easy way to extract a two table row Dimensions? I have two lists of table to a dimension that I consider a pine table, where each pin list is a table of numbers. I want to go through it and to extract a line at a time to send in a vi. Currently, I'm looking to do a bit of a long way, and I was wondering if there was an easier way. The long way:

    GetArrayBounds (Locals.ArrayOfPinsToTestAtOnce, Locals.BogusString, Locals.ArrayBounds), / / enter the quantity of lines and columns Locals.ArrayBounds
    Locals.ElementsPerList = Val (Mid (Locals.ArrayBounds, 1, 1)), //Get number of bowling by list
    Locals.NumberOfLists = Val (Mid (Locals.ArrayBounds, 4, 1)), //Extract number lists
    SetArrayBounds (Locals.OneRow, "[0]", "[" + Str (Locals.ElementsPerList) + "']" ") //Set table defines for a line chart
    < locals.numberofgroups;="" i++="" )="" would="" be="" done="" in="" teststand="" step,="" just="" for="" easy="">
    {
    < locals.elementsperlist;="" j++)="" also="" would="" be="" done="" in="" teststand="">
    Locals.OneRow [j] = ArrayOfPinsToTestAtOnce [j] [i]
    PERFORM STEP HERE (Locals.OneRow)
    }

    Thanks for the tips!

    In all honesty, I just want to do in LabVIEW.  You can try to add to the list in this idea.

  • with 2 collar and two rows two-dimensional array

    I could not find how to form a matrix 2 x 2 in the old Easter in ActionScript. All bays are only a single line.  How can I change it.

    var myArray:Array = new Array();

    myArray [0] = new Array (val1, val2);

    trace(myArray[0][0]); val1

    trace(myArray[0][1]); val2

    But depending on what you actually trying to do there may be better ways. For example, if you save to x and plotting perhaps.

    myArray [0] = new Point (val1, val2);

    trace(myArray[0].x);

    trace(myArray[0].y);

    Or you can push an object in the table. Or even use a vector...

  • How to keep account different values of two two-dimensional array

    Hello

    I need help regarding one of my LabVIEW VI. I have three matrices 2 dimensions, namely Sx, Sy, and P of dimension 4 x 4 of each. I want to do the following calculation:

    P(i,j)=[P(i,j+1)+P(i,j-1)+P(i+1,j)+P(i-1,j)]+1/8*[-3*SX(i,j+1)+SX(i,j-1)+2*Sy(i-1,j)-2*Sy(i+1,j)].

    For now, you can consider all values of Sx and Sy matrices and matrix P for the first time for all the elements as zero.

    I did it in Matlab, but have no idea on how to do this in LabVIEW. Please help me in this regard.

    Thanking you!

    You can go there.

  • Two dynamic arrays

    I have two dynamic arrays in my form.  Each table dynamically sizes based on pressing add or remove buttons.  However, the first table develops in the other table.  I can't place the two paintings in one as the purchase order example because after the second table I have text and additional fields...  If the two tables must expand the page to explain the additional lines.  Any suggestions on how to link tables to account for the other and additional text fields?

    Thank you

    Hello

    You can go there. The main problem is that the subform parent (page1) has been defined place and has not sunk). It's working now, but there are form elements you want to put in a positioned subform.

    Basic approach should be:

    • Form design using initially positioned subforms.
    • Wrap the form objects that don't grow in positioned subforms (for example, it is objects that are side by side in a group that don't change position or size compared to the other);
    • You may find yourself with several subforms positioned;
    • Then wrap the dynamic objects (those that increase in size or addInstance) in subforms flowed. Yet once, there may be a few of these intercalated between positioned trees;
    • Last step: set the subform parent to slur. At this point, things will be moving around the shape and you may need to change the subforms flowed to get the look and feel right.

    Basically, that's what I did with your form (with the exception of teaking in good standing objects).

    I hope this helps,

    Niall

  • Charger property - number of one-dimensional array objects read

    Greetings and happy independence day.

    I use the property Loader to load a local array of containers. I use a ForEach statement to iterate through the array for the number of items varies with the type of the object to measure.

    But now, I need to know how many items is in the table before starting this treatment. I could scratch a local variable and pass through a preliminary ForEach to browse it upward. Is it a better or easier way to do this?

    Thank you

    JVH

    GetNumElements (Locals.MyLocal)

    BTW, you can see which expression functions are available by clicking on the button f (x) on any field of expression. Then go to the operator/functions tab.

  • Comparison of the elements of the two 2D arrays

    Hello!

    I am trying to compare the elements of both 2D and find at least one pair of elements that are identical. Browsing the forum I found a method suggested by Altenbach (http://forums.ni.com/t5/LabVIEW/Compare-elements-in-an-array/m-p/458622). However, it works well with 1 d arrays. That's why I rearranged the original code for my case, but unfortunately the attempt failed. Could someone please take a look at my VI and suggest a solution?

    Thank you.

    5 is correct. Create indicators for arrays of I32 2D coming out the loops with the table inside the cluster. On line 1, column 0 on both of these tables, you will find the value 5. That's what generates your code, but it is probably not what you want.

    Look at what I added at the bottom of the BD, the 2 identical and identical on the FP Indices.

    Lynn

  • Selection of one-dimensional Array objects in a hash table

    Suppose I have a hash table with a list of names of virtual machine.  I also have a variable array containing objects of virtual machine and all of their properties.  I want to scroll the array variable and delete all virtual machine names that do not exist in the hash table.  How do I would accomplish this?

    Thank you

    If your table is called $inArray and your hash table is called $hashTab, you could do something like that

    $outArray = $inArray | %{

    If ($hashTab.ContainsKey ($_.)) VMName)) {}

    $_

    }

    }

    The selected objects will be $outArray table.

  • How to hang a two two-dimensional table

    Hello people,

    I had a problem trying to pass two dimension table as a parameter:

    Spec:
     
    create or replace package test_22012013 as
      type t_record_one is record(
        test1 number(20)
       ,test2 number(20)
       ,test3 number(20)
       ,test4 number(20)
       ,test5 number(20));
    
      type t_array_one is table of t_record_one
        index by varchar2(3);
    
      type t_array_two is table of t_array_one
        index by varchar2(8);
        
      ------------------------------------------------------------------------------
      --Function One
      function f_function_one(i_input_one in test_22012013.t_array_two)
        return number;
        
      ------------------------------------------------------------------------------
      --Function Two
      function f_function_two(i_input_two in test_22012013.t_array_two)
        return number;
    end test_22012013;
    /
    Pack:
    create or replace package body test_22012013 as
      ------------------------------------------------------------------------------
      --Function One
      function f_function_one(i_input_one in test_22012013.t_array_two)
        return number as
      begin
        return 1;
      end f_function_one;
    
      ------------------------------------------------------------------------------
      --Function Two
      function f_function_two(i_input_two in test_22012013.t_array_two)
        return number as
        l_num number(20);   
      begin
        select f_function_one(i_input_one => i_input_two)
          into l_num
          from dual;
      end f_function_two;
    end test_22012013;
    /
    I got error PLS-00382: expression is of the wrong type, PLS-00306: wrong number of types of arguments and PL/SQL: ORA-00904

    Best regards
    Igor

    Igor S. wrote:
    Hello people,

    I had a problem trying to pass two dimension table as a parameter:

    Spec:

    
    create or replace package test_22012013 as
    type t_record_one is record(
    test1 number(20)
    ,test2 number(20)
    ,test3 number(20)
    ,test4 number(20)
    ,test5 number(20));
    
    type t_array_one is table of t_record_one
    index by varchar2(3);
    
    type t_array_two is table of t_array_one
    index by varchar2(8);
    
    ------------------------------------------------------------------------------
    --Function One
    function f_function_one(i_input_one in test_22012013.t_array_two)
    return number;
    
    ------------------------------------------------------------------------------
    --Function Two
    function f_function_two(i_input_two in test_22012013.t_array_two)
    return number;
    end test_22012013;
    /
    

    Pack:

    create or replace package body test_22012013 as
    ------------------------------------------------------------------------------
    --Function One
    function f_function_one(i_input_one in test_22012013.t_array_two)
    return number as
    begin
    return 1;
    end f_function_one;
    
    ------------------------------------------------------------------------------
    --Function Two
    function f_function_two(i_input_two in test_22012013.t_array_two)
    return number as
    l_num number(20);
    begin
    select f_function_one(i_input_one => i_input_two)
    into l_num
    from dual;
    end f_function_two;
    end test_22012013;
    /
    

    I got error PLS-00382: expression is of the wrong type, PLS-00306: wrong number of types of arguments and PL/SQL: ORA-00904

    Best regards
    Igor

    Try

    create or replace package body test_22012013 as
      ------------------------------------------------------------------------------
      --Function One
      function f_function_one(i_input_one in test_22012013.t_array_two)
        return number as
      begin
        return 1;
      end f_function_one;
    
      ------------------------------------------------------------------------------
      --Function Two
      function f_function_two(i_input_two in test_22012013.t_array_two)
        return number as
        l_num number(20);
      begin
    /*    select f_function_one(i_input_two)
          into l_num
          from dual;*/
          l_num:= f_function_one(i_input_two);
          return l_num;
      end f_function_two;
    end test_22012013;
    
  • Temporary Tables vs. two multidimensional arrays

    Dear gurus,

    We have an obligation to perform a loop on a few thousand lines and do some calculations complex (to do in PL/SQL cannot be through simple SQL). These lines came out of a long running query dealing with millions of rows.

    Now the question - our team is to have a confusion if we need to use a temporary table or tables in two dimensions.

    We tried both ways and right now, there seems to have not much of a difference in processing times. (I know it's not good to be based solely on the processing time, especially when it is just a test environment - not as much data as in production, diiferent server,...)

    Could you gurus please thow shed some light on this? The use of memory other resources the same in both cases?

    Thanks in advance.

    884476 wrote:

    TWG is also private, no data?

    Definition of static, private data. Like object class which is public, and all objects instantiated from this class exist in the code that builds the object.

    Where should it be stored? In the files of data - or PGA?

    No PGA. Oracle will use the temp space (shareable) database.

  • Save two-dimensional image od for the web

    Hello

    I made the script (with your help ) to export images for the web with dimensions 300 x 300 px. Now, I want my script to resize more than files that I get two files one 300 x 300 and another 66 x 66 px. I'll post my script and you ask hel find me the bug

    And another question. My script exports the file name + jpg, but it also keeps orginal extension if I get IE. FileName.psd.jpg

    can you help me solve this in my script... else is very well...

    Thank you

    Voah

    Edit:

    At the time of meen I managed to solve the problem, so here's the new script

    But I still have one thing I want to do. I have to manually do folder "300 x 300 and '66 x 66' or my script stops." How coud I do this script make sure files? (inputFolder/300 x 300 / and inputFolder/66 x 66 /)

    Save current preferences dialog

    var startDisplayDialogs = app.displayDialogs;

    Save preferences of current unit

    var originalRulerUnits = preferences.rulerUnits;

    preferences.rulerUnits = Units.PIXELS;

    var inputFolder is Folder.selectDialog ("select input file");.

    var outputFolder is Folder.selectDialog ("select output folder");.

    ProcessImages();

    function ProcessImages() {}

    var filesOpened = 0;

    If (inputFolder == null | outputFolder == null)

    {

    If (inputFolder == null) {}

    Alert ("no source folder selected");

    }

    If (outputFolder == null) {}

    Alert ("no output folder selected");

    //      }

    }

    else {}

    List of files of the var = inputFolder.getFiles ();

    for (var i = 0; i < fileList.length; i ++) {}

    If (instanceof file in the list of files [i] & &! fileList [i] .hidden) {}

    Open (fileList [i]);

    ResizeImage();

    filesOpened ++;

    }

    // }

    }

    Return filesOpened;

    }

    function ExportPng (filePrefix, fileSuffix) {}

    Try

    {

    var app.activeDocument = docRef;

    var Nomdoc = app.activeDocument.name.slice (0, -4);

    saveOptions var = new ExportOptionsSaveForWeb();

    saveOptions.quality = 70;

    saveOptions.format = SaveDocumentType.JPEG;

    saveOptions.optimized = true;

    docRef.exportDocument(File(app.activeDocument.path+'/300x300//'+docName+'.jpg'), ExportType.SAVEFORWEB, saveOptions);

    }

    catch (e)

    {

    Alert ("error when you try to save the image.") \r\r"+ e);

    return;

    }

    };

    funkcija export 2

    function ExportPng2 (filePrefix, fileSuffix) {}

    Try

    {

    var app.activeDocument = docRef;

    var Nomdoc = app.activeDocument.name.slice (0, -4);

    saveOptions var = new ExportOptionsSaveForWeb();

    saveOptions.quality = 70;

    saveOptions.format = SaveDocumentType.JPEG;

    saveOptions.optimized = true;

    docRef.exportDocument(File(app.activeDocument.path+'/66x66//'+docName+'.jpg'), ExportType.SAVEFORWEB, saveOptions);

    }

    catch (e)

    {

    Alert ("error when you try to save the image.") \r\r"+ e);

    return;

    }

    };

    ResizeImage() function

    {

    If (app.documents.length > 0) {}

    var app.activeDocument = docRef;

    var n = docRef.pathItems.length;

    If ((n>0) & & (docRef.pathItems [0] .name! = "Work path")) {}

    docRef.pathItems [0] .makeSelection ();

    docRef.selection.invert ();

    docRef.selection.clear ();

    docRef.selection.deselect ();

    }

    };

    function fitImage() {}

    var app.activeDocument = docRef;

    docRef.trim)

    var docWidth = docRef.width.as ("px");

    var docHeight = docRef.height.as ("px");

    If (docWidth / docHeight > 4.8)

    {

    docRef.rotateCanvas (315)

    docRef.trim)

    }

    ElseIf (docHeight / docWidth > 4.8)

    {

    docRef.rotateCanvas (45)

    docRef.trim)

    }

    If (docWidth < docHeight)

    {

    docRef.resizeImage (undefined, UnitValue(270,"px"), 72, ResampleMethod.BICUBIC)

    }

    ElseIf (docWidth > docHeight)

    {

    docRef.resizeImage (UnitValue (270, "px"), undefined, 72, ResampleMethod.BICUBIC)

    }

    Else if (docWidth == docHeight)

    {

    docRef.resizeImage (UnitValue(270,"px"), UnitValue(270,"px"), 72, ResampleMethod.BICUBIC)

    }

    docWidth = docRef.width.as ("px");

    docHeight = docRef.height.as ("px");

    If (docWidth < docHeight)

    {

    docRef.resizeCanvas (UnitValue(300,"px"), UnitValue(300,"px"), AnchorPosition.MIDDLECENTER);

    }

    ElseIf (docWidth > docHeight)

    {

    docRef.resizeCanvas (UnitValue(300,"px"), UnitValue(300,"px"), AnchorPosition.MIDDLECENTER);

    }

    Else if (docWidth == docHeight)

    {

    docRef.resizeCanvas (UnitValue(300,"px"), UnitValue(300,"px"), AnchorPosition.MIDDLECENTER);

    }

    };

    var app.activeDocument = docRef;

    var docRef.activeHistoryState = savedState;

    fitImage();

    app.displayDialogs = DialogModes.NO;

    ExportPng (file ('.jpg ',' '))

    docRef.resizeImage (UnitValue(66,"px"), UnitValue(66,"px"), 72, ResampleMethod.BICUBIC);

    ExportPng2 (file ('.jpg ',' '))

    docRef.close (SaveOptions.DONOTSAVECHANGES);

    docRef = null;

    }

    Reset the application preferences

    app.displayDialogs = startDisplayDialogs;

    preferences.rulerUnits = originalRulerUnits;

    Does that help?

    main();
    function main(){
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    var inputFolder = Folder.selectDialog("Select the input folder");
    if(inputFolder == null) return;
    var fileList = inputFolder.getFiles(/\.(jpg|tif|psd|png)$/i);
    var outputFolder1 = Folder(inputFolder + "/300x300");
    if(!outputFolder1.exists) outputFolder1.create();
    var outputFolder2 = Folder(inputFolder + "/66x66");
    if(!outputFolder2.exists) outputFolder2.create();
    for (var a in fileList){
    open(fileList[a]);
    var Name = decodeURI(activeDocument.name).replace(/\.[^\.]+$/, '');
    app.activeDocument.trim(TrimType.TRANSPARENT);
    FitImage(300,300);
    var saveFile = File(outputFolder1 + "/" + Name + ".jpg");
    SaveForWeb(saveFile,70);
    FitImage(66,66);
    var saveFile = File(outputFolder2 + "/" + Name + ".jpg");
    SaveForWeb(saveFile,70);
    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
    }
    preferences.rulerUnits = originalRulerUnits;
    }
    function FitImage( inWidth, inHeight ) {
     var desc = new ActionDescriptor();
     var unitPixels = charIDToTypeID( '#Pxl' );
     desc.putUnitDouble( charIDToTypeID( 'Wdth' ), unitPixels, inWidth );
     desc.putUnitDouble( charIDToTypeID( 'Hght' ), unitPixels, inHeight );
     var runtimeEventID = stringIDToTypeID( "3caa3434-cb67-11d1-bc43-0060b0a13dc4" );
     executeAction( runtimeEventID, desc, DialogModes.NO );
    }
    function SaveForWeb(saveFile,jpegQuality) {
    var sfwOptions = new ExportOptionsSaveForWeb();
       sfwOptions.format = SaveDocumentType.JPEG;
       sfwOptions.includeProfile = false;
       sfwOptions.interlaced = 0;
       sfwOptions.optimized = true;
       sfwOptions.quality = jpegQuality;
    activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);
    }
    
  • sum on two dimensional

    Hi all, I'm fine with excel, but have trouble extrapolating numbers for this and hoping that someone can help.

    Basically, for example, a spreadsheet to budget domestic.  I have a table of data where column A is the month of the entry, column B is the category, and column C is the $.  Something like:

    A         B                   C

    April 1 grocery store $100

    2 April gas $50

    grocery store $75 April 3

    May 4 utilities $50

    grocery store $90 may 5

    May 6 gas $40

    (imagine the above, but with several months of data).

    I want to create a summary table summarizing the totals by month and category

    A                   B                C

    April may

    Food products 1 175-$ 90

    2    Gas                $50             $40

    3 utilities $0 $ 50

    That means, in B1, the sum of $ is the $ total for all groceries in April entries in the table above ($100 + $75).

    My excel formulas do not seem to be transferred on the well, when I try to build it.  Any ideas?  What is quite a unique use of SUMPRODUCT in numbers or something else?

    Thanks for the thoughts that you all.

    See you soon,.
    Aaron

    The numbers do not support forms of 'matrix formula' of SUMPRODUCT.  Use rather SUMIFS (which also works well in Excel).

    The formula in B2, filled with worms the down and right, is:

    = SUMIFS(Data::$C,Data::$A,B$1,Data::$B,$a2)

    Be sure to type a "before names so that the numbers treated as text and you will get a match."  Otherwise, it will guess that you mean a date and time string (which will match this year, but not for the entries of entry next year).

    SG

Maybe you are looking for

  • Re: Satellite a200. Resetting or freezing when power cord plugged

    Hey,. Ive recently had my computer cleaned after that I had problems with it cutting cause of overheating. It allows to cut while loading Vista too I thought only a dust problem.However after it has been cleaned professionally and reformat the comput

  • Problems with split for VLC window view

    I'm trying to break the window of vlc for the side of the desktop by pressing the button expand for a long time. However, the snap of the VLC window generates a full size black screen. Why is this and how to fix this? Using OS X El Capitan, VLC 2.2.1

  • Question on the repair process.

    Someone had experience with the process of repair of HP? They just swap my laptop on for some old renovated piece of junk with a new set of problems, or will I get my actuall back machine? I also believe that my HARD drive is dead, and of course I wa

  • Two drops of blue screen in a row!

    I have the dmp files, but do not know how to open them. Here is the text of the error message I received after the first crash. Any help is appreciated! Thank you very much. Signature of the problem:Problem event name: BlueScreenOS version: 6.1.7601.

  • Windows 7 cannot send the print to the queue file

    I just finished the upgrade to Windows 7 Home Premium 64-bit, and then I have updated software for my Photosmart D7160 using the full function driver.  Everything seems to have worked properly - until I try to print.  He always looks good, but there