Jump to content
Sign in to follow this  

String as Variable

Recommended Posts


Hi all,

I was wondering how to combine a string and a variable. I currently have this piece of code:

$vakeditr = IniRead("vakken.ini", "algemeen", "vakken", "error")
$vakeditr2 = StringSplit($vakeditr, ",")
    For $i = 1 To $vakeditr2[0]
        If $vakeditr2[$i] <> "" Then
   $vakken2 = "$vak" & $i
            Guictrlsetdata($vakken2, $vakeditr2[$i])

This code should set the data from the stringsplit array in the inputcontrols. However, I cant find a way to combine '$vak' with '$i' so a new variable would be '$vak2' , '$vak3' and so on. Each inputcontrol is defined by '$vak' followed by a number from 1 to 30.

Does anyone know how to do this?



I looked at the Assign() Function, but that didnt seem to do what I wanted;)

Edited by PcExpert

Share this post

Link to post
Share on other sites
A. Percy

Eval( "vak" & $i )

Post edited

Edited by A. Percy

Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator[center] VW Bug user[/center]Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral

Share this post

Link to post
Share on other sites

Thanks A. Percy!

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