Array loop to change variables?

The plan is to set up variables to react to a flashvars value like this:
[code=html]<param name="flashvars" value="mainVars=1" />[/code]
[code=actionscript]
var videoArray:Array;
var videoTitle:String;
var videoFile:String;
videoArray=[0,1];
function onEnterFrame(){
    for(var i=videoArray.length-1;i>0;i++){
        while(i==_root.mainVar-1){
            if(i==0){
                videoTitle="Show the video's change";
                videoFile="VID";
            else if(i==1){
                videoTitle="This is the second one";
                videoFile="promo";
[/code]
There would be many mainVars (over 100, actually) and this setup isn't working.  Could someone please help fix this problem?
Message was edited by: shawn234

Oops, the mainVars was a typo.
What I want to have as the finished product is a video page of multiple video players, each player with a different mainVar value.  The mainVar would tell the videoArray what to change the simplified videoTitle and videoFile variables to.
That's the plan.  I don't know how to impliment it.  I figured an array would be a good choice since the array can have infinite "i" values, but I could be horribly wrong...

Similar Messages

  • Format for Predefined lists of repeated measurements with changing variables

    Hi,
    I am a scientist and trying to draw an instrument ("writing a script" sounded wrong for LabView ) that is supposed to perform repeated measurements in an imaging experiment.
    I want to be able to give the instrument a list that defines the values for several variables for each repetition, because I want it to do different things in different episodes of the experiments and/or alternate different acquisition methods. In this way I can use the same script for a wide range of experimental paradigms.
    I am trying to decide on the format in which I could write the sequence to LabView to read. I looked into XML, but the LabView scheme seems pretty useless. If I use a textfile I would have to program a parseing script myself. If I use binary files I need to program an editor.
    I also thought about whether I want a line by line execution protocoll or just changing variables and leaving the execution protocoll integrated in the instrument. However, the latter would reduce the versatility.
    What would you think is a good way to do it?
    In general each measurement consists of:
    0. wait for a defined time (always the same)
    1. light on (different light sources)
    2. acquire images (different durations, exposure times, frames numbers)
    3. trigger a device (not in all repetitions, maybe changing devices in future)
    4. turn on a channel (changing channels)
    5. acquire images (different durations, exposure times, frames numbers - also different from step 2)
    6. turn off the channel (same as in 4)
    7. acquire images (different durations, exposure times, frames numbers - also different from step 2 and 5)
    8. light off (same source as 1)
    So there is basically a repetitive pattern. The image acquitisition 'epics' are performed by the same device, everything else is switching on and off channels of a NI PCI.
    Dennis
    P.S. I use LabView 2009

    I'm in agreement that your best bet would be a simple CSV or tab delimited file.  You can edit these in Excel, which makes the writing a lot easier.  There is the Read Spreadsheet File VI which can give you a 2D array for your steps and parameters.
    So, to keep it simple, use a csv.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • BEx crashes when changing variable values

    Hi all,
    We're having a problem with BEx.
    It crashes when trying to change variable values.
    We've been looking into syslogs and dev logs and so on,
    and found that the cpic connection has been disconnected
    before the crash. BUT we cannnot find out what is actually
    disconnecting the session.
    Well, at least F/W wasn' the cause. Have check the logs.
    Any ideas? Thx in advance!
    Yuko
    Below is our info.
    BEx: BI 7.10 sp7
    BI: BI 7.0 SAPKW70017
    <BI syslog at the time of BEx crash>
    15:40:36 RD                                 Q0  I Operating system call recv failed (error no. 232 )
    15:40:36 RD                                 S2  3 Connection to CPI-C client 586 was closed
    15:40:36 RD                                 S7  4 > Partner LU name:
    15:40:36 RD                                 S0  R > Host: 172.19.xx.xxx
    15:40:36 RD                                 S0  I > Partner TP Name: EXCEL
    15:40:36 DIA  000 500 BIB103                R4  9 Communication error, CPIC return code 020, SAP return code 223
    15:40:36 DIA  000 500 BIB103                R5  A > Conversation ID: 82142217
    15:40:36 DIA  000 500 BIB103                R6  4 > CPI-C function: CMSEND(SAP)
    <dev_rd log trace level 3>
    GWRD LOOP **********
    I'm in GwReceive
    SiSelPSelect: start select (timeout=20000)
    Thu Apr  9 15:40:36 2009
    SiSelPNext: an error occurred in sock 31
    NiSelISelectInt: error detected on hdl 18 / sock 31
    NiSelIListInsert: add hdl 18 [17] to sel-list (0) of set0
    NiSelISelectInt: 1 handles selected (0 buffered)
    main: NiSelNext (ni_hdl=18, read=1, write=0, connect=0, hdl_info=0x6000000000587400)
    request from CLIENT
    GwRequest: request from client 586
    GwGetMemory: allocated 0x600000000089bee0 (len=34615)
    NiHsLGetHostName: found address 172.19.xx.xxx in cache
    ***LOG Q0I=> NiIRead: recv (232: Connection reset by peer) [nixxi.cpp 4423]
    ERROR => NiIRead: SiRecv failed for hdl 18 / sock 31
        (SI_ECONN_BROKEN/232; I4; ST; 172.19.xx.xxx:1097) [nixxi.cpp    4423]
    Adresse   Offset  bad request
    GwSaveErrInfo2: save err info (225)
    ***LOG S23=> GwIDisconnectClient, client disconnected (586) [gwxxrd.c     11657]
    ***LOG S74=> GwIDisconnectClient, client disconnected ( SY08472) [gwxxrd.c     11665]
    ***LOG S0R=> GwIDisconnectClient, client disconnected () [gwxxrd.c     11704]
    ***LOG S0I=> GwIDisconnectClient, client disconnected ( EXCEL) [gwxxrd.c     11713]
    LOCATION    SAP-Gateway on host mxxx112 / sapgw01
    ERROR       connection to partner '172.19.xx.xxx:1097' broken
    TIME        Thu Apr  9 15:40:36 2009
    RELEASE     700
    COMPONENT   NI (network interface)
    VERSION     38
    RC          -6
    MODULE      nixxi.cpp
    LINE        4423
    DETAIL      NiIRead
    SYSTEM CALL recv
    ERRNO       232
    ERRNO TEXT  Connection reset by peer
    COUNTER     790

    Just FYI.
    After all, we ended up applying BEx addon patch 9.
    The problem about the BEx crash seemed to be fixed in patch 8, but another problem (I heard it was about something to do with report jump function) was not fixed. As a result, we skipped patch 8 and applied 9.
    Both problems were fixed in patch 9.
    Many thanks to SDN informations.
    Yuko

  • Downloaded loops not changing tempo with the project.

    I have all sorts of loops that I've downloaded in various formats.....wav, aiff, caf, etc. With many of these, when I insert them into a project, the loop retains its original tempo instead of stretching or shrinking to match the tempo of the project. Is there a way to convert these loops or change a setting somewhere that will cause them to change tempo as the tempo of the project changes?

    Hi, Just Re-record the loop to any empty track, and Voila....Now it will follw tempo change.
    Logic only recognizes material recorded in the session or apple loops...so just re-record any imported material and it will follow your tempo and pitch change.

  • Are the read and write operations atomic for an array in a local variable.

    Hi,
    I would like to know when you access an array in a local variable, is it an atomic operation?
    Thanks,
    Mat

    Thanks for the comments. I agree with you. However, I my case, race conditions and synchronization are not issues. Therefore, the only thing that matters to me is that the write and read operation of the array must be atomic. I know that I can implement that with a LV2 style global but I want to avoid it if possible.
    If writing and reading to an array are atomic operations then I can simply use local or global variables.
    All I need to know is: Is reading or writing an array in a local variable an atomic operation?
    Thanks,
    Mat

  • BEx Analyzer Not showing report result in canceling "Change variable Icon"

    Hi Experts,
    Do we have any settings in BEx Analyzer for retrive the Result set even after I click 'Change variable Icon' in Toolbar and cancel the variable pop-up window??
    Eg: My query Result is displayed in Analyzer selecting some vaues in Selection screen.And when I click the Change Variable Icon from 'Analyzer Toolbar' its showing me 'Select values for variable' window.If I select the cancel button in it, then Query result becom blank showing the message "There are variables; change variable values". Do Analyzer having an option or settings to keep the result even if i cancel the variable selection from "change variable icon".
    Thanx in advance..

    Sari-
    If SAP provides such a function, I have not found it. The way I understand it., the change variable value initiates the OLAP back end. This clears the Presentation Manager front end, and clears the 'results' that are displayed on your workbook. If you cancel the OLAP run, the front end clear still executes.
    HOWEVER... if you turn OFF Automatic Refresh before clicking on Change Variable Values and then clicking on Cancel, the presentation manager will not write any changes to your workbook. So that is your best solution.

  • Change variable from negative to postive

    hallow
    i wont top now how i change variable from negative  to postive
    like change -5 to 5
    thankes

    Hi Shnya,
    You just multiply with " -1", it wil get converted from Positive to negative or vice versa.
    Hope I answered your query.
    Regards,
    Sujatha

  • How to define a changing variable in Broadcasting.

    I would like to run bex web report in background using information broadcasting in bw 3.5. I setup all required settings and it is running fine. But I would want the broadcaster should take changing variable (example: date or fiscal period etc) based on the execution date or other condition. (please note that this is not for including date and  time etc in description).
    I want broadcaster should take current date  or date range or fiscal period as variable (selection screen) while running the report. I have tried using filter variable tab in broadcaster. But it was taking only static dates.
    pls suggest.
    Thanks in advance.

    Could you please tell me in detail. Which user exit variable you have mentioned? I am already using user exits (code in CMOD) for variables in query and it is working fine.
    Now, I want to run the same query in background using information broadcasting. When i run the query it asks for user input (for example: date etc). I enter the current date and execute the report. But I dont want to enter current date each time. Instead i want to execute them in backgroun and system should take values by itself.
    Correct me if I am wrong. For this you suggested me write one more user variable where it will populate variable values for backgroun (not used in query)? pls reply.
    Thanks, points assigned.

  • Loop around a variable

    Hi,     
    I have a situation where i need to loop around a variable which holds the value of the loop count. Is Loop AT possible in this case?

    Hi Peri,
    You can definetly use Loop AT with sy-tabix ( system variable that has the loop count)
    Example Code Snippet:
    LOOP AT t_marm INTO p_mattab FROM sy-tabix.
    IF p_mattab-matnr NE p_matnr.
    CLEAR p_mattab.
    EXIT.
    ENDIF.
    ENDLOOP.
    Kindly Reward Points If You Find The Reply Helpful.
    Cheers,
    Chaitanya.

  • Change variable type during program flow

    Hi there. Please tell me is there a possibility in ABAP to change variable type during program flow? I'd be very thanful for suggestions. Greetings.

    hi,
       Make use of field symbols for that ...
    field-symbols : <fs> type any.

  • To Run GPS by changing variable in UPSPL transaction automatically??

    Can somebody tell me if it is possible through an ABAP code to run global Plannig Sequence by changing variable value automatically by just a single click of button. (for eg. If i have a variable which can be given 5 different values, and i want to run a Global Planning Sequence for each variable value. Then can i write a ABAP code so that on just a single click of botton this is possible.) It would be helpful if somebody can send me a demo code also. My email id is [email protected]
    Regards
    Rishi

    Hi Rishi,
    To Answer, How to run GPS through ABAP code -
    i do not know a planning function to run a GPS, but i have written an ABAP code thought with i'm executing 3 planning functions one after another using function module UPC_FUNCEXE.
    CALL FUNCTION 'UPC_FUNCEXEC'
      EXPORTING
        I_AREA                =
        I_PLEVEL              =
        I_PACKAGE             =
        I_METHOD              =
        I_PARAM               =
    IMPORTING
      ET_LOG                =
      E_ERROR_OCCURED       =
    you can call this function module multiple time in your ABAP code. it will work same as a Global Planning Sequence.
    Can you explain more about how do you want to execute a planning sequence on the change of variable value.
    Regards
    Tarun

  • How to change variable values ?

    Dear friends,
    How to change variable values when we are broadcasting the Queires ?
    Do we need to change them everytime ?
    Thanks,
    N

    Hi,
    Please go through it.
    /people/ramkumar.ghattamaneni/blog/2008/02/25/using-variables-while-broadcasting-queries-to-the-portal-in-bi-7
    Regards,
    Ramkumar.

  • Using a 2-D array Single Process Shared Variable w/ RT FIFO for comm between a Deterministic and non-deterministic loop on an RT Target

    Our problem is that we currently use a 2D array to store CAN data on a Real-time Target. The array is 20 elements of 3 byte elements as so:
                    0              1              2
    0              [byte]   [byte]   [byte]
    19           [byte]   [byte]   [byte]
    These values are passed between a Deterministic Timed (DT) loop where they are set and a Non-Deterministic Timed (NDT) loop where they are read and passed into a Network Published Shared Variable (NPSV) for communication across the network to a Host PC. I have insrted an image for illustration, pardon the size.
    Currently to pass the data between the DT and NDT loop we are using a Global Variable (GV). To improve the system we have attempted to replace these GVs with Single Process Shared Variables (SPSV) with an RT FIFO enabled.
    To create the shared variable I simply right clicked the GV of interest and selected create Shared Variable Node form the drop downs. At this point LabVIEW presented me with a 2D NPSV within a new Library hosted on the RT Target. I then selected this new NPSV from the Project, changed it to a SPSV, and enabled a single element FIFO. This variable was initialized with a default value for the size described above and then used in our code for the DT to NDT communication, and conversion to a corresponding NPSV for sending to the Host.
    When I went to run the code I noticed that the variable was in fact 2D, however its size was only 2 elements of three bytes each, in other words only two of the row indices were populated and the other appeared as uninitialized. in addition, this data had no resemblance to the set initilazation value. This was also how the variable was presented on the host side of the network after tranfer into a NPSV.
    The peculiar part is that If I change this SPSV to a NPSV and then try to change it back, I receive an error saying the type is not supported for SPSV with an RT FIFO enabled. I have to disable the FIFO (which defeats the entire purpose) in order to successfully compile! I am unclear as to what is the bug in this case. Should I not be allowed to create the original 2D SPSV with a single element RT FIFO enabled without receiving an error? Or if this is okay how do I fix the problems associated with the variable after being allowed to create it?
    I have found the following discussion in which a user states “The only limitations for custom controls is the ability to use it with RT FIFO enabled on a network-published shared variable”. Is this also true for SPSV? I have not found any documentation explicitely stating this for SPSV, though it is stated for the NPSVs.

    Martin,
    RT FIFOs don't support Multi-Dimensional Arrays, which would corroborate the issues you're seeing.  You can break up the 2D array into 1D arrays by reshaping the array, then you'll be able to use the RT FIFO enabled variable, just set the array size to the total number of elements (20*3 = 60).
    You can also pass the 2D array via pre-allocated queue, or using a Functional Global.  We have a reference example for a circular buffer using Functional Globals here.

  • Trying to pass array to stored procedure in a loop using bind variable

    All,
    I'm having trouble figuring out if I can do the following:
    I have a stored procedure as follows:
    create procedure enque_f826_utility_q (inpayload IN f826_utility_payload, msgid out RAW) is
    enqopt dbms_aq.enqueue_options_t;
    mprop dbms_aq.message_properties_t;
    begin
    dbms_aq.enqueue(queue_name=>'f826_utility_queue',
    enqueue_options=>enqopt,
    message_properties=>mprop,
    payload=>inpayload,
    msgid=>msgid);
    end;
    The above compiles cleanly.
    The first parameter "inpayload" a database type something like the following:
    create or replace type f826_utility_payload as object
    2 (
    3 YEAR NUMBER(4,0),
    4 MONTH NUMBER(2,0),
    83 MUSTHAVE CHAR(1)
    84 );
    I'd like to call the stored procedure enque_f826_utility_q in a loop passing to it
    each time, new values in the inpayload parameter.
    My questions are:
    First, I'm not sure in php, how to construct the first parameter which is a database type.
    Can I just make an associative array variable with the keys of the array the same as the columns of the database type shown above and then pass that array to the stored procedure?
    Second, is it possible to parse a statement that calls the enque_f826_utility_q procedure using bind variables and then execute the call to the stored procedure in a loop passing new bind variables each time?
    I've tried something like the following but it's not working:
    $conn = oci_pconnect (....);
    $stmt = "select * from f826_utility";
    $stid = oci_parse($conn, $sqlstmt);
    $r = oci_execute($stid, OCI_DEFAULT);
    $row = array();
    $msgid = "";
    $enqstmt = "call enque_f826_utility_q(:RID,:MID)";
    $enqstid = oci_parse($conn, $sqlstmt);
    oci_bind_by_name($enqstid, ":RID", $row); /* line 57 */
    oci_bind_by_name($enqstid, ":MID", $msgid);
    while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC))
    ++$rowcnt;
    if (! oci_execute($enqstid)) /* line 65 */
    echo "Error";
    exit;
    When I run this, I get the following:
    PHP Notice: Array to string conversion in C:\Temp\enqueue_f826_utility.php on l
    ine 57
    Entering loop to process records from F826_UTIITY table
    PHP Notice: Array to string conversion in C:\Temp\enqueue_f826_utility.php on l
    ine 65
    PHP Warning: oci_execute(): ORA-06553: PLS-306: wrong number or types of argume
    nts in call to 'ENQUE_F826_UTILITY_Q' in C:\Temp\enqueue_f826_utility.php on lin
    e 65
    PHP Notice: Undefined variable: msgnum in C:\Temp\enqueue_f826_utility.php on l
    ine 68
    Error during oci_execute of statement select * from F826_UTILITY
    Exiting!

    Thanks for the reply.
    I took a look at this article. What it appears to describe is
    a calling a stored procedure that takes a collection type which is an array.
    Does anyone from Oracle know if I can pass other database type definitions to a stored procedure from PHP?
    I have a type defined in my database similar to the following which is not
    an array but a record of various fields. This type corresponds to a payload
    of an advanced queue payload type. I have a stored procedure which will take as it's input, a payload type of this structure and then enqueue it to a queue.
    So I want to be able to pass a database type similar to the following type definition from within PHP. Can anyone from Oracle verify whether or not this is possible?
    create or replace type f826_utility_payload as object
    YEAR NUMBER(4,0),
    MONTH NUMBER(2,0),
    UTILITY_ID NUMBER(10,0),
    SUBMIT_FAIL_BY VARCHAR2(30),
    MUSTHAVE CHAR(1)
    );

  • Changing variable name within loop

    Instead of typing oit 8 different versions of this loop, I'd like to do something this where i increases value to define a new variable:
    for (int i = 1; i < 9; i++)
                double lbs[i] = (((dis * 2000) / 3456) * (ve)) * pr * 0.069 / 100;
                BigDecimal bd[i] = new BigDecimal (lbs);
    bd[i] = bd[i].setScale (1,BigDecimal.ROUND_UP);
    lbs[i] = bd[i].doubleValue ();
    String tflow[i] = Double.toString (lbs[i]);
    oFlow[i].setText (tflow[i]);
    i++;
    In PHP that's how I do it, but how about Java? I tried searching for "variable variables" since that's the only want I know how to describe it.

    I put what you gave me inside of public void CalcBoost() { ... } and I'm getting the error:java.lang.NullPointerException
            at Calculator.CalcBoost(Calculator.java:751)
            at Calculator.iBoostActionPerformed(Calculator.java:672)
            at Calculator.access$700(Calculator.java:69)
            at Calculator$8.actionPerformed(Calculator.java:299)
            at javax.swing.JTextField.fireActionPerformed(JTextField.java:491)
            at javax.swing.JTextField.postActionEvent(JTextField.java:672)
            at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:786)
            at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1530)
            at javax.swing.JComponent.processKeyBinding(JComponent.java:2438)
            at javax.swing.JComponent.processKeyBindings(JComponent.java:2473)
            at javax.swing.JComponent.processKeyEvent(JComponent.java:2401)
            at java.awt.Component.processEvent(Component.java:4909)
            at java.awt.Container.processEvent(Container.java:1569)
            at java.awt.Component.dispatchEventImpl(Component.java:3615)
            at java.awt.Container.dispatchEventImpl(Container.java:1627)
            at java.awt.Component.dispatchEvent(Component.java:3477)
            at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
            at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:627)
            at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:831)
            at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:741)
            at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:592)
            at java.awt.Component.dispatchEventImpl(Component.java:3506)
            at java.awt.Container.dispatchEventImpl(Container.java:1627)
            at java.awt.Window.dispatchEventImpl(Window.java:1606)
            at java.awt.Component.dispatchEvent(Component.java:3477)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)This now points to: for (int i = 0; i < oFlow.length; i++)

Maybe you are looking for