Name of the dynamic property of object in the table based on the value of a variable

I have two paintings of custom class objects

var obj1:Object1
var obj2:Object2

var array1:Array = [obj1[0], obj1[1], ...]
var array2:Array = [obj2[0], obj2[1], ...]

Object1 has a property named. Name while Object2 has a property named. Title.

Now I have a common function including cab accepts an array (array1 or array2) and the name of property the object ("Name" or "Title") as input and needs to access this name of the property of the objects in the array:

function myFunction(arr:Array, fieldName:String)
{
    arr[0].fieldName  = "xxx";
}

the problem I have this achievement does not because the code in the function assumes that the property of that object in the table is actually a string "fieldName" while I want to dynamically determine the names of the fields based on the value of this variable, but cannot understand the syntax to do!

Don't know if I'm clear - hope that makes sense... ;-) Thank you

Hey p3pp3r,

I think I understood you. Try the following and see if you get good results:

function myFunction(arr:Array, fieldName:String)
{
    arr[0][fieldName]  = "xxx";
}

Let me know how it turns out. Good luck!

Tags: BlackBerry Developers

Similar Questions

  • Send the name and the value of the control to Subvi

    Hi all

    I am trying to send the names and values of the controls to a Subvi.

    I know that I can check out the name and the value of the control by using a property node, but I was looking for a way to make is easy for the programmer to use.

    I think some sort of bundle function, it records the name and the value of the control, but I would like the programmer to be able to connect a random number

    controls to the Subvi without having to specify the number of controls Anywhere.

    I know there is stuff in labview configuration file, but it seems a bit more complex, so what I want to do.

    Also, I know that I can use the OpenG toolkit, but I will not use additional LabVIEW modules, as this VI may run on several different computers.

    I hope I made my problem clear enough!

    Good day

    Concerning

    Tommy

    What, creating an array of references to the command.  On the hand, you will need to fill the table with control references that you want to send to the Subvi.  In the Subvi, use a loop For with indexing to get every reference, and then use the nodes property to get the name and value.

  • Display the name of the tag as the column name and the value in the tag as a row of data from the input string.

    Hi Forum members,

    I am looking for a query display the name of the tag as the column name and the value in the tag as a row of data.

    I have to print the values within the tag to a file by choosing the value of the flags. the sequence of the tags will vary each time, as the tag name will change dynamically.

    So here is the example of input data and the expected output. The string in the text column must be separated as the column names and values.

    Input data
    Select 1 as seqno,' < > 0210A 50 4f < / 4f > < 5f20 > TEST CARD 16 < / 5f20 > < 5f2a > < / 5f2a > < 82 > 1 c 00 < / 82 > ' double text


    Output:

    Seqno 4f 5f20 5f2a 82
    0210A 50 16 1 00 TEST CARD 1

    Please help me by providing your entries on this.

    We use the version of Oracle 11.2.

    Note: This is not the XML string

    Thank you

    Shree

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    )

    Select d.seqno, x.*

    d the data,

    XMLTable ('/ root')

    by the way xmltransform (xmltype ('': replace (replace (text,'<><>'),)))

    XmlType (q'~http://www.w3.org/1999/XSL/Transform "version ="1.0"> ")

                                                     

                                                       

                                                         

                                                       

                                                     

                                                     

                                                       

                                                         

                                                       

                                                     

    ~'

    )

    )

    path of columns '4f' varchar2 (10) "tag4f."

    path of "5f20' varchar2 (30)"tag5f20. "

    path of '5f2a' varchar2 (10) "tag5f2a."

    path of varchar2 (10) "82" "tag82.

    ) x


    SEQNO 4f 5f20 5f2a 82
    1 0210A 50 16 TEST CARD - 1 00
    2 0210A 50 16 TEST CARD - 1 00
    3 0210A 50 16 TEST CARD - 1 00
    4 0210A 50 16 TEST CARD - 1 00

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    ),

    Chopper (seqno, Key, value, String) as

    (select seqno,

    regexp_substr (text,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (Text,'>(.*?))

    regexp_substr (text,'<.+?>. *? ) (.*) $', 1, 1, null, 1). » <>'

    from the data

    Union of all the

    Select seqno,

    regexp_substr (String,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (String,'>(.*?))

    regexp_substr (String,'<.+?>. *? ) (.*) $', 1, 1, null, 1)

    Chopper

    where regexp_substr (string,'<(.*?)>', 1, 1, null, 1) is not null

    )

    Select '4f', seqno, '5f2a', '82', '5f20.

    of (seqno, lower (key) select key, value)

    Chopper

    )

    Pivot (max (value) for key in ('4f' as '4f', '5f20' as '5f20', '5f2a' as '5f2a', "82" as "82"))

    Concerning

    Etbin

  • How to get a program all the list of the names of the values in a registry key?

    Hello

    How to get a program all the list of the names of the values in a key of windows registry without having to configure the number of values in the key?

    Thank you & best regards

    Samuel J

    Hi Samuel,.

    you will get this info from "Query registry key Info.vi".

    Mike

  • How to apply the procedure inside a procedure and the evils of the value in a variable?

    Hi all

    I'm usung oracle 11g.

    Here is my package and procedure

    I want to call get_email_details this procedure within the process_email_master and store the value in a variable in main proceedings

    create or replace

    PACKAGE ms_gen_process_email

    as

    type email_type is rendered (subject varchar2 (4000 tank),

    email_body varchar2 (4000 tank),

    to_receipent varchar2 (4000 tank),

    cc_receipent varchar2 (4000 char));

    type email_type_table is table of the email_type;

    procedure process_email_master)

    p_metric_name IN VARCHAR2,

    p_current_stage in varchar2,

    p_action in varchar2,

    p_pid number,

    P_OBJECT_ID in varchar2

    -p_emai_master on p_email_type_table

    );

    PROCEDURE get_email_details)

    p_metric_name IN VARCHAR2,

    p_current_stage in varchar2,

    P_ACTION in varchar2,

    p_email_type_table1 on email_type_table

    ) ;

    END ms_gen_process_email;

    ----

    create or replace

    PACKAGE ms_gen_process_email BODY

    as

    procedure process_email_master)

    p_metric_name IN VARCHAR2,

    p_current_stage in varchar2,

    p_action in varchar2,

    p_pid number,

    p_object_id in varchar2

    )

    as

    Start

    null;

    EXCEPTION

    WHILE OTHERS

    then

    null;

    end process_email_master;

    PROCEDURE get_email_details)

    p_metric_name IN VARCHAR2,

    p_current_stage IN VARCHAR2,

    P_ACTION in varchar2,

    p_email_type_table on email_type_table

    )

    as

    BEGIN

    Select the object, email_body, to_receipent, cc_receipent

    bulk collect into p_email_type_table

    of ms_gen_email_config_detail

    WHERE email_key =)

    SELECT email_key

    OF ms_gen_email_config

    WHERE metric_name = p_metric_name

    AND action p_action =

    and current_stage = p_current_stage

    );

    for me in p_email_type_table.first... loop of p_email_type_table. Last

    dbms_output.put_line (p_email_type_table (i) reserve .under | p_email_type_table (i) .email_body: p_email_type_table (i) .to_receipent: p_email_type_table (i) .cc_receipent);

    end loop;

    EXCEPTION

    WHILE OTHERS

    THEN

    NULL;

    END get_email_details;

    END ms_gen_process_email;

    but I get this error message

    Error (15,31): PLS-00201: identifier 'P_EMAIL_TYPE_TABLE' must be declared

    Concerning

    Dale

    See below the test case and change your code. You can call the procedure in detail within a main as procedure below

    CREATE or REPLACE PACKAGE test_pkg AS

    TYPE rec_val IS RECORD (empno, emp.empno%TYPE,

    Ename emp.ename%TYPE

    );

    TYPE nt_tabtest IS TABLE OF THE rec_val;

    PROCEDURE get_email_id (p_type to nt_tabtest);

    PROCEDURE get_email_master;

    END;

    /

    CREATE or REPLACE PACKAGE test_pkg BODY

    AS

    PROCEDURE get_email_id (p_type ON nt_tabtest)

    AS

    BEGIN

    SELECT EmpNo, ename COLLECT in BULK in p_type FROM emp;

    END;

    PROCEDURE get_email_master

    AS

    v_type nt_tabtest;

    BEGIN

    get_email_id (v_type);

    BECAUSE me IN v_type. FIRST... v_type. LAST

    LOOP

    DBMS_OUTPUT. Put_line (v_type (i) .empno: v_type (i) .ename);

    END LOOP;

    END;

    END;

    /

    Post edited by: 000000

  • PROBLEM changing the value of a variable in my scene movieclip

    Hello
    I have a problem changing the value of a variable in my scene movieclip. I explain: I combobox on my stage containing the categories, and in the scene that I load an xml file containing links to php files that work with the combobox control.
    On the stage I have a movieclip "camera roll" inside this movieclip on the first image I have a php script file selected in the scene of loading. I use a function with a variable load() "theUrl" inside like this: T.load (theUrl);
    In my scene, I want to change the value of "theUrl" within the film of movieClip. I tried filmstrip.theUrl = url; But it does not work

    the xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <slideshow>
    <area title1="10 Last updated" link1="link1.php"/>
    <area title1="special" link1="link2.php"/>
    </slideshow>

    Here is the code on my stage:

    var link1:Array = new Array();
    var LINK:String;
    var url:String;
    var whoOn:Number;
    whoOn=0;
    var x:XML = new XML();
    x.ignoreWhite = true;
    x.onLoad = function(success) {
    var photos:Array = this.firstChild.childNodes;
    for (i=0; i<photos.length; i++) {
    _root.link1.push(photos[i].attributes.link1);
    }
    url=link1[whoOn];
    filmstrip.theUrl=url;//<<--HERE
    };
    x.load("category.xml");
    
    var cbListener:Object = new Object();
    cbListener.change = function(event_obj:Object) {
    trace(select.selectedItem.label);
    if (select.selectedItem.label == "Last updated") {
    whoOn=0;
    } else if (select.selectedItem.label == "Special") {
    whoOn=1;
    }
    url=link1[whoOn];
    filmstrip.theUrl=url; //<<-----HERE   
    };
    select.addEventListener("change",cbListener);
    
    

    Here is the code inside the clip "film".

    var T:XML = new XML();
    T.ignoreWhite = true;
    T.onLoad = function(xml) { 
    etc etc etc }
    
    T.load(theUrl);    //<<---HERE it still undefined

    the code on the timeline of the film should be placed in a function() (or better, move all your code to the main timeline).  but, if you leave the code on the timeline of the film strip, call the function that contains this code whenever the url changes.

  • How to set the value of a variable in automator?

    I'm totally new to automator I found a post that I try to reuse

    to Re: copy multiple files from TextEdit in one Word file

    I want to open a series of html files in a folder and convert in a TextEdit rtf file.

    However, I am unable to automator find out how set the value of a variable such that it appears in this post

    I looked at every command in library without a lot of fortune

    Any help?

    Thank you

    Dan

    Its in Utilities.

    In Automator, use the search box:

  • Monitor changes in the value of a variable in a module of code labview TestStand?

    Hi all

    A code in Labview module called from an action step has a particular variable that changes its value when running vi. Is it possible to monitor these changes through for example a local variable in TestStand and display different values on UI in real time via UIMessages?

    Thank you very much!

    You must post a UIMessage during execution of your VI.  As the following picture below, you can ignore the SequenceErrorMessage string and use the value of your variable as the numericDataParam.   I guess the trick is to determine where to display the user interface of Message, in your case, the variable updated at certain times or it he constantly updated?  I'm not sure of the performance LAG if at all times you post a UIMessage say every 100ms.

    On the other end, you will need in your interface user create a reminder of the Interface to manage the UIMessage.  See the following link for more details.

    http://www.NI.com/white-paper/4532/en

    Enjoy,

    PH

  • How to assign the value of a variable to a quiz?

    Hi, I have a problem, I attempted to set the value of a variable for the quiz on the final value of the project, any suggestions?

    Sorry but I do not understand your question at all. If you talk about a quiz like cpQuizInfoPointsscored or cpInfoPercentage system variable, this is all simply impossible because the system variables are read-only.

  • Access the value of a variable assigned to CompositionReady?

    I created a variable called counter inside the 'scene' in the "CompositionReady" using the following code.

    var counter = 0;

    How to get or write the value of this variable

    through a 'trigger '?

    Remove the var on the counter.

    Just so put this in compositionReady

    counter = 0;

    Then you can just call him in a trigger as

    Alert (Counter);

    or

    counter + 1;

    or as if (counter == 1) {}

    }

    or whatever.

    I hope this helps.

  • Can we use the value of a variable in a warning message

    I have a variable in forms6i. I want to use the value of this variable in an alert message. How is that possible?

    Gul says:
    I have a variable in forms6i. I want to use the value of this variable in an alert message. How is that possible?

    Try

    DECLARE err_txt VARCHAR2(200) t;
     al_id ALERT;
     al_button Number;
    BEGIN
    al_id := FIND_ALERT('My_Error_Alert');
    SET_ALERT_PROPERTY(al_id, alert_message_text, 'Hello how are you mr. variable '||:variable_name );
    al_button := SHOW_ALERT( al_id );
    END; 
    

    Hope it works...

    Hamid

  • problem by setting the value of a variable substitution in a calc script

    Hi all.


    I'm trying to update the value of a variable substitution inside an IF statement, and I have a problem.

    Here is the code:


    * "Jan" (*) "
    IF (LoopCounter = 1) & varEntity = "100";
    ENDIF ;)

    the error that I get back from Regional service is:

    Error: 1200336 error analysis [Jan] (line 54) formula: [()] without [)]

    It's tricky. Without really analyzing the details of your example, two options that might be worth a visit:

    1. write a MaxL script for updating the subvar (s), and then run the calc, x 20. 40 lines of MaxL and 500 lines of code is 10 000. Obviously, this only works if the launch of the MaxL script is feasible, and you know that you aren't going to have multiple instances of the calc (or any what calc which depends on these subvars) running at the same time. But I guess you're OK with the last part, because even your original solution would have this problem
    2 hyperion Business Rules

    I know that CL knows a lot of HBR, if he is here today...

  • Selective display of a report based on the value of a Variable of presentation

    Hello

    Is it possible to selectively display a report on a dashboard page based on the value of a variable presentation.

    I have 5 reports that are part of the same page that has a page with 5 options-level prompt.

    According to the option selected in the command prompt that the value is stored in a variable of the presentation, I need only 4 reports to view at any time (ie 1 report should NOT be directed).

    Example: -.

    When Option 1 is selected 1,2,3,4 reports must be posted
    When Option 2 is selected 2,3,4,5 reports must be posted


    Thanks in advance

    Hello

    Search this Guided Navigation forum. In this way, you can hide a section on your dashboard based on the results of a report that is "hidden".

    Good luck

    Daan Bakboord

  • Display a series of images on the stage based on the value of a variable

    Hi all

    Here's another interesting problem! Well, I have an interactive retention test which is charge of an xml file based on the value of a variable scenario (for example, if script = Architecture, then load Q_set 1, if scenario = history then load something else). Now, I would like to extent this and display a series of images on my stage which will be valid only in the current scenario. Here is my code so far. I thought load a list of images on the beginning of the film (for example, Architecture_list, History_list) and then call them according to the value of the variable of scenario, but I would like to hear what you have to say. Any ideas?

    The answer is a series of managers: one called at the beginning of the movie to fill the lists of the appropriate folders (based on the value of the variable gimage) and the other called next and previous. Here they are in case yu need:

    ---------
    Global gFileList, gImagePath, gimages

    on buildList

    gFileList =]

    -defining the path to images:

    gImagePath = "@images /" & gimages & ' / ' "»

    Repeat with i = 1 to the maxinteger
    thisFile = getNthFileNameInFolder (gImagePath, i)
    If thisFile = EMPTY then exit
    If thisFile = the movie then the next repetition
    types of files = [".pct", ".jpg", ".bmp", ".gif"]
    howManyTypes = count (fileTypes)
    Repeat with thisType = 1 to howManyTypes
    extension = getAt (file types, if thisType)
    If thisFile contains extension then
    gFileList.append (thisFile)
    end if
    end repeat
    end repeat

    Member ("Display"). FileName = gImagePath & gFileList [1] - put the first image in the folder at the appropriate place

    Member ("Display"). Picture = .photo member ("display")

    buildList end

    --------------------
    Global gFileList, gFileIndex, gImagePath

    on nextFile

    gFileIndex = gFileIndex + 1

    If gFileIndex > count (gFileList) then

    whichFile = gFileList [1] - set the image = in the last loaded picture holder
    gFileIndex = 1 - the value of the index to the last trick question

    Member ("Display"). FileName = gImagePath & whichFile
    Member ("Display"). Picture = .photo member ("display")
    updateStage

    -go to the audio issues

    _movie. GB (31)

    on the other

    whichFile = gFileList.getAt (gFileIndex)

    Member ("Display"). FileName = gImagePath & whichFile

    Member ("Display"). Picture = .photo member ("display")

    updateStage
    end if

    end

    Global gFileList, gFileIndex, gImagePath
    -----------------------------------------------------------
    the backfile

    gFileIndex = gFileIndex - 1

    If gFileIndex = 1 then

    whichFile = gFileList [1]
    Member ("Display"). FileName = gImagePath & whichFile
    Member ("Display"). Picture = .photo member ("display")
    updateStage
    Sprite (17) TRUE = FALSE - disable the "back" button

    -gFileIndex = count (gFileList)
    end if

    If gFileIndex > 1 then

    whichFile = gFileList.getAt (gFileIndex)

    Member ("Display"). FileName = gImagePath & whichFile
    Member ("Display"). Picture = .photo member ("display")
    updateStage
    end if
    end

  • Can ODI - I get the name of the file in a variable?

    Hello, I am trying to get the name of the folder (or subfolder) dynamically over the package that is currently running. I tried various API (from the Toolbox) calls including < % = odiRef.getSession("SESS_NAME") % >, but this isn't quite what I need.  I'm real new to ODI...

    I'm under ODI 11.1.1.6

    Thanks in advance.

    CL

    Yes, I think that this decision if more flexible. I use this way.

    . or you could hold information about the records in the table or XML file or a properties file and store it in the variable... It depends on your tasks and objectives

Maybe you are looking for

  • Wireless or wired mouse series Satellite Pro P?

    Wireless mice consume more energy than their wired equivalent on a laptop?I was wondering

  • Find the number of items in a folder

    When I used the Lion it would display the number of items in a folder on the bottom of the folder window. This number is no longer displayed in El Capitan. What should I do to have this displayed number? Thank you! Pat

  • Request interrupted VISA

    Hello everyone, I now there are a lot of questions about the request interrupted in LabVIEW and I found nothing, so I post here. I have a (R & S FSP) Spectrum Analyzer and I download the LabVIEW drivers for use. So I create a program to measure the n

  • How to migrate R7 - 572 G Win8.1 at mSATA SDS?

    Hi, there is a matter to be resolved? I just installed a new (MX200 Crucial 250 GB) mSATA for my Aspire R7 - 572 computer G laptop and I have to follow the instructions of the wire - Aspire R7 - 572 disassembly (http://community.acer.com/t5/2014-Arch

  • Why my system restore has stoped working and 1 problem more too!

    Hello, I hope that some people may help me with my 32-bit vista, 2 cpu to 1.9 Ghz Intel, gateway comp. GM5420, G965 express processor and directx 11 or 10 and I run Avast Anti-virus.  My SR = system restore has worked for many years and now the past