Jump to content

Variable in a variable function


Azu
 Share

Recommended Posts

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

Link to comment
Share on other sites

  • Developers

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")

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
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...