Variables Name Appending

Results 1 to 4 of 4

Thread: Variables Name Appending

  1. #1
    Jeanne Guest

    Default Variables Name Appending

    Dear All,<BR>If I have 3 variables,namely var1,var2,var3,<BR>can I use some technique so that I can call them<BR>in terms of varx?<BR>Like : For i=1 to 3<BR>vari=.......<BR>I have tried "var" & i but not successful<BR>Can someone help?<BR>Thank you very much!

  2. #2
    Sreeram Krishnamoorthy Guest

    Default RE: Variables Name Appending

    you can use " window.execScript " for this <BR>for Example :<BR>Assumption : iAssignValue is an integer variable assigned to 10<BR><BR>iAssign = 10<BR>For i = 1 to 3<BR><BR> sExecCmd = "var" & i & " = " & iAssgnValue<BR><BR> &#039 Now the following line will execute the string inside a variable<BR><BR> window.execScript(sExecCmd) &#039Executes value inside sExecCmd<BR>Next i<BR><BR> &#039 The above batch will execute the following lines<BR> var1 = 10<BR> var2= 10<BR> var3= 10<BR> &#039 Be careful if client side is javascript it is case sensitive.<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Variables Name Appending

    You can use the Split function to collect your variables in an array and use the array instead.

  4. #4
    Jeanne Guest

    Default RE: Variables Name Appending

    Thank you very much!<BR>However,is this the Javascript method?<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts