How to use a static const variable while loop collection ArrayCollection?

Hello

I have an arraycollection collection which I get to main system, that has two columns named, 'Id' and 'Desc '.

I created a static const variable:

public static FIELD_DESC_NAME:String const = 'Desc ';

I have been using this variable const everywhere in my code, for example:

super.dataProvider = model.acVariants;
super.labelField = FIELD_DESC_NAME;  instead of using super.labelField = "Desc";

But unfortunately, there is one place where I'm not able to use it. And it's all in the loop as shown below:

for (var i: uint = 0; i < model.acVariants.length; i ++) {}

If (value.label is model.acVariants [i]. DESC) {/ / I want to use the FIELD_DESC_NAME variable, instead of using 'Desc' model.acVariants [i]. / / DESC}
super.selectedItem = model.acVariants [i];
break;
}

}

Can you please let me know how can achieve us?

Appreciate your help...

<! - Deepak - >

Can you put a debug statement and draw the value returned by model.acVariants [i] [FIELD_DESC_NAME] and value.label

Hope that there must be a difference.

If this does not solve then please let me know

-Vikash

Tags: Flex

Similar Questions

  • How to access the static class variable calendar / singleton?

    How can I access a timeline of a static class variable / singleton?

    You can pass any object to display list to your class when instantiating it.  all objects in the display list has a placement property that allows access to the stage and them you can use the correct path/name to your variable.

  • Using asynchronous calls in a while loop. How 'Skip' node and only retrieve data as it is treated

    Maybe I'm not understand asynchronous calls... but I thought I should be able to call one another VI and essentially 'jump' it is the node and only receive data as the called VI treats.  In other words, similar to the Run of VI, I can wire a wait until done? with a fake and the main VI will not wait for the other VI end of race.  The main VI continues to function, and when it passes the called node of the VI, it will receive data if it happens to be there.

    How can I call a VI in a while loop and do not wait so he could spit out the results?  Data flow is my enemy on this one...

    The first VI treats its own figures (using the iteration count) and displays them on the PC.  Other indicators are the data of the called VI.  I want to be able to work around the blue circle node and receive data only that it will be available.

    Any help is appreciated.  Thank you.

    What I said OR the 'Start asynchronous call' is the preferred method for starting background tasks. This call is usually used to run background tasks. For example, you have a process of journal. When your application starts it would use the "asynchronous call Start" to start the process of journal and then move on to the other stuf. The process of the journal would then happily run in the background and the main application is free to do other things. Of course when implementing these types of systems you need a way to coordinate things like exit. This is where the queues and stuff come it.

  • How to use procedures in a variable of ODI ODI

    Hello
    I have the condition

    Select c1 from the table where c1 > #ODIVAR1 and use of the output of this query in a variable to define the workflow package

    If output = 0 workflow package goes xxx
    on the other
    flow goes like YYY.

    Then please suggest how to use an ODI variable to capture the putput procedures and use it in the package for this stream.

    Thank you
    Naveen.

    Hello

    In the workflow of the package type of the variable as a Variable to be evaluated , if the step is ok go for a flow...
    otherwise, go to another stream in the Advanced tab.

    Thank you
    Ananth

  • How to increase code efficiency in a while loop (using PXI5105 for sampling outside signal digitalizer)

    Theoretically, we want the PXI-5105 (digitizer) have 302 record with each record has a 1260 sample (the save operation is inside a while loop) in approximately 30ms, however we have found that for each period (30ms), the PXI5105 only perform about 10 records. It is so wired. I wonder if the operations inside the while loop consume more time (for example 3MS), so that he cannot have 302 records even the PXI-5105 have 60 M/s speed of sampling. Is it true, you can find my labview code and if possible can you give me some suggestion in the most short time of operation of the loop.

    Please find attached labview code.

    Hi g_l_g_s,

    The digitizer PXI-5105 acquires data at the speed that you specify and stores the data in its memory embedded (up to 512 MB). The data is then sent to your computer when the Multi Fetch Cluster.vi is called. In VI that you posted, you are only fetch record during each while the loop iteration. If you want to retrieve 302 records you will need to specify 302 files in the horizontal Timing.vi to configure. For more information about scanners, you might find the DevZone, hereuseful.

    To determine the amount of time it takes for each while the loop iteration, you can consider using the structure of code in the example comparison community calendar, which is located here.

  • How to make a graphic inside a while loop to maintain the previous values

    At first I tried to use a the VI Express XY graphics to create a track of points.  However, the chart is a trace linear between the first point in the new line and the last point of the previous line.  It then creates the new line as you wish.

    I tried to use a loop with group a cluster for the chart, but the chart resets the plot at each iteration (as expected) and I can't find a way to maintain the previous data.  I tried using shift registers, but was unable to find a way to do it, and I tried also the cluster of a painting company, but can not find a way to make the cluster to a 1 d of a cluster of 2 elements array.

    One option is to have is to find a way to maintain the previous data, but the preferred option is to create a new path to each iteration to see the color change for each new parcel.

    I take stabbed it because I don't know exactly what you want. But I think that's what I've shown here. You must use a shift on your outside register while loop, as I showed. Your image where you tried to use a shift register shows a misunderstanding of the shift registers and how well they work, then I'd take a peek at these tutorials.

  • How to control a VI (with a while loop and a structure of the event) from an another VI

    Hello

    I have the main VI which I want to be driven from an another VI. But I can't do that and I don't know what is happening.

    For example: VI main, I have a while loop with a structure of the event, there is a Boolean controller controlling a Boolean LED, which is inside the structure of the event. And the other VI, there is just a Boolean controller and functions of applications to open the main VI.

    How can I control the Boolean LED in VI main, changing the State of the Boolean controller in an another VI?

    Thank you.

    There are different options, but depending on what you want to do. For this example I can't give you a specific solution.

    I do not understand why you do what you do. Why do you call your 'principle VI' dynamically? What is the advantage to do? There are also other ways to call a VI dynamically, based on real cases (for example the method "call and forget", etc...).

    In you principle VI, control you Boolean ("THATCHER") is not the case of corresponding event. This is not usually a good practice, keep it inside.

    Also, why you try to communicate with the caller and callee VI through such a way to twist? There are better ways to do it.

    In one of my projects, I use the user event to launch orders in case of case of appellant VI.

    some Associates more readings for you:

    http://www.notatamelion.com/2015/03/23/how-to-make-dynamic-subvis/

    http://forums.NI.com/T5/LabVIEW/Dr-Damien-s-development-event-structures-III-communicating-with/m-p/...

  • Use of memory in a while loop with a xy chart

    Hi all

    I have problems using memory with a vi that loops, records data and plots in a xy running chart.  I wrote it using shift registers and functions "subset of the table", which I assumed would reduce overhead costs, but apparently this is incorrect.  If it works for several days (which is normal, because it is above all a vi for follow-up and view a trouvreez process that runs continuously), it takes a few minutes only to stop the loop.  I guess it would eventually just stop working entirely.  I googled this problem and I see suggestions to auto-index or pre-allocate.  However, I would also like to plot each point as the tracks of the loop, so I need shift registers.  What I do use some convoluted pre-allocation, changing table and then insert into the table approach, or is there a better way?  Still working?

    Thanks in advance


  • How to use a static reference to maintain a VI in memory, but then call it in parallel?

    Hi all

    I have a MainVI and I want to call him a Subvi in parallel so that I can have both windows open and sensitive at the same time.  The Subvi can be closed and then reopened any number of times, but only one in existence at the same time.  I know how to do it using the reference VI opened, offering a path relative to my Subvi, check to see if its already running and if so bring window to front (using front panel: open with entries True/Standard method) and if not run it using the Invoke method: Run (and eventually open its façade by program).  This method worked very well.

    Now, I've added functional global variables in my Subvi, and I want to keep in memory inbetween opening Subvi window.  I can do this by placing a copy of the functional overall in my MainVI, even if I do not here for nothing.  It works very well.

    By chance, I came across a reference to a static reference of VI, which resembled a great improvement in my method, for the following reasons:

    1) Subvi keeps in memory all the time, eliminating the need to put the functional overall in MainVI when it is not used it.

    (2) tells the LabVIEW to include the Subvi when I build my executable, rather than me having to specifically mark as always include in the build specification.

    (3) eliminates the need to continue the path and the name of Subvi updated in a constant string in my code, in order to use the open VI reference.

    However, in trying to implement this solution, I ran into the problem that once you put a reference of VI in strictly typed static (strict typing is necessary to keep in memory) on the block diagram, that VI is reserved for execution.  This means that I can't run it using the Invoke method: Run.  I did not just put it on the diagram directly as a Subvi because I need it to run in parallel to the MainVI.  I searched through these forums extensively, and although there are several references to a static reference of VI, none of them say explicitly how to actually run this 'thing'!  : PEI

    I greatly appreciate any insight into my problem.  If I have to go back to the old way it works perfectly, but I really like the apparent elegance of this solution.  I hope that it will be technically possible, and I'm not bad understand something.

    Thank you for your help,

    -Joe


  • How to use a default session variable in SQL

    I want to use a session variable (: PAGE #_VARNAME) by default for a column in a layout table whenever a new record is inserted into the table.

    What is the best way to do it? I tried to set the default value for this column: _VARNAME # PAGE under element in a table, but nothing works.

    Thanks for your comments.
    -Reid

    Try the PAGE #_VARNAME whose Type point (application or page name of the option) assuming that the PAGE #_VARNAME is an application or a name of the default page.

    Scott

  • How to use the 'Get Shared Variable list' VI on a target RT?

    Hello

    I would like to browse all variables shared in a library hosted on my CompactRIO programmatically. I dropped the 'Get Shared Variable list' VI in my VI in real time, but when I tried deploying, LabVIEW says

    Deployment PRC_GetVarList.viPRC_GetVarList.vi loaded with errors on the target and was closed.
    LabVIEW: Unable to load the shared library dscProc.dll:ni_lvdsc_process_GetTagListEnd:C. ensure that the library is present on the target of RT. MAX allows you to install software from OR or FTP to transfer custom RT target libraries.
    LabVIEW: Unable to load the shared library dscProc.dll:ni_lvdsc_process_GetTagListBegin:C. ensure that the library is present on the target of RT. MAX allows you to install software from OR or FTP to transfer custom RT target libraries.

    I watched the wizard of the MAX software, but cannot find the DSC-based modules. Where should I look?

    Thank you!

    Hello

    The palette of DSC is not supported on the screws in real-time and will lead to errors when they are deployed.  Unfortunately, to have a successful build you will need to modify your application and remove the screws from the palette of DSC on your target of RT.

  • How to combine the string and variable in loop

    I need to get the following lines in a loop for, but miss me the possibility in actionscript3 to use this ['string' + i + 'word2'

    wing_mc.prop1_mc.rotation = - wing_mc.rotation;
    wing_mc.prop2_mc.rotation = - wing_mc.rotation;
    wing_mc.prop3_mc.rotation = - wing_mc.rotation;
    wing_mc.prop4_mc.rotation = - wing_mc.rotation;
    wing_mc.prop5_mc.rotation = - wing_mc.rotation;
    wing_mc.prop6_mc.rotation = - wing_mc.rotation;
    wing_mc.prop7_mc.rotation = - wing_mc.rotation;
    wing_mc.prop8_mc.rotation = - wing_mc.rotation;
    wing_mc.prop9_mc.rotation = - wing_mc.rotation;

    I tried things like

    for (i = 1; i < 10; i ++) {}
    This ["wing_mc.prop" + i + "_mc"] .rotation = - wing_mc.rotation;
    }

    or

    for (i = 1; i < 10; i ++) {}
    "wing_mc.prop"+ i +"_mc".rotation = - wing_mc.rotation;
    }

    It seems very simple
    I must be overlooking something

    Thanks in advance

    Kees

    "Although it works there is a little thing, I do not understand:
    This.wing_mc ["prop" + i + "_mc"] .rotation
    I think a point to separate the this.wing_mc ["prop" + i + "_mc"] AND .rotation '.

    Well, that's how. In fact, the syntax is similar to the table. There are no points when you read the value of a member of the group. In a way that object is an array of methods and parameters - we simply refer to them not whole but by name.

    I know it's all confused sometimes. :-)

  • Cannot use median filter inside the While loop

    Hello

    I try to use the filter median insade loop some time. This seems to be a problem. I have attached the VI. Help, please.

    This entry is a number of sample as 1,1.1,1.05. This output is zero.

    Thank you

    Vincent

    Since you get only one value per iteration, you can use the point-by-point version of the median filter.

  • How to send the value of inside while loop outside

    Hello

    The goal of my project is to control the height of a ball in a tube (there is a fan down low to lift the ball to the top and bottom) and a Top ultrasound sensor read the distance of the ball.

    I am currently using a PWM signal to control the speed of the fans (which works fine) and I use the VISA blocks read/write to communicate to my sensors (which works also very well - I can get the distance to the ball - when I move the ball up and down changing the duty cycle).

    My problem:

    Now, to create a control problem, I need read the distance of the ball, have some sort of controller and feed in this output as my new duty cycle for the fans... However, I need loops I have (running fans and continuous sensors to run (I guess? unless there is a way around it.) so the fans continue to work and sensors keep reading.) I need to get the measure of the distance of the loop of the sensor (after its been read) passed out of the loop and to be updated of course - then calculations can be made on that and then can be used as my duty.

    Someone in a way that I can do this? Its all tied to your reference, version of labview 8.6.

    Thanks heaps!

    Nick.


  • With no headphone jack, how to use the iPhone in my car 7

    Okay, so here's the challenge.  I have a power source and a headphone and not Bluetooth.  It works perfectly with iPhones before 7.  But with 7, it isn't possible to use the same configuration I had for years.  I own my car, and I have no interest in buying a new car just to support a new phone.  And since this will be a problem for the years to come if I stay with Apple, I would like to know what are the solutions are available.

    So, how to use the new iPhone 7 while remaining responsible and using my car speakers?  Dongles Bluetooth that I need to reload, it's probably not.

    Thus, looking for ideas that might have people.  I can't be the only one with this concern.

    It's almost a certainty that a third party adapter will appear quickly. The new Macbook has a single port usb - c and people asked the same question, 'how to load and use USB at the same time." There are today dozens of solutions for the Macbook, and then it will be with the iPhone 7. An adapter with a 3.5 mm jack and a port of loading Lightening would be my guess. Kickstarter entrepreneurs are probably already working on it.

Maybe you are looking for