Jump to content

String as Variable


 Share

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 
    For $i = 1 To $vakeditr2[0]
        If $vakeditr2[$i] <> "" Then
   $vakken2 = "$vak" & $i
            Guictrlsetdata($vakken2, $vakeditr2[$i])
        EndIf
    Next

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?

Thanks!

P.S.

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

Edited by PcExpert
Link to comment
Share on other sites

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

VW Bug user

Pinheiral (Pinewood) city:

http://pt.wikipedia.org/wiki/Pinheiral

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...