Sign in to follow this  
Followers 0
Bi0haZarD

assigning a variable with a number from a string..

4 posts in this topic

#1 ·  Posted (edited)

god i'm embarressed to ask this, but what is the correct way to assign a string to another string along with a variable..

like...

lets say i have a do until loop running, and I need to make an undetermined amount of strings...

so.. like..

$string & $number = $data

or..

$string[$number] = $data

or how would you do this? I need to read the strings later but i don't want to have to put all the info in like a text box or something outside of the gui..

Edited by Bi0haZarD

Share this post


Link to post
Share on other sites



You should use an array, for example

#include <Array.au3>
Dim $avArray[10]
for $i = 1 to 9
  $avArray[$i] = "blah"
next

To realize a dynamic array with a unknown number of entries you have to resize the array at runtime using ReDim.

Best regards,

Marc


It's my job to comfort the disturbed and to disturb the comfortable.
My Projects: Profiler, MakeSFX, UserInfo

Share this post


Link to post
Share on other sites

ahh many thanks, never done an array before.

;)

Share this post


Link to post
Share on other sites

What you're asking for in your first post, you can do with Assign.

Assign("sec_" & @SEC, "whoah")

But as Marc suggested, it's probably best to use an array...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0