tamir Posted January 24, 2005 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?
jpm Posted January 24, 2005 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 )
tamir Posted January 24, 2005 Author 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
SvenP Posted January 24, 2005 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
tamir Posted January 24, 2005 Author 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
tamir Posted January 24, 2005 Author Posted January 24, 2005 another question: how do i disable the writing on the gui combo?
jpm Posted January 24, 2005 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
tamir Posted January 24, 2005 Author 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...
Josbe Posted January 24, 2005 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
tamir Posted January 24, 2005 Author Posted January 24, 2005 thanks josbe and can i know what each number that i give to $CBS_DROPDOWNLIST does? is it written somewhere?
Josbe Posted January 24, 2005 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
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