Global arrays?

I would like to have some arrays that I can use from from a form to another form.
Any idea how to do so?
Thanks..

I would like to have some arrays that I can use from from a form to another form.You don't mention your Forms version but if you are work with Forms 6/6i and higer just use global record group. It's exactly what you are looking for. It even has "1 line quick command to seach for a data within an array" -
Get_Group_Record_Number. More on this topic you could find in online help.

Similar Messages

  • Apex_items and apex global arrays

    Hi,
    I'm using apex_item.checkbox and apex_item.text via an sql report like this:
    SELECT
    id,
    apex_item.checkbox(1,id) " ",
    apex_item.text(2,name) "name"
    FROM APEX_APPLICATION_FILES
    WHERE REGEXP_LIKE(name,'txt');and an after submit process like this:
    DECLARE
    BEGIN
    --Loop through the selected id
    FOR i in 1..apex_application.g_f01.COUNT
    LOOP
      IF apex_application.g_f01(i) IS NOT NULL
        THEN
           INSERT INTO INC9_TEST(t2)values(apex_application.g_f02(i));
           wwv_flow.debug('MY PROCESS:' || APEX_APPLICATION.G_F02(i));
      END IF;
    END LOOP;I've two rows sample data like:
    Id  name
    1   abc
    2   defWhen I select the checkbox for Id 2, it keeps returning Id 1 in the apex_applicaiton.g_f01 global array instead of Id 2. But If I select both checkboxes, then it correctly loops through with id of 1 and 2. Does anyone know why this is happening and what the fix is for this strange behavior?
    Thanks

    OK - I did explain that on the thread I linked to. You need to have the checkbox values set to the row numbers. This can be done using something like:
    APEX_ITEM.CHECKBOX (1, '#ROWNUM#')Now, if the user checks any checkbox(es), the value(s) submitted will be row numbers.
    You can then use this to retrieve the NAME value for the same row:
    DECLARE
    vROW NUMBER;
    vNAME VARCHAR2(100);
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT
    LOOP
      vROW := APEX_APPLICATION.G_F01(i);
      vNAME := APEX_APPLICATION.G_F02(vROW);
      ... etc...
    END LOOP;
    END;So, we first get the row number for each checked item and then use this to get the name value for the corresponding row.
    Andy

  • Can't access global array

    Hi,
    I am using ActionScript 2.0, and I have the following
    situation:
    I have a function which fetches values from database and sets
    those values in an array.
    Now when I am accessing those array values in another
    function, i am unable to access them.
    So the solution I found was to declare the array as global. I
    tried and searched for declaring global arrays, but no success.
    I have tried _global, at some site, i found that _global does
    not work in AS 2.0.
    I have also tried using variable names prefixed underscore
    and double underscore, but no success.
    Please suggest me a way out of this problem, how to declare
    global array.
    Thanks in advance.

    there is no global per say in action script and IMHO global
    is a very very bad design decision, instead you can have a "global"
    for an instance scope, say your function that fetches array is in
    some class A then you can have variable in that class :
    private var myarray:Array or
    private var myClass:ArayCollection
    then if both functions are in same class you can accessing
    with no problem, if functions are in different class then your
    variable neesd a public modifier and you will also need a clas
    instance that holds that array in a function so that you can say
    myclassinstance.myArray

  • Station global array

    Hi,
    Using a sequence with active X calls to  create an intialise station globals is the solution to our problem.
    But,
    There doesnt seem to be a way to set or get an Array.
    Does anyone know how to do this ?
    i.e
    Using Active X steps:
    Programatically create an array in the station globals.
    Set values of this array.

    Hi,
    Use the SetValVariant  method.
    Your array must exist, as the option 0x01 (insert if missing) is not supported using the SetValVariant method.
    As an example, Call PropertyObject.SetValVariant("MyArray", 0, {1.2, 2.3, 3.4}) using "StationGlobals" as the reference will fill the array called StationGlobals.MyArray. If the array is already sized and has contains then that contents will be overwritten and the array will be resized, e.g for my example it will become a size of 3 elements.
    Check out the examples for accessing arrays with other languages in the examples folder of TestStand.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Multi-dimensioned global arrays

    I'm using a couple of global multi-dimensioned string arrays (they're used in multiple functions throughout the program) and I don't know the boundaries of either dimension until run-time.
    It works fine to use the "new" on a single-dimensioned array, but I'm getting a compiler error when I try:
    std::string* dta = new std::string[x][y];
    Any ideas what the problem is?

    It works fine to use the "new" on a single-dimensioned array, but I'm getting a compiler error when I try:
    std::string* dta = new std::string[x][y];
    How do I declare a 2d array in C++ using new?
    http://stackoverflow.com/questions/936687/how-do-i-declare-a-2d-array-in-c-using-new
    - Wayne

  • HTMLDB_APPLICATION.G_Fxx GLOBAL ARRAYS ARE NOT POPULATING CORRECTLY IN IRR

    Hi
    Scenario1:
    Unsorted data
    I have an interactive report with first column as checkbox and 4 editable fields. When I enter an editable field there is a javascript called on this field to make the checkbox in the first column checked. This is working fine.
    Scenario 2:
    Sorted on a column:
    I sort the data on part number and when I go and change one of the editable field the checkbox gets checked which is correct. But when I save HTMLDB_APPLICATION.gxx variable seems to be messed up when IRR is sorted and doesnt save any values.
    Any body faced a similar issue.
    Thanks
    sukarna

    Agreed.
    What I am doing here is that I am populating rownum into the checkbox column in the query and also created rownum in a,b,c,d as hidden items which stores rownum.
    My case will be
    1 checkbox value (1) a(1) b(1) c(1) d(1)
    2 checkbox value (2) a(2) b(2) c(2) d(2)
    When I edit a I go an check checkbox in row 2 as checked in the checkbox so my new data is
    1 checkbox value (1) a(1) b(1) c(1) d(1)
    2 checkbox value (2) checked a(2) b(2) c(2) d(2)
    3 ....
    4 ...
    Now the problem]
    When I loop thru checkbox array using g_f01 I get count 1 as expected and when I refer to the rownum value stored in the checkbox array it is storing wrong rownum value in other words the value in this case should be 2 but it has some wierded rownum 4 or 5 which is reffering to someother row.
    This happens only when I sort the INTERACTVE REPORT.

  • Assign global array of structures of structures of std strings in a dll

    I have a dll which consists of three c files. Find bellow the c file of the loader and the three files of the dll. In dll, file 1 and file 2 are almost identical, static arrays names and sizes, structure names, Prepare_1() and Prepare_2() functions. There
    is a small difference in the function Prepare_1 in the way MuxStatusSupl[ u32Idx ].FileInfo.Name is assigned and there I get an exception. Another difference is that the structure StructStatus in file 2 has an extra member compare to file 1. From this point
    I couldn't strip down even more the sample code because small changes make the problem disappear without, I'm afraid, really solving the problem. That's why I have put so much code here, I'm not even sure what is relevant and what not. For example, if I add
    in file 1 in the StructStatus the extra member u32ExitPoint (and, of course, I modify Status_Init accordingly), I don't see the problem anymore.
    ///////////////////////////////////////////////////// loader file begin ////
    #include "stdafx.h"
    int main(int argc, char* argv[])
    {   HINSTANCE hDLL = LoadLibrary( DLL_FQN_FILE_NAME );
        if( void ( * pCreateDllInterface )( void ) =
                (void(*)())GetProcAddress( hDLL, "CreateDllInterface" ) )
            pCreateDllInterface();
        FreeLibrary( hDLL );
    ///////////////////////////////////////////////////// loader file end //////
    ///////////////////////////////////////////////////// dll main file begin //
    extern void Prepare_1( void );
    extern void Prepare_2( void );
    extern "C" _declspec(dllexport) void CreateDllInterface( ) { Prepare_1(); }
    ///////////////////////////////////////////////////// dll main file end ////
    ///////////////////////////////////////////////////// dll file 1 begin /////
    #include <string>
    #include <sys/stat.h>
    #define STORAGE_SIZE  254
    typedef unsigned long  int uint32;
    struct StructFileInfo
    {   std::string Name; 
        struct stat FileStatus; 
    static struct StructStatus
    {   bool bDownloaded;      bool bDownloadedLast;
        bool bCalled;          bool bCalledLast;
        uint32 u32EntryPoint;
        StructFileInfo FileInfo;
    } MuxStatusMain[ STORAGE_SIZE ], MuxStatusSupl[ STORAGE_SIZE ];
    void Prepare_1() 
    {   struct stat Stat_Init;
        memset( &Stat_Init, 0, sizeof(struct stat) );
        StructStatus Status_Init =
                        { false, false, false, false, 0, { "", Stat_Init } };
        std::fill_n( MuxStatusMain, STORAGE_SIZE, Status_Init ); //  this seems
                               // to overwrite MuxStatusSupl[ 3 ].FileInfo.Name
        for( uint32 u32Idx = 0; u32Idx < STORAGE_SIZE; u32Idx++ )
            MuxStatusSupl[ u32Idx ].FileInfo.Name = ""; // crash when u32Idx==3 
    ///////////////////////////////////////////////////// dll file 1 end ///////
    ///////////////////////////////////////////////////// dll file 2 begin /////
    #include <string>
    #include <sys/stat.h>
    #define STORAGE_SIZE  254
    typedef unsigned long  int uint32;
    struct StructFileInfo
    {   std::string Name; 
        struct stat FileStatus; 
    static struct StructStatus
    {   bool bDownloaded;      bool bDownloadedLast;
        bool bCalled;          bool bCalledLast;
        uint32 u32EntryPoint;  uint32 u32ExitPoint;
        StructFileInfo FileInfo;
    } MuxStatusMain[ STORAGE_SIZE ], MuxStatusSupl[ STORAGE_SIZE ];
    void Prepare_2()
    {   struct stat Stat_Init;
        memset( &Stat_Init, 0, sizeof(struct stat) );
        StructStatus Status_Init =
            { false, false, false, false, 0, 0xFFFFFFFF, { "", Stat_Init } };
        std::fill_n( MuxStatusMain, STORAGE_SIZE, Status_Init );
        std::fill_n( MuxStatusSupl, STORAGE_SIZE, Status_Init );
    ///////////////////////////////////////////////////// dll file 2 end ///////
    I get the crash with the message: Unhalted exception at 0x10001f90 in Test.exe: 0xC0000005: Access violation writing location 0x1006d320
    Another strange phenomena is that in watch window, expressions
        sizeof(MuxStatusMain)/sizof(MuxStatusMain[0])
        sizeof(MuxStatusMain)/sizof(MuxStatusMain[0])
    show both a value of 232 instead of 254 (but if I add in file 1 in the struct the missing member they show the correct values). On the other hand, if I printf those values, they are correct, 254.

    "Another difference is that the structure StructStatus in file 2 has an extra member compare to file 1."
    That's not going to work. It is possible to define the same struct in different translation units but the definitions need to be identical. Use different names for StructFileInfo and StructStatus.

  • Global Array

    I have a very basic problem.
    I need to open a Vector, and keep it up for the whole class. SO I can add to it from many methods within that class.
    how do I do that? I've tried so many things, I've got nothing.
    THanks

    I add into the vector by v.addElement(object).. right? Correct. Though the add(object) method works just the same.
    addElement is the old original method. The add method was added (hehe) when Vector was retrofitted for the Collections framework.
    Are you redeclaring the vector v in your constructor?
    If so it hides the class' attribute, and leaves it as null.
    The Vector v should be declared outside of all methods/constructors.
    No method/constructor should declare a variable called v.
    ie
    public class A {
      private Vector v;
      public void method(){
        // has access to v
      public A (){
        // redeclares v, which hides the top level v.
        Vector v = new Vector();
        System.out.println(v);  // the loval variable v
        System.out.println(this.v);  // the class variable v
    }Hope this helps,
    evnafets

  • Javascript array in global variables

    Hi,
    In my form, I created a global variable called MyArray. Then in my form's initialization script, I've set:
    myform.variables.MyArray = new Array(5);
    and I initialized each value.
    In one of my button's click event, I try to access my global array, without success. I tried:
    myform.variables.MyArray[0], myform.variables.MyArray.value[0]... has anyone managed to create a global variable and use it as an array?
    Thank you!

    Hello.
    I have used the "global." to get global variables. It works fine. I have code like this that works:
    // Initialize global array.
    global.chVArray = new Array(4);
    for (i = 1; i <= 4; i++){
       global.chVArray[i] = false;
    // Somewhere else...
    for (i = 1; i <= 4; i++){
       xfa.host.messageBox (global.chVArray[i].toString());
    BR,
    /Per

  • Loading a text file into a global variable issue - really a global var?

    From all the documentation and examples I can find, it appears that it would be
    correct to create a global array variable [outside of any functions] to load image names into,
    then use these images for a slideshow. I want to make the app dynamic, in that changing the text file gives a new set of images.
    The global variable goes null [no values] after the load event listener. Why is that?
    Isn't global, well global, and alive for the duration of the SWF?
    PARAMS.TXT:
    monthNames=January,February,March,April,May,June,July,August,September,October,November,De cember&dayNames=Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday
    CODE:
    var dNames:Array = new Array();
    var mNames:Array = new Array();
    var request:URLRequest = new URLRequest("images/params.txt");
    var variables:URLLoader = new URLLoader();
    variables.dataFormat = URLLoaderDataFormat.VARIABLES;
    variables.addEventListener(Event.COMPLETE, completeHandler);
    try
    variables.load(request);
    catch (error:Error)
    trace("Unable to load URL: " + error);
    trace("2 mNames 2: " + mNames[2]);
    trace("2 dNames 3: " + dNames[3]);
    stop();
    function completeHandler(event:Event):void
    var loader:URLLoader = URLLoader(event.target);
    dNames = loader.data.dayNames.split(",");
    mNames = loader.data.monthNames.split(",");
    trace(loader.data.dayNames);
    trace("1 mNames 2: " + mNames[2]);
    trace("1 dNames 3: " + dNames[3]);
    OUTPUT:
    2 mNames 2: undefined
    2 dNames 3: undefined
    Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday
    1 mNames 2: March
    1 dNames 3: Wednesday
    How do I access these values after loading from the external file, after the load?
    Thanks in advance.

    The statement you quoted from whatever Adobe documentation is correct.
    If you want to load the data into the arrays before anything else happens, then have anything else that happens execute via the completeHandler function... after the data is loaded and processed into the arrays.
    the command: loadFile() executes before the trace("2:" +images[4]); command.  The loadFile function is processed and the loading process BEGINS... but starting the loading does not delay the main processing from continuing down the line--the loading itself becomes a secondary/background task.  The command was to execute the loadFile function and the processing of that function was completed.  If you don't believe so, then add a trace...
    function loadFile():void
         vars.dataFormat = URLLoaderDataFormat.VARIABLES;
         vars.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
         vars.load(new URLRequest("images/fnames.txt"));
         trace("started loading");
    If you add that trace, you should see that the loadFile function execution is completed and the next line in your code is then processed... trace(2....)
    The addEventlistener does not stop anything.  The addEventListener code is assigning a monitor, not a traffic controller... it is telling the monitor to indicate when the data has finished loading.  It is not telling anything to stop program execution.
    So if you want to wait until the data is loaded before you do anything else... it goes....
    function onComplete(evt:Event):void
         var urlVars:URLVariables = evt.target.data;
         images = vars.data.images.split(",");
         tnails = vars.data.thumbnails.split(",");
         ................HERE.................

  • [JS] (CS3) GLOBAL var. Weird behaviour!

    I have been working w/ a GLOBAL array defined in "session"
    The array is being populated with WORD objects when running a checks abbreviations script. Each word skipped are added using the push function. You can view and zero out the array, using ANOTHER script. But when you close the document, if you try to view again the array, there is an error "undefined object". Actually the array exist, it has word objects but if you access one of the contents (ie: SkipWRDS[0].contents), you get an error! So it's kind of corrupted. Any idea?
    Thank you, Alex.

    If the array contains references to words in a document and you close that document then the document no longer exists and so neither do the words. So the error is no surprise.
    Dave

  • Using an array name stored in a String in a Statement

    In my sequence, I build an array in one section and store it in a variable called Locals.Test_Array.
    I build the name of the permanent place I would like to store this array and store it in a string called Locals.SG_Test_Array_Name.
    I would like to move the values from Locals.Test_Array to the Station Globals Array name stored in Locals.SG_Test_Array_Name.
    For example:
    the string stored in Locals.SG_Test_Array_Name is "StationGlobals.Coolant_Temperature_Test_Array" (already created in Station Globals)
    What I am trying to do is this:
    Statement                        StationGlobals.Coolant_Temperature_Test_Array=Loca​ls.Test_Array  (this works)
    The Station Global Array name needs to change as the sequence executes and the data in Locals.Test_Array changes.
    What I need is something like this.
    Statement                         Locals.SG_Test_A​rray_Name=Locals.Test_Array  (where SG_Test_Array_Name is a string that holds the name of the array)
    Thanks, Big_Will

    Evaluate(Locals.SG_Test_Array_Name + " = Locals.Test_Array " )

  • Writing arrays to spreadsheet w/ timestamp

    Hi. I'm trying to build an application which will write a set of thermocouple values to a spreadsheet with a timestamp at the beginning of each row. What I have so far is a countdown loop which gives me regular intervals of time. When the loop reaches zero, the set of values in a global array variable goes into an "Array to Spreadsheet String.vi" then I use the Concatenate string to put a timestamp string, a space and the spreasheet string. Since "Write to spreadsheet.vi" needs an array input, I have to use the "Spreasheet string to Array.vi" then to the "Write to Spreadsheet.vi" So what this does is writes the TC values, but the timestamp gets lost somewhere in there and it write a completely wrong value
    which looks nothing like a timestamp.
    I appreciate any comments on this.

    In order to add a timestamp to each row, you will need to use the "write characters to file" VI. Since a spreadsheet is just a tab-delimited text file, you can use the "array to spreadsheet string" function to convert your array of data into a tab delimited string. Once you have this string, you can concatenate your time data to the start of it and write the resulting string to file.
    I have created a simple example that writes randomly generated numbers to a spreadsheet every 0.5 seconds with a timestamp for each row. Hope this helps!
    Attachments:
    timestamp_spreadsheet.vi ‏20 KB

  • Mapping and global container?

    I have to map single different field IN_F1 to three output fields..
    1) map the input field value IN_F1 to output field value OUT_F1
    2)
    a) based on the INPUT field value , conditionally map incremental numbers to OUT_F2. For example, if IN_F1 is 'X', OUT_F2 will be '01' and second time around I will increment it to '02'.
    b) Same condition as 2a, but move the incremented value from OUT_F2 to OUT_F3 in different node.
    I am planning to set global container in step 2a. And then use  that global container in step 2b to  fill OUT_F3. My question is will steps 2a and 2b always follow the order? Since my field OUT_F3 occurs in node after OUT_F2, 2a should always get executed first. Is this assumption right?
    I am actually invoking standard BAPI.. Would it be better to do all this steps in XI to fill std. BAPI structure or create a custom RFC to do this?

    Hi,
    >>>>Since my field OUT_F3 occurs in node after OUT_F2, 2a should always get executed first. Is this assumption right?
    yes
    you can also get all OUT_F2 in an advanced function
    and put then in a global array which you'll just
    use in a new andanved function to fill OUT_F3
    Regards,
    michal

  • How To Read/Modify/Write Array?

    Ive got a bunch of switches, where each switch represents a bit in a
    word...
    So from each switch, in the control panel, it goes throu a boolean to
    integer vi, and then to a x*2^n vi.
    I then set a constant for each n.. so that if the switch is true (x=1
    after the conversion) and n = 5 for that switch,
    then the output will be 1 * 2^5.
    Finally, I add all 16 outputs together (x*2^0 to x*2^15) to create a
    word.. I actually have so many switches
    that I have a couple of words (each made up with the above scheme)!
    So far, this works fine, however, my question is, I would like to have
    a global array that contains these words. I
    dont want to insert this word into the array, but rather, I'd like to
    sort of latch the values...
    If in the array's word, the n bit was already one (i.e. that switch at
    one point was on), then I dont want to reset it
    to 0, even though the switch is off now.
    This probably sounds confusing, I know I am confused just reading that
    back, anyhoot, if I could make a global
    array (ten 16-bit unsigned words), that I can read any word from,
    modify it and set it back to its same place,
    that would be great!

    Hi Anonoymous
    Here's one quick example that does what you want, it functions like a function global and relies on boolean logic.
    For your own experience I challenge you how to reset just one bit or word.
    Also you have to connect the connector pane.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    quickbitregister.vi ‏20 KB

Maybe you are looking for