Variables Name Appending

Results 1 to 3 of 3

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
    jason Guest

    Default RE: Variables Name Appending

    use an array<BR><BR>in JScript<BR><BR>var arr = new Array()<BR>arr[0] = value<BR>arr[1] = value<BR><BR>similar for vbscript, but with round brackets, and no &#039new&#039 keyword (or &#039var keyword)<BR><BR>jason

  3. #3
    Jeanne Guest

    Default RE: Variables Name Appending

    Yes,you are right,by implementing Array can achieve such task.<BR>However,I want to know if it is feasible to access variables <BR>by a FOR loop which are in forms of varx where x is a number.<BR>Since those var1,var2 are 1 dimension array already .If I use array to implememet them again,then I have to use 2D array and I don&#039t want to change the data structure to such great extent.<BR><BR>Thank you very much!

Posting Permissions

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