Dynamic Variable naming

Results 1 to 3 of 3

Thread: Dynamic Variable naming

  1. #1
    Join Date
    Dec 1969

    Default Dynamic Variable naming

    Is is possible in good old school ASP to name variables dynamicaly. EI. <BR><BR>Var1 = "MyString"<BR>For i = 0 to 15<BR> (Var1 & i) = "Something from an RS that is going though<BR> records and changing evertime For is incremented"<BR>Next<BR><BR>How do I concatenate Var1 and i to become the Name of my new Variable?<BR>Is it possible¢Õ¢Õ?

  2. #2
    Join Date
    Dec 1969

    Default It is, but

    why not just use an array?<BR><BR>dim myarray(15)<BR><BR>for i = 0 to 15<BR> ...<BR>next

  3. #3
    Join Date
    Dec 1969

    Default It is, but...

    ...it&#039;s a really rotten idea.<BR><BR>It&#039;s a huge performance hit. It doesn&#039;t work in anything except scripting languages (so it won&#039;t work in VB.NET, for example).<BR><BR>Use arrays. Or a collection class, such as Scripting.Dictionary.<BR><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