Jump to content

Recommended Posts

Posted (edited)

Are "variable variables" possible...

I believe thats what they're called

Local $var = "Product"
Local $num = 1 ;GUICtrlRead($Product_Number)
if StringIsAlNum($num) Then
   $var & $num = "Info"
   MsgBox(0, "", $Product1)
EndIf

a variable is set from the value of both $var and $num creating $Product1

I appreciate any help on this matter as it would help me use alot less code in my current project.

Thanks in advance

Edited by reecieboy
Posted

Thanks to both. My intention is that i have multiple gui controls with similar handles

for example

$Product1

$Product2

$Product3

so on an so forth..

so i really need to GUICtrlRead($var & $num) if you know what i mean, I forsee that not being possible with Assign

Posted (edited)

Thanks to both. My intention is that i have multiple gui controls with similar handles

for example

$Product1

$Product2

$Product3

so on an so forth..

so i really need to GUICtrlRead($var & $num) if you know what i mean, I forsee that not being possible with Assign

GuiCtrlRead(Eval($Var & $Num))

There ya go.

Edited by Shaggi

Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG

Posted (edited)

On a side note, which may be of interest. With AutoIt, many operations will convert a number to a string automatically, and vice versa. For example the use of the operator &= will concatenate two numbers and return a string. It makes a lot of coding easier, but it can be confusing sometimes. The functions Number() and String() are sometimes needed to alter the variable type.

Edited by czardas

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
×
×
  • Create New...