tamir Posted January 24, 2005 Share Posted January 24, 2005 i have a function that counts something and use "for" loop to assign number of vars (he number is the count result). i don't know how many vars i will get so i used "for" loop that does something like this: For $i=1 To $count Assign("var" & $i, $sometext) Next but since this code is in a function, the vars only declared in the function itself, and i can't use them in other functions, so i wanted to use Global for each var in the func. how do i do that? or r there any other ways to global these vars? Link to comment Share on other sites More sharing options...
jpm Posted January 24, 2005 Share Posted January 24, 2005 There is no something to put a by defaut all variables as global. But you can force the assign variable to be global Assign("var" & $i, $sometext, 2 ) Link to comment Share on other sites More sharing options...
tamir Posted January 24, 2005 Author Share Posted January 24, 2005 oh ty Link to comment Share on other sites More sharing options...
tamir Posted January 24, 2005 Author Share Posted January 24, 2005 (edited) hmm i used the assign as u said, and in other func i did: For $a=0 To $count $tmp = Eval("var" & $a) _ArrayDisplay($tmp) Next but it isn't working, why? Edited January 24, 2005 by tamir Link to comment Share on other sites More sharing options...
SvenP Posted January 24, 2005 Share Posted January 24, 2005 hmm i used the assign as u said, and in other func i did:For $a=0 To $count $tmp = Eval("var" & $a) _ArrayDisplay($tmp) Nextbut it isn't working, why?<{POST_SNAPBACK}>Tamir,In your first code you started with 1, so that would give: var1, var2, etc.In this code you started with 0, but "var0" has not been assigned anything.Regards,-Sven Link to comment Share on other sites More sharing options...
tamir Posted January 24, 2005 Author Share Posted January 24, 2005 (edited) in my script i started from 1, i didn't copy it right... so what is the problem? :/ nvm, it suddenly worked Edited January 24, 2005 by tamir Link to comment Share on other sites More sharing options...
tamir Posted January 24, 2005 Author Share Posted January 24, 2005 another question: how do i disable the writing on the gui combo? Link to comment Share on other sites More sharing options...
jpm Posted January 24, 2005 Share Posted January 24, 2005 another question:how do i disable the writing on the gui combo?<{POST_SNAPBACK}>I am not sure to understand who is writing what.can you give a small example that' reproduce your problem?Thanks Link to comment Share on other sites More sharing options...
tamir Posted January 24, 2005 Author Share Posted January 24, 2005 when i create a combo and put some options, if u choose an option u can edit it (u can type new name but it wont save), i wat it to be read-only... Link to comment Share on other sites More sharing options...
Josbe Posted January 24, 2005 Share Posted January 24, 2005 when i create a combo and put some options, if u choose an option u can edit it (u can type new name but it wont save), i wat it to be read-only...<{POST_SNAPBACK}>Look here AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
tamir Posted January 24, 2005 Author Share Posted January 24, 2005 thanks josbe and can i know what each number that i give to $CBS_DROPDOWNLIST does? is it written somewhere? Link to comment Share on other sites More sharing options...
Josbe Posted January 24, 2005 Share Posted January 24, 2005 thanks josbe and can i know what each number that i give to $CBS_DROPDOWNLIST does?is it written somewhere?<{POST_SNAPBACK}>$CBS_DROPDOWNLIST = 0x0003, Displays a static text field that displays the current selection in the list box.GUI Control Styles in the helpfile. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now