Jump to content
Sign in to follow this  
darthun

GUI control ID not equal to itself

Recommended Posts

I'm using the example gived by BI on this page : http://community.bistudio.com/wiki/DialogControls-Toolbox

Where i create a Toolbox and i get a hint in the corner that gives me the control ID and value. The example works fine.

However, I can't seem to match the controlID with itself.

something like :

"Control #200" == (_this select 0)

is always false, even though the variable contains the infamous "Control #200" string as shown in the example.

_this select 0 contains more than just the number. And i can't seem to find what.

how can i compare that parameter ?

Share this post


Link to post
Share on other sites
ctrlIDC (_this select 0) == 200

  • Like 1

Share this post


Link to post
Share on other sites

Just to add on, Controls are their own datatype, also known as CONTROL. The "Control #___" string is what's generated when you try to represent a control as a string. As Larrow pointed out, ctrlIDC returns the control's id number as a scalar, which you can easily compare with.

Fun other fact: Even though it's bad form,

"Control #200" == str (_this select 0)

Should return true.

Share this post


Link to post
Share on other sites

Thank you for the polite and quick answers.

I consider this thread answered and closed. :)

I will have other questions though, and am actively looking to learn more sqf and make friends in the scripting community. But that is another topic for another thread.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×