Variable of variable concept in AS

Hi,
In flex how can i use the variable of variable concept , i
want to create the dynamic instance for ArrayCollection class like
below ,
for(var i:int=1;i < 3; i ++){
var objname = "ArrCol"+i;
objname:ArrayCollection = new ArrayCollection();
Expected Result :
ArrCol1 , ArrCol2 these two instance should be created .....
Any ideas plz let me know ,

Sorry, i did that from memory, and too quickly.
The bracket notation will only create an Object, but since
almost everything else extends object, this is not really a
problem.
change the line to this:
this[sObjname] = new ArrayCollection();
The newly created instance variable will contain an
ArrayCollection. You *might* need/want to cast it to Array
collection using "as" when you go to use the var:
var acTemp:ArrayCollection = this[sObjname] as
ArrayCollection;
Tracy
Tracy

Similar Messages

  • Help with "owned" variables concept in WPF

    I'm trying to move from WinForms to WPF and so far it's been going well. I'm struggling with the concept of updating variables from events in my code behind. It says that it was created or owned by another thread. Basically in my code all over the place I am
    having to put:
    this.Dispatcher.Invoke((Action)(() => { //Code Here }));
    Generally this is happening from an async call to update some data.
    Am I doing something fundamentally wrong in my design?
    If this snippet of code is the solution, how do I understand without the runtime compiler telling me, when I should be doing it?
    Can you explain what is happening with the Dispatcher.Invoke ((Action)(() =>{}));
    My thinking so far
    (Action) is casting the (() => {}) to an action object
    () is creating a nameless function?
    => {} define the function right here, we could have pointed to a real function if we wanted.
    Thanks for any education you can give me.

    The thing is that you can only update a UI element on the thread on which it was created. This rule applies to both Windows Forms and WPF. Please refer to the following great article for more information about the threading model in WPF:
    https://msdn.microsoft.com/en-us/magazine/cc163328.aspx. You should only create UI elements (TextBoxes, Buttons, etc.) on the UI thread and not on any background thread.
    >>Can you explain what is happening with the Dispatcher.Invoke ((Action)(() =>{}));
    The delegate (Action) that you pass to the Invoke method will be executed on the UI (or dispatcher) thread. Please refer to the above article for more information.
    >>If this snippet of code is the solution, how do I understand without the runtime compiler telling me, when I should be doing it?
    The Dispatcher has a CheckAccess() method that returns false if you are required to call the Invoke method, i.e. if the current thread doesn't have access to the UI object. You could just call this one before you call the Invoke method:
    if (!Dispatcher.CheckAccess())
    Dispatcher.Invoke(new Action(() => { }));
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't post several questions in the same thread.

  • Bind Variable concept

    I would like to know the concept of bind variable and the places it can be accesed.I have found that the bind variable cannot be accesed inside a procedure directly .Why is it so?

    If you use variables in the select statements, then it means you can reuse previous plans, improving performance. Plsql does have variables.
    http://www.akadia.com/services/ora_bind_variables.html
    What are you trying to run, and what errors are you getting.

  • Bind variable in OBIEE 11G

    Hi,
    Is there any bind variable concept in OBIEE 11g.
    If it is not there then how to achieve this.How to write a where clause to get the result set dynamically.
    Thanks-Bhaskar Gouda
    Edited by: 961171 on Sep 25, 2012 12:44 AM

    Hi,
    I can make use of repository variable ,but my scale marker doesn't get changed .I am giving all the details .Please help me if you can.
    My scale marker SQL Query is as below.
    select trucks.factrucks
    from "plant model"
    Now i want to add a where clause say:
    select trucks.factrucks
    from "plant model"
    where truckid=:p_truckid;
    How can i do this and pass the parameter from go_url.Please help me out.
    Thanks-Bhaskar

  • Usage of Bind Variable

    Hi
    Can any one help me ineffectively usage of Bind Variables in 11 g. I have the requirement something like I have 10 input parameters. I have to frame a view object in such a way that If I receive either of the 10 input parameters from the User Interface I have to perform a query by setting the inputer parermeters in the where cluase.
    I though tof using Bind Variable concept. but the problem is It is always not necessary that I get 10 paremeters from the inputs, I may get 1 or 2 or ...10. If I set the 10 Bind Variables for 10 Input parameters, My view object is not performing well when I pass one value for bind variable when there are no values for remaining bind variables.
    What is the best approach in this case?
    Thanks

    Why not use dynamic runtime named bind variables?
    Create a VO method, something like the following
        public void search(String param1, String param2){
            String sql_1 = " AND SOMETHING = :P_PARAM_1)";
            String sql_2 = " AND SOMETHING_ELSE = :P_PARAM_2";
            setWhereClause(null);
            clearWhereState();
            setWhereClause("1=1");
            if (param1 != null && param1.length()>0){
                addWhereClause(sql_1);
                defineNamedWhereClauseParam("P_PARAM_1",null,null);
                setNamedWhereClauseParam("P_PARAM_1",param1);
            if (param2 != null && param2.length()>0){
                addWhereClause(sql_2);
                defineNamedWhereClauseParam("P_PARAM_2",null,null);
                setNamedWhereClauseParam("P_PARAM_2",param2);
            executeQuery();
        protected void clearWhereState() {
                ViewDefImpl viewDef = getViewDef();
                Variable[] viewInstanceVars = null;
                VariableManager viewInstanceVarMgr = ensureVariableManager();
                if (viewInstanceVarMgr != null) {
                    viewInstanceVars = viewInstanceVarMgr.getVariablesOfKind(Variable.VAR_KIND_WHERE_CLAUSE_PARAM);
                    if (viewInstanceVars != null) {
                        for (Variable v: viewInstanceVars) {
                            // only remove the variable if its not on the view def.
                            if (!hasViewDefVariableNamed(v.getName())) {
                              removeNamedWhereClauseParam(v.getName());
                getDefaultRowSet().setExecuteParameters(null, null, true);
                setWhereClause(null);
                getDefaultRowSet().setWhereClauseParams(null);
            private boolean hasViewDefVariableNamed(String name) {
                boolean ret = false;
                VariableManager viewDefVarMgr = getViewDef().ensureVariableManager();
                if (viewDefVarMgr != null) {
                    try {
                        ret = viewDefVarMgr.findVariable(name) != null;
                    catch (NoDefException ex) {
                        // ignore
                return ret;
            }

  • How to use text variables?

    Hi,
    I have a text variable 'ZEMAIL' with data element 'COMM_ID_LONGu2019.The routine corresponding to this is 'GET_ZEMAIL' in 'ZHKMIT30' program.
    Now I have to retrieve emloyee E-mail ID (infotype 0105 i.e.PA0105 DB table, subtype 0010, field USRID_LONG) and has to populate in ZEMAIL. How?
    I am very new to this text variables concept
    How to get this text variable implemented? Please help.

    select pernr subty usrid_long
             from pa0105
                 into table it_pa0105
              where pernr in s_pernr
             and subty = '0010' .
    loop at it_pa0105.
    ZHKMIT30-ZEMAIL = it_pa0105-usrid_long.
    insert ZHKMIT30.
    endloop.

  • ESB - Global Variables? access of the variables outside the transformation

    I am working on one of the ESB services for my project(not looking for BPEL).
    1. Database adapter polls the data table (Say X and Column C1, C2, C3....Cn,CountofRecordsof Other table Y)
    2. Routing Service calls other database adapter for pulling the data from other table(Say Y) in another schema based on the C1,C2,C3 from X.
    3. After getting the count(i only need the count of records based on the C1, C2 and C3 conditions from Y table), I have to update the table X which corresponds to the row C1.
    The trouble what I have is
    1. How do I update the records which is for the C1 as the return of the value (which is the count) from the second adapter gives only the record count but it doesn't store the identifier from the first table.
    2.Is there anything called global variable concept in the ESB?
    3.How to access the varilable which are outside the schema in the current transformation. i.e, consider I have two schemas, Schema A and Schema B,where I am mapping the variables in the transformation, and considering I need a variable which is the schema which was populated with values during runtime in Schema C.
    Let me know if needs more clarification!
    thanks,
    Prashanth

    Hi,
    >>
    1. Database adapter polls the data table (Say X and Column C1, C2, C3....Cn,CountofRecordsof Other table Y)
    2. Routing Service calls other database adapter for pulling the data from other table(Say Y) in another schema based on the C1,C2,C3 from X.
    3. After getting the count(i only need the count of records based on the C1, C2 and C3 conditions from Y table), I have to update the table X which corresponds to the row C1.
    >>
    I suppose your RS at step 2 gives C1, C2, C3 as input and you invoke DB adapter to get count and forward response to other service.
    >>
    The trouble what I have is
    1. How do I update the records which is for the C1 as the return of the value (which is the count) from the second adapter gives only the record count but it doesn't store the identifier from the first table.
    >>
    If I understand your task correctly, try to use ESBREQUEST to accomplish your task.
    >>
    2.Is there anything called global variable concept in the ESB?
    >>
    No, there are no global variables in ESB, such in BPEL.
    I think, this should be known when you first starting a design your ESB processes.
    You can accomplish your task in next way:
    add global variable to your XML payload.
    For example, your XML payload looks like:
    <payload><some content/></payload>
    You can extend your XML schema to include global variable, so you payload may looks like:
    <payload><some content/><global_var>value</global_var></payload> (I think this's the best way, if you really need something that can be accessed in many parts of your ESB process)
    >>
    3.How to access the varilable which are outside the schema in the current transformation. i.e, consider I have two schemas, Schema A and Schema B,where I am mapping the variables in the transformation, and considering I need a variable which is the schema which was populated with values during runtime in Schema C.
    >>
    Sorry, I didn't understand. What schema do you mean? XML schema or DB schema?

  • Customer Exit Variable to fetch the data from the cube..

    Hello Gurus,
    I am having a requirement to select the latest changed record from the cube while executing the query.  where we are having the Calday as the date with a variable .
    I suggested my client we can filter it at the DSO leve or Data loading level but my client dont want to distrurb the existing design so he want to perfrom the changes at the Query level only.
    For Example we are having below records in the cube.
    PO             Material     Calday       Qty         Price
    101            ABC          1/12           100         10
    101            ABC          2/12            100         10
    101            ABC          3/12            100         11
    I am having Calday in the selection screen as the variable.
    Now from the above example i need to show the record which has been changed on 3/12.
    For this i am planning to write the customer exit variable on the calday , when the user enter the range of Calday then i will fetch the whole records which fall in between the range and i will sort each PO with respect to the date and i will pick those which are the latest records.
    My Concerns:
    !. Kindly let me know if it is possible and what are the other things that i need to consider.
    2. Did it will impact the performance.
    Waiting for your quick replies
    Thanks & Regards
    KK

    Hi Mate,
    Sorry for late reply.
    By d way in your word.
    initially when the user enter the date range as the vairable input. suppose 1/12 to 31/12 then i will pick all those records which fall in this range.
    suppose the records are
    PO Date
    P1 01/12
    P1 02/12
    P2 02/12
    P2 03/12
    P3 03/12
    P3 04/12
    In the customer exit variable Now for each PO i will sort the date in ascending order and i will pick the last record to display it in the Report.
    The ouput will be
    PO Date
    P1 02/12
    P2 03/12
    P3 04/12
    Now hope you are aware about exit variable concept.
    so what value will pass in the calday filter.
    here after sorting on each PO , you will get 3 different dates, 02/12 for P1
    03/12 for P2
    and 04/12 for P3
    Now if you are aware about exit variable concept, then you will pass this three date to CALDAY(I_t_VAR_Range-low = ...)
    but how query will understand that for P1 calday filter value is 02/12, for P2 calday filter value is 03/12.... and so on...
    actually i have also experienced this kind of issue 1-2 years before, i have tried same thing at that time without thinking and stuck with this problem..
    By d way you can also learn from your mistake.. so just try ur logic and then you will understand what is the problem?
    By d way this will not work, parallel you can work on other solution.

  • BEX Query- Auth Variable

    Hello Experts,
    I am lost with the functionality of the Auth Variable in the BEX Query.
    I have an AS IS 3.5 system in which I have a Query where there is an auth variable on Cost center ZXXXXXX.It is working fine.
    In order to implement the same logicon a new to be system I need to create the entire scenarion on my system
    (Like assigning roles and make this Query Function exactly  as in the AS IS system)
    Reamaining things of the Query I have developed with out any issue. But, How to exactly implement this auth variable concept on
    my new system.
    Couls you please help me how exactly this functionality works
    Now the Basis team wants to know how exactly if this ZXXXXXX variable is linked to the LIST OF ROLES in the
    AS-IS system so that they can exactly put the same in the TO BE SYSTEM USER Roles.
    To  understand where is used the Authorization variable ZXXXXXX working for the different users?
    where are the combination between the user and the list of cost center associated ?
    Regards,

    Hi,
    Although the authorization concept has changed from 3.x to 7.0 the authorization variables that you create should work. 
    Depending upon weather the the authorization variable is a charachteristic value or Hierarchy node differnet code is executed, the following functions will return the values.
    RSEC_GET_AUTH_HIER_FOR_USER
    RSEC_GET_AUTH_FOR_USER
    Brian

  • Concept of variable-free programming.

    Can anyone clearly explain the "concept of variable-free programming",
    in Object Oriented Programming with a sample code.
    Thank you very much

    Google says:
    ["variable-free programming" found in Google search|http://books.google.com/books?id=Sz4fsW1CMrIC&pg=PA390&lpg=PA390&dq=concept+of+%22variable-free+programming%22&source=bl&ots=k2E1ea0ENf&sig=zl2lsjo5V-bdXuJvaGEhSjStiZw&hl=en&ei=3avVSfT3FKaMtgOxr72sCg&sa=X&oi=book_result&ct=result&resnum=5#PPA391,M1]
    Bottom of page 390 to top of page 391. It's a C# book, but the accessor (getter and setter) concept is certainly used in Java. The whole paragraph could be applied to Java. [Google's book search doesn't let you cut-and-paste the full paragraph, and I don't feel like typing it all myself. ;) ]
    Google finds the term elsewhere, too.
    That said, I've certainly never heard the term (and, obviously, the other people in the thread haven't heard it, either).

  • Concept of variable

    Hi,
    I have a scenario wherein i ge the table name from a select query in a variable and then i have to do another select query on this new table.  But because this table name is stored in variable, i'm not gettign how to do a  select query on it.
    Regards
    Aadil
    Thanks for help!!!

    Hi
    Try this :
    1-To assign a variable a type at runtime, use the ABAP statement ASSIGN with the option TYPE. For instance:
    DATA: D_TYPE,
    D_FIELD(35).
    DATA: D_TEST TYPE P.
    FIELD-SYMBOLS: <F>.
    D_FIELD = 'D_TEST'.
    D_TYPE = 'P'.
    ASSIGN (D_FIELD) TO <F> TYPE D_TYPE.
    Additionally you can use the option DECIMALS of the ASSIGN statement if your type is 'P'. You can even change the type at runtime of previously assigned field symbol like
    ASSIGN <F> TO <F> TYPE 'C'.
    One more thing for dynamic programing. With the following coding you can access every DDIC table with the key you want:
    SELECT SINGLE * FROM (DF_TNAME) INTO S_TMP WHERE (IF_KEY).
    2-FIELD-SYMBOLS:
    <fieldname> TYPE ANY, "Name of field
    <line> TYPE ANY, "Line structure for table
    <fieldvalue> TYPE ANY. "Value of field
    DATA: l_shorttext LIKE dd03m-ddtext.
    DATA: wa_dd03l LIKE dd03l.
    SELECT * FROM dd03l INTO wa_dd03l
    WHERE tabname = 'ZHR_INTER_PA1_DL'.
    Assign name of field
    ASSIGN COMPONENT 2 OF STRUCTURE wa_dd03l TO <fieldname>.
    Assign structure for internal table
    ASSIGN wa_pa1_delta TO <line>.
    Assign field value from structure
    ASSIGN COMPONENT <fieldname> OF STRUCTURE <line> TO <fieldvalue>.
    Find DD text for field
    SELECT SINGLE ddtext
    FROM dd03m
    INTO l_shorttext
    WHERE tabname = 'ZHR_INTER_PA1_DL' AND
    fieldname = <fieldname> AND
    ddlanguage = 'EN'.
    WRITE: / <fieldname>, l_shorttext, ' : ', <fieldvalue>.
    ENDSELECT.
    Regards
    Neha

  • Is there any concept in LabVIEW that is similar to static local scope variables in C?

    I'd like to retain the value between calls to a subVI, as can be done using a static function scoped variable in C. The textbook example of how this is used would be a variable in the function that is a state machine, and knows what state it was in last time it was executed. A simpler example would be just keeping count of how many times the function has been called.
    I suppose I could use a global or I could pass values in and out of the subVI, but I'd like to keep the variable known only in the scope of the subVI if at all possible. For example, the outside world has no business knowing (or god forbid) changing what the state information of this function is.

    Bmarsh wrote:
    > I'd like to retain the value between calls to a subVI, as can be done
    > using a static function scoped variable in C. The textbook example of
    > how this is used would be a variable in the function that is a state
    > machine, and knows what state it was in last time it was executed. A
    > simpler example would be just keeping count of how many times the
    > function has been called.
    >
    > I suppose I could use a global or I could pass values in and out of
    > the subVI, but I'd like to keep the variable known only in the scope
    > of the subVI if at all possible. For example, the outside world has
    > no business knowing (or god forbid) changing what the state
    > information of this function is.
    There is no need to do something "conceptual" or spec
    ific to have this
    static variable. You already have this in any control or indicator in
    your sub-vi while it is in memory. Control/indicator value will remain
    in sub-vi data space between calls. Don't forget about make your sub-vi
    non-reentrant or keep track of sub-vi data space copies.
    If you want to read/write this value from another vi, consider it global
    or I'd prefer to suggest using functional global(uninitialized shift
    register in 1 iteration while loop). Think of it as about 1 value data
    repository.
    LabVIEW CIN reference manual is a good place to look at, as well as
    LabVIEW course kits, describing LabVIEW memory issues in details.
    To simplify: create empty sub-vi with control and indicator connected to
    each other and call it wiring indicator in caller vi. Keep sub-vi front
    panel open and change control in sub-vi manually. You see what happens.
    Sergey Krasnishov
    Automated Control Systems
    National Instruments Alliance Member
    Mos
    cow, Russia
    [email protected]
    http://acs.levsha.ru

  • Concept of Global Container or Global Variable

    Hi friends,
    My Scenario is from JMS to SOAP.
    I need to store some data when it comes to XI from JMS.
    When the response comes back from SOAP I need to add these fields and send back to JMS.
    Can I do this Scenario without using BPM ?
    Is there any concept like Global Container which I can use it in different Message mappings?
    Thanks and regards,
    Jose

    Hi,
    This object enables you to cache the values that you want to read again when you next call any user-defined function in the same message mapping. Note that the sequence in which user-defined functions are called is predefined. It depends on the position of the target fields that the function was assigned to
    On details of global container refer these.
    /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
    http://help.sap.com/saphelp_nw2004s/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/frameset.htm
    /people/michal.krawczyk2/blog/2005/03/04/globalcontainer--in-graphical-mapping-xi

  • How to read a config file in xMII

    Hi ,
    In my scenario, I want to load a configuration file which contains all my configuration realated details -- location of file path which i have to load in my transaction for further usage.
    This can be achieved using global variable concept of BLS but my requiremnet is like this then how can i proceede.
    Thanks
    Supriya.

    Supriya,
    Lets Say your xml is
    <ABC>
           <config>value1</config>
           <config>value2</config>
    </ABC>
    and you need to change the value of config node to "newValue" from "value1",
    Then load the xml file and assign that to some Local xml property say outPutXML.
    create another local property with only the xpath , in this case it will be
    "/ABC/config/"
    Now, use the magic of Dynamic Link editor, i.e
    outPutXML.{#xPath#} to change the value
    Hope this helps
    Rupesh Bajaj
    Reward if solved the problem

  • Increment counter in XSLT mapping

    Hi Experts,
    I am creating xslt mapping by using mapforce tool. I am trying to get increment counter variable in xslt mapping. can you please tell me what would be the code for getting sequence number.
    Thanks for your help.
    Thanks,
    Hari

    yes, there is a global variable concept in XI which u can use for your Sequence Number concept.
    If you are on SP14 and above, just take a lookat this blog and the GLOBAL Variables Section
    XI: New features in SP14
    check this thread
    Re: Need Help in XSLT Mapping
    Re: Sequence Number in XI Mapping

Maybe you are looking for

  • Ebcc sync error

    I'm running WL Portal 7.0 sp1. I've been syncing with the ebcc with no problems. Then one morning I received this error when I sync. Any ideas on what is going wrong? -Kevin URI : /webapps/gtnwebapp/gtnportal.portal Cause : Persistence Failure execut

  • Booted from firewire external disk, internet slow

    Hi, My iMac is currently being booted from external disk via Firewire 800. I have to do this until I receive new install disks from apple to resore my machine. The computer is usable, however internet is very slow... I have other devides, windows mac

  • How to run an embedded broker?

    I want to start an embedded OpenMQ broker to use as a destination for messages which are sent as part of a test run by Maven. Essentially I want a broker to be started within the same JVM when the tests are run so I don't have to insure that a broker

  • Missing WTC classes???

    I think I must be going mad. I'm upgrading an application from WLS8.1 to WLS10 and I can't find classes like weblogic.wtc.jatmi.Ferror and weblogic.wtc.jatmi.TypedFML32 in the weblogic.jar file. Any idea where they are hiding?

  • Gtalk for nokia 5800 is available now...

    Hello friends.... Gtalk for nokia 5800 is available now you can download it from following link.... http://www.talkonaut.com/download.shtml Enjoy Thanks  SRK