Inserting variables into other variables

I have several objects that have similar names, like slot1, slot2, slot3, etc. I also have a function that is supposed to do something to the first object, then the next, then the next, etc each time a button is pressed. Is it possible to insert variables into other variables? So say I have a variable called n that is increased each time the button is pressed. The function is then applied to slot"n" each time the button is pressed. How would I do this?

use:
var n:Number=1;
function f(){
// do something to parentmovieclip["slot"+n]
n++
p.s.  please mark this thread as answered, if you still can.

Similar Messages

  • Calling one variable to other variable ( alphanumeric)

    Hi All,
    I have scenario where I am calling one variable to other variable in ODI.
    For example.
    Lets say I have two variable V_SET1 & V_SET2
    V_SET1 :
    Variable type : alphanumeric , Historize,
    Refreshing : SELECT #V_SET1 FROM DUAL to historize value.
    Now I am using V_SET1 in V_SET2
    V_SET2:
    Variable type : alphanumeric , Historize,
    Refreshing :
    select SOURCE_NAME from EXTRACT_PGSQL_DETAIL where OE_DETAILS = # V_SET1
    Both variables are inside scenario I am passing value of V_SET1 at run time as parameter 'TEST'
    V_SET1 is executed sucessfully & TEST is stored is historized
    BUT in V_SET2 V_SET1 value is getting passed in " quotes & i am geeting error of INVALID IDENTIFIER "TEST"
    select SOURCE_NAME from EXTRACT_PGSQL_DETAIL where OE_DETAILS = # V_SET1 ( "TEST") -- error inavlid identifier.
    How can I covert the value of TEST from "TEST" to 'TEST' in second Variable V_SET
    Edited by: neeraj_singh on Jun 24, 2011 3:15 AM

    Hi,
    Try this if not,
    select SOURCE_NAME from EXTRACT_PGSQL_DETAIL where OE_DETAILS = '#V_SET1'
    Thanks,
    Guru

  • Fill Variable from other variable

    Hi all,
    I 'm using a characteristic structure in my BEX report.
    It has two selection.
    In one selection I 'm using a variable.
    In second selection I want to use a variable that get data  from the firt one.I mean I want to fill a variable from the other one at query runtime.
    How can I handle it?
    Thanks.

    Sample code....to copy values from variable "ZFISPER" to variable "FST_PERI".
    WHEN 'FST_PERI'.
    DATA : WA_FPER LIKE LINE OF I_T_VAR_RANGE,
           L_S_RANGERFPER TYPE rrrangesid.
    DATA : L_FPR TYPE rrrangesid-LOW.
    *break-point.
    CLEAR : WA_FPER,L_S_RANGERFPER.
    IF i_step = 2.
       LOOP AT i_t_var_range INTO WA_FPER WHERE vnam = 'ZFISPER'.
            EXIT.
       ENDLOOP.
       IF sy-subrc EQ 0.
           CONCATENATE WA_FPER-LOW+0(4) '001' INTO L_FPR.
       ENDIF.
          L_S_RANGERFPER-LOW = L_FPR.
          L_S_RANGERFPER-SIGN   = 'I'.
          L_S_RANGERFPER-OPT    = 'EQ'.
       APPEND L_S_RANGERFPER TO e_t_range.
    ENDIF.
    Srini

  • How do I separate this csv variable into individual variables?

    The main variable being passed is #whoplayer#.
    I need to be able to separate them into individual variables but I can't figure it out.  Sometimes the variable passed is not separated by commas (only 1 items passed) (1245) other times it's multiple:   (1245,1246,1250)
    Please help.

    Check out cflib.org, there are a couple of tags there for handling csv data.  Was not clear whether you meant actual CSV formatted data, or just data elements separated by commas.  If the latter, then Dan's CFLOOP colution also works.  If the former, then there are a few more variations that CFLOOP won't handle so easily, but those ahve been solved by the cflib.org tags.
    -reed

  • Copy Standard Variable into Z variable.

    Hi all,
    I am using a standard variable 0DAT in the query for 0calday.
    Now i want to make a clone of the same variable.i.e i want to copy it with the same structure into Z variable.
    Also, 0DAT is having SAP Exit and that should copy to Z variable.
    Please suggest.
    Regards,
    Macwan James.

    Hello,
    User exit are variable specific, so if u create new z variable you have to write your own user exit.
    Its pretty simple to create:
    1) Create Zvariable type user exit with single and no ready for input
    2) In CMOD write a simple code for this variable as
    when 'zvariable'.
    if i_step = 1.
    l_t_range-low = sy-datum.
    l_t_range-sign = 'I'.
    l_t_range-opt = 'EQ'.
    Regards,
    Shashank

  • Can't find some albums when trying to insert photos into other programs

    I am having trouble finding albums (and thus pictures) when trying to insert photos into a Word document or upload to mySpace/ facebook etc.
    After choosing 'insert<picture<from file<pictures<iPhoto Library' , I have the option of looking into the year-month-date or by album. Since I have a better memory of the 50+ albums I have created rather than their dates, I choose "Albums". This list only contains about half of my albums (with folder icons) and it appears outdated...ie one of the albums no longer exists in iPhoto and has been changed to a folders with several albums in it.
    I'm wondering why this is happening or how i can update the album list. I realize i could use the year-month-day thing but that is too frustrating.
    Carey
    iBook G4   Mac OS X (10.4.3)  
    iBook G4   Mac OS X (10.4.3)  

    Hi chantreya,
    iPhoto 5 now stores the Album information in a data xml file. The Albums folder within the iPhoto Library folder is no longer used. At some point, usually after a rebuild, you will no longer have that folder in the Finder.
    If you need to access photos from an album it is very difficult for a third party application to navigate the iPhoto Library in order to find the photo you need. You will have to know the date of import in order to find the photo.
    There are some third party applications that can read the xml file and can navigate the iPhoto library and show you the Albums. Hopefully more applications will be revised to read this file.
    Until then you will have to Share/Export the photos to the desktop. You can then navigate to the desktop to use the photos (example: web uploading from online photo site)
    If your application supports drag and drop, you can drag the photo from an open iPhoto Library window into your application.
    For email you can also use the email icon within iPhoto to open a message with the highlighted photo attached.
    You can also use spotlight to find images in an Album...
    This is what I have done using Spotlight to find my images that are in iPhoto albums without opening iPhoto..
    In iPhoto, select the album, then select all, go to Photos/batch change.
    Change the comments to text. In the text field I put the name of the Album.
    Do this for each album.
    Close iPhoto.
    Open Spotlight and put in the name of the Album ( you have to remember the names of the albums or have then written down)
    In the spotlight search results. click on "show all"
    Under "Images" click on the "xx more" to show all the images in the album.
    Make sure you have it in icon view, the icon view box is the last one on the blue images line.
    Now you can control click on the image to "reveal in finder", open in iPhoto or Mail, etc.
    I am not sure if this is going to make you happy and it is a little more work, but you can find images in albums and even view them in a slideshow (by clicking the play arrow at the end of the Images highlighted blue line) using Spotlight, all without opening iPhoto.
    One important thing to know is you can set up a graphic program to be an external editor (when you double click an image in the library} such as PhotoShop or PS Elements. You set up that within iPhoto Preferences. Just make sure you save the image flattened and with the same name. The edits will then be relected in iPhoto when you hit "save".
    Two Apple kbs for you to read
    Don't tamper with files in the iPhoto library folder
    About the iPhoto Library folder
    Lori

  • Passing Pl/Sql variables into shell variables.

    I have written a file that ftp information from one pc to another in unix.
    All you have to do is supply a user_name/password and machine name to which ftp program will connect to.
    All connection information like user_id,password, machine name are stored in an oracle table FTP_TBL.
    It has the following fields:
    FTP_TBL
    ================
    USER_ID      NOT NULL VARCHAR2(100);
    USR_PASSWD      NOT NULL VARCHAR2(50);
    TO_MACHINE     NOT NULL VARCHAR2(50);
    I have called a pl/sql script in unix shell.
    This script selects all the connection information from FTP_TBL and populates the pl/sql variables with the
    information.
    Now i want the pl/sql variables like V_TO_MACHINE,V_USR_ID,V_USR_PASSWD to be passed on to unix variables
    To_MACHINE, USR_ID AND USR_PASSWD.
    How can i do this?
    ============================================================================================================
    sqlplus -s <<+++ >> $LOG_FILE
    $USER/$PASSWD
    set serverout on SIZE 1000000
    DECLARE
    V_TO_MACHINE VARCHAR2(100);
    V_USR_ID VARCHAR2(50);
    V_USR_PASSWD VARCHAR2(50);
    BEGIN
         BEGIN
              SELECT TO_MACHINE, USER_ID, USR_PASSWD
              INTO V_TO_MACHINE,V_USR_ID,V_USR_PASSWD
              FROM FTP_TBL;
         EXCEPTION
              when others then
              dbms_output.put_line('ERROR|SQLPLUS|'||ERROR||'|'||sqlcode||'|Failed during selecting configuration information.'||sqlerrm );
         END;
    END;
    +++
    #======================== VARIABLES =====================
    TO_MACHINE=$1
    USR_ID=$2
    USR_PASSWD=$3
    #========================== MAIN ========================
    ftp -vnd $TO_MACHINE << ++ 1>>$STA_LOG_FILE 2>&1
    user $USR_ID $USR_PASSWD
    prompt off
    get $OR_DATA_DIR/ASC.STADATA $HOME_DIR/ASC.STADATA
    bye
    ++
    # testing the exit status of FTP
    egrep "Transfer complete" $STA_LOG_FILE >/dev/null
    if [ $? = 0 ]
    then
    echo >> $STA_LOG_FILE
    echo "FTP Successfully Done" >> $STA_LOG_FILE
    else
    echo >> $STA_LOG_FILE
    echo "FTP UnSuccessfull" >> $STA_LOG_FILE
    exit 1
    fi

    Here an example of how to pass variables to the shell script :
    TEST@db102 SQL> select ename, job, dname from emp,dept
      2  where empno = 7902
      3  and emp.deptno = dept.deptno;
    ENAME      JOB       DNAME
    FORD       ANALYST   RESEARCH
    TEST@db102 SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    [ora102 work db102]$ cat disp_var.sh
    set `sqlplus -s test/test << EOF
    set pages 0
    select ename, job, dname from emp,dept
    where empno = 7902
    and emp.deptno = dept.deptno;
    exit
    EOF`
    echo $1 $2 $3
    [ora102 work db102]$ ./disp_var.sh
    FORD ANALYST RESEARCH
    [ora102 work db102]$                                                  

  • Value from a formula variable into text variable in BEx Query

    Hello,
    if anyone knows how I can do the following please let me know:
    I have a formula variable in a formula (ZUM_KVAL). The value will be entered before execution of the query.
    Now I would ALSO like to display the entered value (from ZUM_KVAL) as at text variable (ZUM_KTXT) in the name of the field in the query/report.
    If anyone could provide me with info about how to do that, I'd appreciate very much.
    Thanks in advance.
    Cu, Stefan

    Hi Shashank,
        You can achieve this by creating a customer exit variable for calendar month.
    Function module :
    READ TABLE i_t_var_range WITH KEY vnam = 'Date variable name ' INTO loc_var_range.
       IF sy-subrc = 0.
        year = loc_var_range-low(4).
        month = loc_var_range-low+4(2).
         CLEAR l_s_range.
         l_s_range-sign = 'I'.
         l_s_range-opt  = 'EQ'.
         CONCATENATE year month INTO l_s_range-low.
         APPEND l_s_range TO e_t_range.
       ENDIF.
    Hope this will help you. Let me know if you have any questions.
    Regards
    Suvarna

  • Refer a variable to other variable

    Hi all,
    I have a silly question...
    How do we make a variable reference in Actionscript 3??
    e.g. in MXML we can do following
    <mx:Script>
    [Bindable] private _abc:String;
    </mx:Script>
    <mx:Label text = {this._abc} />
    then the text of the label updated whenever we changed _abc.
    However if we do it in actionscript like:
    <mx:Script>
    [Bindable] private _abc:String;
    var labelObj:Label = new Label();
    labelObj.text = this._abc;
    addChild(labelObj);
    </mx:Script>
    Then the text of labelObj didn't update when _abc changed.
    I know we can make the _abc as setter/getter function to
    dispatch event and update the label text whenever event is
    dispatch.
    However, there should be something like refer labelObj.text
    to some variable, rite??
    Any Idea?
    Thanks~~

    Dear,
    Thanks for your answer, but the problem here is how to declare those variables ? if i declare them in a store procedure they would be local to that procedure and wont be available as bind variables.No.
    When using PL/SQL (static SQL) you will never encounter issues related to bind variables. PL/SQL itself takes care of yourcode and uses bind variables behind the scene.
    So, if you declare your variables inside a stored procedure, they will be automatically considered as bind variables. You don't have to care about. This is how PL/SQL (static SQL) works.
    The only situation where you have to look carefully to the use of bind variable within PL/SQL is when you use Dynamic sql into stored procedures or functions (this is in fact another reason to avoid using dynamic SQL).
    However, you need take care of the application which is calling your stored procedure. This calling application should call your stored procedure using input parameters as bind variables.
    Otherwise, the library cache of your shared pool will be full of calls to your stored procedure.
    Put it simply,
    (a) do what you want inside your PL/SQL strored procedure (static SQL and not Dynamic SQL)
    (b) call your stored procedure using bind variables
    Hope this helps
    Mohamed Houri

  • Put variable into another variable

    Hi All~
    I am writing the following script:
    Add-Type -Path 'C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Smo.dll'
    get-content 'C:\SLDATA\Serverlist.txt'  | foreach-object {
    #write-output `n
    ###write "Server Name: $_"
    $SrvConn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
    $SrvConn.ServerInstance=$_
    #Use Integrated Authentication
    $SrvConn.LoginSecure = $true
    $SrvConn.ConnectTimeout = 1
    $srv = new-object Microsoft.SqlServer.Management.SMO.Server($SrvConn)
    $dbs += $srv.Databases
    $dbs | select name,onwer,size | Sort-object size
    clear-variable -Name dbs
    Then the output will be :
    Name               Owner              size
    master             sa                     1024
    master             sa                     2048
    tempdb             sa                    5000
    tempdb            sa                     6000
    if I want to add a output column of the server name like the following
    Servername     Name        Owner     Size
    Server1            master       sa           1024
    Server2            master        sa         2048
    Server1             master       sa         5000
    Server2            master        sa           6000
    how to re-write the script

    Try this:
    Add-Type -Path 'C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Smo.dll'
    $Servers = get-content 'C:\SLDATA\Serverlist.txt'
    foreach ($server in $servers) {
    #write-output `n
    ###write "Server Name: $_"
    $SrvConn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
    $SrvConn.ServerInstance=$_
    #Use Integrated Authentication
    $SrvConn.LoginSecure = $true
    $SrvConn.ConnectTimeout = 1
    $srv = (new-object Microsoft.SqlServer.Management.SMO.Server($SrvConn)).Databases
    $srv | Add-Member -type NoteProperty "Servername" $server
    $dbs += $srv
    $dbs | select servername,name,owner,size | Sort-object size
    clear-variable -Name dbs
    Assigning the get-content to a variable allows you to use the foreach ($server in $servers) so the server name is available at the end of the pipeline.  
    Assigning the .databases element to $srv instead of the whole object allows you to add the server property.
    Hope this helps!  I don't have a SQL instance to test...

  • Export shell variables into SPS variables

    I am looking for a way to assign shell variables which are defined in the "exec native" step, as a N1 variable.
    I will use this variable to generate a more userfriendly output in the "raise message"
    Has anyone an idea??
    Thanx

    Do you mean that you want to assign a value from within a shell variable to an N1 variable? If so, then you can use the <assignOutput> element in execNative. Here's an example:
    <varList>
    <var name="var1" default="not assigned"/>
    </varList>
    <simpleSteps>
    <execNative>
    <assignOutput varName="var1"/>
    <exec cmd="echo">
    <arg value="${my_shell_var}"/>
    </exec>
    </execNative>
    <raise message=":[var1]"/>
    </simpleSteps>
    ...

  • How to convert an int variable into String type

    hi everybody
    i want to know how to convert an interger variable into string variable
    i have to implement a code which goes like this
    Chioce ch;
    for(int i=0;i<32;i++)
    // here i need a code to convert the int variable i into a string variable
    ch.add(String variable);
    how do i convert that int variable i into a String type variable??
    can anyone help me?

    Different methods:
    int a;
    string s=a+"";or
    String.valueOf(int) is the better option because Int.toString() generated an intermediate object to get the endresult
    Ema

  • Query output into ODI variable

    Hi,
    I want to take the output (multiple rows and multiple columns) into an ODI variable of Text type.
    I have created the variable and put the query and set the variable type as Text type. But when I send the value of this variable to other variable, it comes as blank.
    Can anyone tell me how can I do that
    Thanks in advance
    Arun

    Hello Neha,
    Though i have been working with APDs since some time. But havent actually been involved in designing one. But you could find many documents for the APD on web. And as far as i know, you will need a program to save file from APD.
    I have a document which explains how you can use APD in  process chain. can forward you the same if you want.
    I am sorry as i wasnt of much help for you, as i havent worked on similar requirement before, but this thing just striked in my mind.
    Regards,
    Anuj

  • How to insert the data which is present in the variable into the table

    Hi,
    Let's consider that I have one table and I have stored the table column names in one variable and their values in another variable.
    I want to insert the data that is present in the variables into the table.
    I tried the following way :
    Declare
    V_columns    Varchar2(50) := 'Empno';
    V_values       Number(10) := 101;
    Begin
    Insert Into Emp (V_columns) Values (V_values);
    End;
    The above procedure gives an error : PL?SQL : ORA-00904 : "V_COLUMNS": invalid identifier
    Using the Execute Immediate, we can insert the data which is present in the variables into the table.
    Is there any other way to insert the data which is present in the variable into the table..?
    Can anyone please give me the solution..?
    Thanks..

    plz use this...
    DECLARE
       v_columns   VARCHAR2 (50) := 'Empno';
       v_values    NUMBER (10)   := 101;
    BEGIN
       EXECUTE IMMEDIATE    'Insert Into Emp ('
                         || v_columns
                         || ') Values ('
                         || v_values
                         || ')';
       COMMIT;
    END;

  • How to insert a bean variable into MySql using jsp

    Hi, I have a problem that I have been trying to work out for ages..unsuccessfully.
    My web-site takes 2 inputs off a user...does a calculation on them and returns the result to the user.
    I want to then use another jsp page that will take this result and insert it into a database...
    My class code for this is :
    public void updateRepmax(String userName, String repmax) throws SQLException, Exception{
         if(con != null){
         try{
         PreparedStatement update;
         update = con.prepareStatement("UPDATE repmax SET Benchpress = ?, WHERE Member_Name = ?");
         update.setString(1, repmax);
         update.setString(2, userName);
         update.execute();
         } catch(SQLException sqle){
         error = "SQLException: could not update repmax";
         throw new SQLException(error);
         catch(Exception e){
         error = "An exception occured while updating repmax";
         throw new Exception(error);
         } else {
         error = "Exception: connection to database was lost";
         throw new Exception(error);
    My JSP is :
    <%@page import="java.sql.*, placement.*"%>
    <jsp:useBean id="conn" class="placement.DBConnect" />
    <jsp:useBean id="query" class="placement.DBQuery" />
    <jsp:useBean id="bpcalc" class="placement.repmaxBean" />
    <jsp:useBean id="userin" class="placement.User" />
    <html>
    <head><title>Update Repmax</title></head>
    <body>
    <%
    conn.connect();
         String repmax = bpcalc.getRepmax();
         String userName = userin.getUserName();
    query.setCon(conn.getCon());
         query.updateRepmax();
    conn.disconnect();
    %>
         </body>
         </html>
    The variable I am tryin to insert is repmax ,in the class that does the calculation the repmax is a double so I assume that is my first problem(how can this be changed to allow it to insert?)....any help you have to offer would be greatly appreciated... 

    Thanks for your reply sathishkb,
    I am not actually receiving any error message,
    The jsp page is processed and the code seems to be correct however the table in my mysql database is not updated.. my JDBC drivers are working correctly etc.
    I expect that the problem is in my JSP page but dont know what it is
    I have removed that comma in my update statement
    I no longer have the problem of the variable being of type touble as I altered my other code to convert the variable from double to string
    jsp is now:
    <%@page contentType="text/html"%>
    <%@page import="java.sql.*, placement.*"%>
    <jsp:useBean id="conn" class="placement.DBConnect" />
    <jsp:useBean id="update" class="placement.DBQuery" />
    <jsp:useBean id="bpcalc" class="placement.repmaxBean" />
    <jsp:useBean id="currentuser" class="placement.currentuserBean" />
    <html>
    <head><title>Insert Into Repmax</title></head>
    <body>
    <%
    String repmax = bpcalc.repmax;
    String userName =currentuser.name;
    conn.connect();
         update.setCon(conn.getCon());
         update.updateRepmax(repmax,Username);
    conn.disconnect();
    %>
         </body>
         </html>
    the segment of my bean code is :
    public void updateRepmax(String repmax,String userName) throws SQLException, Exception{
         if(con != null){
         try{
         PreparedStatement update;
         update = con.prepareStatement("UPDATE repmax set Benchpress = ? WHERE Member_Name= ?");
         update.setString(1,repmax);
         update.setString(2,userName);
         update.execute();
         } catch(SQLException sqle){
         error = "SQLException: could not update employer";
         throw new SQLException(error);
         catch(Exception e){
         error = "An exception occured while updating employer";
         throw new Exception(error);
         } else {
         error = "Exception: connection to database was lost";
         throw new Exception(error);
    }

Maybe you are looking for