Giving arrays a dynamic name

how would you give an array a dynamic name?
for(f=0;f<6;f++){
for(g=0;g<hexArray.length;g++){
if(f==0){
var kleurenIndexArray:Array = [] <---- this has to be a
dynamic name like [kleurenIndexArray+f]
kleurenIndexArray.push("0x"+g+"00000")
All the things i've tried haven't worked

I'm not sure exactly what you're trying to do but to give any
variable name based on a variable by doing something like:
x=3;
this["test"+x]="hello";
this is the equivalent of writing:
test3="hello";
you would do the same for arrays such as:
x=3;
this["test"+x]=new Array();
this is the equivalent of writing:
test3=new Array();
however, why not create an array rather than a variable with
a dynamic name? my example above could be the following instead:
eg
test=new Array();
test[3]=new Array();
this would give you a multidimensional array.
Does this answer your question?

Similar Messages

  • Call an array with dynamic name..

    Hi there,
    Oh, how these syntax problems confuse me !! I just want to create a name dynamically to push to one of multiple arrays.. can someone please correct my syntax ??
    var col20:Array = [];
    var tempRef:uint = 20;
    var gridRef:uint = 360;
    var theArray = this["col" + tempRef];
    theArray.push(gridRef);

    hello relaxatraja,
    What I need to do is push the value 'gridRef' to the array 'col20' using my 'tempRef' (20) for the dynamic naming of the array, but I'm using Object syntax.
    Imagine :-
    var col20Array:Array = [];
    What I need is ["col" + tempRef + "Array"].push(gridRef);
    So the array NAME is dynamic.

  • Creating a variable with a dynamic name

    I read a XML which has a unknown number of
    TextFormat-Definitions.
    I used Arrays to hold the data. Every time the TextFormat
    should be used, I overwrite a temporary one with the data i hold in
    the array and then I apply this format to the specific text.
    Now I want to optimise this and create TextFormats at once
    which can be applied when needed, without all the conversion.
    The best way I can think of is by having
    dynamic names for the
    TextFormats for the user to call.
    I can't use the way I did in AS2:
    var ["TF_"+string]:TextFormat = new TextFormat(x,y,z);
    How is the
    right Syntax in ActionScript3.0?

    Yeah, the Application class is no longer dynamic, so you can
    just add members on the fly.
    You could create an "associative array" (object), and store
    the formats in that, keyed by 'string". Associative arrays are like
    hash tables and are efficient at looking up values by key.
    I have heard of but not used Dictionary objects.
    Tracy

  • Can you Dynamically Name Objects

    I am trying to create a new object for every line of a text file, that i read in.
    The problem is that i need to dynamically name this object because i dont know the number of lines in the file.
    I tried using a varible as the object name but it errors as it sais that varible is already declared as a diffrent type.
    String newObject = "object1";
    myObject newObject = new myObject();
    If this is not posible can i rename an object after it is created.
    Thanks for any help.
    Rob

    hi!
    I know this problem..but it's not a problem of java, it's a problem of your thinking! I had it too when I started programming in java, because I came from programming in PL/1... ;-)
    and the answer I think is NO, it's impossible.
    you think you have to create and rename an object..probably you have an object james and you want to rename it into joseph.. but if you have a class person and a method calles setName(String name), you can change the name in this way..
    if you want to create a lot of new objects use an array or better a Vector.
    I hope this helps..
    http://www.menzsoft.ch

  • When I click SAVE PDF i need to get default dynamic name to save the PDF document.

    Hi All,
    When I click SAVE PDF option I need to get default dynamic name. In my case lets say Sales Order Number.pdf.
    Thanks,
    SP.

    Hi,
    I have created SAP Abobe Form for Patient Order.
    So when we execute we will see output as a PDF. If I want to save the PDF From, and click on the SAVE button, by default it comes up with my SAP FORM name, which I don’t want.
    What I want is when I click SAVE button by default it should come up with the Patient Number on the PDF Form, so that i can directely save without changing the name.
    For Example if I view the 101010 Patient Number then i should save the pdf from by 101010.pdf, same way if i view 202020 Patient number then i should save the pdf form by 202020.pdf.
    Please let us know is this possible.
    Thanks,
    SP

  • How to pass dynamic name to a field-symbol?

    Hi All,
    I have a requirement like I need to create dynamic internal table with dynamic name. Say like,
    Create a new Table
       CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
         it_fieldcatalog = it_fieldcat_fin[]
        IMPORTING
         ep_table        = new_table.
        IF sy-subrc EQ 0.
    Create a new Line with the same structure of the table.
         ASSIGN new_table->* to <b>(<fs_table>)</b>.
    In the above code, (<fs_table>) is a variable. Actually it is in the loop, so that first time it comes, it has to create an internal table with name as <fs_01>, next time <fs_02> and so on. Hope I am clear.
    Please help me. I am sure that i will mark the helpful answers.

    DATA: DREF TYPE REF TO DATA,WA_REF TYPE REF TO DATA.
    FIELD-SYMBOLS: <TEMP_TAB> TYPE TABLE, <TEMP_WA> TYPE ANY.
    *&      Form  DYNAMIC_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM DYNAMIC_TABLE.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = LT_LVCFIELDCAT
        IMPORTING
          EP_TABLE        = DREF.
      ASSIGN dref->*  TO <TEMP_TAB>.
    ENDFORM.                    " DYNAMIC_TABLE
    the above is the procedure to create dynamic internal tables.
    now <TEMP_TAB> points to the contents of the table table in DREF.
    field symbol it self is meant for dynamic.
    then y r u using (<fs_table>).
    when everytime the same fieldsymbol is pointing to new contents, y u need new name everytime?
    i mean as the data is not static, so what is the use of naming a field symbol every time?.
    if u want to store the data in an internal table with a name,
    then u can do like below,
    data: tabname type string, i type i.
    concatenate '<fs_' i into tabname.
    "let i be the variable which stores the internal tables count
    "MOVE <temp_tab> to tabname.

  • File to mail scanario   Dynamic name for e-mail attachments

    Hi ,
    I am using standard mail package for Dynamic name in the mail attachment.
    Content_Disposition : = attachment
    Content_Type =  file name  I am taking from DynamicConfiguration
    Now I received mail , but file name have (abc.txt.dat) extension .dat  but i want it same as send by sender file adapter(abc.txt)
    Please suggest how to handle this.
    Thanks
    Mohit

    Hi,
    my pretty solution
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3202
    Regards,
    Michal Krawczyk

  • How to set dynamic name of the mail attachment according to source file ?

    Hi,gurus:
    Our scenario is like below:
    Sending files from an FTP server to another FTP server without using the integraiton repositary,and the file name is not changed .Now, we want to also send the file to some with by mail adapter.The scenario  now works by using two business services in receiver determination.But the name of the attachment is "untitled.xml".We know how to set the file name staticly,but how to set the name dynamicly according to the source file name ?
    I have checked miachel's blog "XI: Dynamic name in the mail attachment - pseudo "variable substitution"(/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution),but how can I get the source file name?
    And another question:Must we restart the adapter or j2ee engine to make the user defined module work?

    Hi,
    >>>but how can I get the source file name?
    form dynamicconfiguration (ASMA)
    >>>And another question:Must we restart the adapter or j2ee engine to make the user defined module work?
    no need for a restart
    Regards,
    Michal Krawczyk

  • Dynamic names for I$ ,C$ and E$ tables in ODI

    Dear ODI Team,
    We have a requirement where we are loading header data and then line data in our Package.ODI internally creates work tables to load data into target tables.If multiple sessions of the same interface is executed at the same time the I$table of the previous session affects the I$ table of the next session.Hence if session1 has completed loading then it is at the stage of dropping the I$ table.Hence the second session is erroring out.Kindly let me know if there is an option to create these work table names dynamically for each session
    Thanks ,
    Anand

    Even I an getting similar error trying to use Global variable for dynamic names of the work tables
    Scripts Generated by the IKM :
    create table XDO.#global."gv_test_dynameSSTST_AN"
    ANY_NEW_ID NUMBER(22) NULL,
    ANY_NEW_ATTRIB1 VARCHAR2(50) NULL,
    ANY_CONC_ATTRIB2 VARCHAR2(150) NULL,
    DECODE_CODE1 CHAR(5) NULL,
    ANY_REF_CODE2 VARCHAR2(60) NULL,
    ANY_DATE1 DATE NULL,
    ANY_DATE2 DATE NULL,
    IND_UPDATE char(1)
    NOLOGGING
    Getting the following error on execution :
    911 : 42000 : java.sql.SQLException: ORA-00911: invalid character
    java.sql.SQLException: ORA-00911: invalid character
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
    at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
    at com.sunopsis.dwg.cmd.e.i(e.java)
    at com.sunopsis.dwg.cmd.g.y(g.java)
    at com.sunopsis.dwg.cmd.e.run(e.java)
    at java.lang.Thread.run(Thread.java:595)

  • Retrieving dynamic name files from FTP

    Hello,
    I have a scenario where PI needs to pull a file from a FTP site with a dynamic format of VendorYYYYMMDD.txt;  A new one is placed there every day. 
    One posting has an example is from ASM to PI to FTP: Re: Change in time stamp format in receiver file name.  However mine is FTP to PI to ECC.  I have thought of using a synchronous call from Sender ABAP proxy to PI to Receiver FTP adapter; However, the FTP adapter cannot poll (i.e. it only has target name).
    Question: What is the best method to put a dynamic name into the Sender FTP adapter?
    Regards,
    John_Xi

    >>Question: What is the best method to put a dynamic name into the Sender FTP adapter?
    I think you can do in the file sender adapter " Run operating system command before processing"  where you can specify shell script which willl create the file name dynamically you want or rename the placed file using the script as per the requirement.  For further help .. check this link
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm

  • Creating Dynamic Internal table with a dynamic name

    Hi,
    I want to create dynamic internal tables with dynamic names.
    For example:
    Suppose I have a table with three fields.
    1. Structure name
    2.Fields
    3.file
    And the structure of the internal table is as follows:
    TYPES:BEGIN OF table_type,
          struct                  TYPE char70,
          fields                   TYPE tt_type OCCURS 0,
          File                      TYPE ttab_type OCCURS 0,
          END OF table_type.
    Suppose I have one record inside my internal table with struct as "STRUCTURE", fields have an internal table content of set of fields and File has some set of records.
    Now I want to create dynamic internal table whose name will be "STRUCTURE" , the fields of the dynamic internal table structure[] will be as in fields, and the records will be as in File.
    Like this if i have 100 records in my internal table then I have to create 100 dynamic internal table dynamically.
    Can anyone suggest how to do this?
    Edited by: Jjammy on Jul 22, 2009 7:52 AM

    Hi,
    Check the sample program and develop your program accordingly.
    <font color=blue><pre>
    REPORT  ztest_notepad.
    *& Declarations
    *Type-pools
    TYPE-POOLS:
          slis.
    *Types
    TYPES:
          ty_fcat      TYPE lvc_s_fcat,
          ty_fcatalog  TYPE slis_fieldcat_alv.
    *Work areas
    DATA:
          wa_fcat      TYPE ty_fcat,
          wa_fcatalog  TYPE ty_fcatalog.
    *Internal tables
    DATA:
          it_fcat      TYPE STANDARD TABLE OF ty_fcat,
          it_fcatalog  TYPE STANDARD TABLE OF ty_fcatalog.
    *Type reference
    DATA:
          it_dyn_tab   TYPE REF TO data,
          wa_newline   TYPE REF TO data.
    *Filed symbols
    FIELD-SYMBOLS:
          <gt_table>   TYPE STANDARD TABLE,
          <fs_dyntable>,
          <fs_fldval>  TYPE ANY,
          <l_field>    TYPE ANY.
    *Variables
    DATA:
          l_fieldname  TYPE lvc_s_fcat-fieldname,
          l_tabname    TYPE lvc_s_fcat-tabname,
          l_fieldtext  TYPE lvc_s_fcat-seltext,
          l_index      TYPE char2.
    "Selection-screen
    PARAMETERS:
             p_colms   TYPE i.
    *& start-of-selection.
    START-OF-SELECTION.
      PERFORM build_fieldcat.
      PERFORM create_dynamic_table.
      DO 20 TIMES.
        DO p_colms TIMES.
          l_index = sy-index.
          CONCATENATE 'FIELD' l_index INTO l_fieldname.
          ASSIGN COMPONENT l_fieldname OF STRUCTURE <fs_dyntable> TO <l_field>.
          <l_field> = sy-index.
        ENDDO.
        INSERT <fs_dyntable> INTO TABLE <gt_table>.
      ENDDO.
      LOOP AT it_fcat INTO wa_fcat.
        PERFORM fieldcatalog1 USING: wa_fcat-fieldname
                                      wa_fcat-tabname
                                      wa_fcat-seltext.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = 'ZTEST_NOTEPAD'
          it_fieldcat        = it_fcatalog
        TABLES
          t_outtab           = <gt_table>.
    *&      Form  BUILD_FIELDCAT
    FORM build_fieldcat .
      CLEAR: l_fieldname,
             l_tabname,
             l_fieldtext,
             l_index.
      DO  p_colms TIMES.
        CLEAR l_index.
        l_index = sy-index.
        CONCATENATE 'FIELD' l_index INTO l_fieldname.
        CONCATENATE 'Field' l_index INTO l_fieldtext.
        l_tabname = '<GT_TABLE>'.
        PERFORM fieldcatalog USING: l_fieldname
                                    l_tabname
                                    l_fieldtext.
      ENDDO.
    ENDFORM.                    " BUILD_FIELDCAT
    *&      Form  CREATE_DYNAMIC_TABLE
    FORM create_dynamic_table .
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_dyn_tab.
      ASSIGN it_dyn_tab->* TO <gt_table>.
    Create dynamic work area and assign to FS
      CREATE DATA wa_newline LIKE LINE OF <gt_table>.
      ASSIGN wa_newline->* TO <fs_dyntable>.
    ENDFORM.                    " CREATE_DYNAMIC_TABLE
    *&      Form  FIELDCATALOG
    FORM fieldcatalog USING field table f_txt.
      wa_fcat-fieldname = field.
      wa_fcat-tabname   = table.
      wa_fcat-seltext = f_txt.
      APPEND wa_fcat TO it_fcat.
      CLEAR  wa_fcat.
    ENDFORM.                    " FIELDCATALOG
    *&      Form  FIELDCATALOG1
    FORM fieldcatalog1 USING field table f_txt.
      wa_fcatalog-fieldname = field.
      wa_fcatalog-tabname   = table.
      wa_fcatalog-seltext_m = f_txt.
      APPEND wa_fcatalog TO it_fcatalog.
      CLEAR  wa_fcatalog.
    ENDFORM.                    " FIELDCATALOG1 </pre>
    </font>
    Thanks
    Venkat.O

  • Dynamic Name for Yellow Interface Table

    Hi All,
    Can anybody guide me how to use dynamic name for Yellow Interface Target Table.
    Eg: T_SESSIONID.
    I tried
    1)Refreshing the SESSIONID in a Variable V1 and using T_#V1 directly
    2) Refreshing the T_#V1 in a Variable V2 and using #V2
    But its not creating properly.
    Please guide.

    You want to create dynamic target table name right?
    You can refresh a variable like #GET_SESSION
    #GET_SESSION= SELECT <%=odiRef.getSession("SESS_NAME")%> FROM DUAL
    My tmp table name like TMP_#GET_SESSION
    then in your package refresh #GET_SESSION variable and you can use it.
    I hope this can be helpful
    Thanks

  • Dynamic name for the physical table

    Hi Guys,
    How to setup dynamic names for the physical table? Where it is useful?*
    Pls help me out on this.
    thanks

    Check this similar post which might be of help dynamic physical table source schema
    Cheers,
    KK

  • Recive a file with dynamic name

    Hi All,
    I want to receive a file with dynamic name containing date stamp to it.... eg File_20080123.txt , File_20080122.txt etc.
    Can anybody suggest how to do it?
    Thanks,
    Atul

    Atul,
    Are u using mapping program in ur interface? If yes you can go ahead with ASMA + Dynamic Configurations for renaming the file.
    Have u tried this option?
    See the below Solution
    Check the ASMA File for both sender/receiver channels.
    Write the below code UDF in mapping program
    //Get Input date. Don't pass anything to this UDF except the Date.
    //Map the output to the root node of the target.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String fname = conf.get(key);
    String ret = fname"_"Date
    return "";
    raj.
    Edited by: Raj on Jan 23, 2008 4:09 PM

  • Dynamic names for class and variable

    Hi Folks,
    How do you make a new instance of a class with a dynamic name.
    var dynamicname = new dynamicname()
    i try something
    var this["test"]:Class = new ["Test"]()
    but offcourse its not this...
    I need this couse i have a librairy with SWC fonts they are only reference.. I get the font name from a CSS file and after i need to make a instance of the SWC file so the font is embedded.
    Thanks anyone who can help me!
    Cheer, Michierl

    Btw Murphy its not working......
    var fontRef = Class(getDefinitionByName("Arial"));
    var font = new fontRef();
    trace(font);
    The varibable definition not defined.
    I have 5 fonts as SWC Files set as reference lib in flex.
    But i dont wann to load all fonts yet cosue that will make my movie 200kb ... so i copy the fontname of the stylesheet and then make a instance of that font class.
    But how? With yours it need already a refrences to that class.

Maybe you are looking for

  • VS2012 SSRS Project - Intellisense problem while editing dataset

    Environment: VS2012 with SSDT, Reporting Services project When editing the dataset query (which is T-SQL code) of any report and I try to type table.field, when I reach the period (.) character Intellisense pops up with Equals & ReferenceEquals, and

  • Unable to access personal web hosting on Mac OS 10.4.11

    I can't get personal web sharing to work. If I set personal web sharing on in the control panel, it reports an IP address of 10.1.1.4, which clearly isn't my inTERnet address. This is also what I see in the Network control panel. If I head to whatism

  • Oracle  10g_win32_db with patch PATCH 3837371 cant find OEM or Worksheet

    I just installed Oracle10g with patch 3837371. I am unable to find OEM or SQLPlus Worksheet in my Start->Programs->Oracle. I have been able to locate the HTTP version of Enterprise Manager via going straight to the internet, but there is still no lin

  • Printout of Change PO Only.

    Dear ALL, There is one requirement of my client. When a po is changed after the initial printout, the change output prints only the changes, and not the full PO. I know this is the standard way SAP works. Is there any way where we can take the print

  • How can i control which iView gets updated when a nav node gets clicked?

    Hello, Following setting: the content area of the desktop inner page inside the default frameworkpage usually consist of just one iView. But what happens when there are 3 iViews inside? How do i have to call the pageloader which of the 3 iViews shoul