Sign in to follow this  
Followers 0
Azu

Variable in a variable function

5 posts in this topic

inputcreate(1,1,1)
inputcreate(2,1,1)
inputcreate(3,1,1)
Func inputcreate($a,$b,$c)
$s[$a]=guictrlcreateinput("",$b,1,$c,1)
endfuncoÝ÷ Ø&§²nr¦W±ë^Y-¡ø±¶¬#ozÚâyׯz¼­)à!Ƨ¶§ÛºØ­ç©²¯x&yê뢻

Share this post


Link to post
Share on other sites



Dim $s[4]
inputcreate(1,1,1)
inputcreate(2,1,1)
inputcreate(3,1,1)
Func inputcreate($a,$b,$c)
    $s[$a]=guictrlcreateinput("",$b,1,$c,1)
endfunc


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks, it makes the boxes okay, but instead of making $s1 $s2 $s3 it makes something else.. because when I try to do guictrlsetdata($s2,"blah") it gives a variable used without being declared error.. =(

But it works if I use

$s1=guictrlcreateinput("",1,1,1,1)
$s2=guictrlcreateinput("",1,1,1,1)
$s3=guictrlcreateinput("",1,1,1,1)
instead, so it's not having the same effect.. I'm not sure what's wrong with it..

I try doing $s&$a=guictrlcreateinput("",$b,1,$c,1)

Or $s&"$a"=guictrlcreateinput("",$b,1,$c,1)

Or $s&[$a]=guictrlcreateinput("",$b,1,$c,1) instead, to no avail..

Share this post


Link to post
Share on other sites

Thanks, it makes the boxes okay, but instead of making $s1 $s2 $s3 it makes something else.. because when I try to do guictrlsetdata($s2,"blah") it gives a variable used without being declared error.. =(

But that should be : guictrlsetdata($s[2],"blah")

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thank you, it's working great now! Just one more question..

How do I make a nested array? Do I make it just like a normal one? Or is there something else to it?

NVM it works ^^

Edited by Azu

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