Jump to content

Recommended Posts

Posted

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?

Posted

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   )
:lmao:
Posted (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 by tamir
Posted

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?

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

Posted (edited)

in my script i started from 1, i didn't copy it right...

so what is the problem? :/

nvm, it suddenly worked :lmao:

Edited by tamir
Posted

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

Posted

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

Posted

thanks josbe :lmao:

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.

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