Page 1 of 1

issues with "MyID"

PostPosted: Mon Mar 24, 2014 8:01 pm
by claude.rivet
I have this issue where MyID does not seem to behave as I expected and I am trying to figure out where I am wrong. Here is an example:

currentpb2 value is 16 for the following example
CustomScriptButton ID is also 16

The following code works as expected:
Code: Select all
if currentpb2 = 16
{
WDCustomScriptTint,currentpb2,0,0,255
}
else
{
WDCustomScriptTint,currentpb2,0,255,0
}

It colors the button blue, because currentpb2 is 16

The following code does not work:
Code: Select all
if currentpb2 = MyID
{
WDCustomScriptTint,currentpb2,0,0,255
}
else
{
WDCustomScriptTint,currentpb2,0,255,0
}

It colors the button green even though MyID should return 16 as the button ID is 16. Considering currentpb2 is also 16 I was expecting the button to turn blue.

Also, if I include MyID in a loop it takes on a bunch of value as the loop runs even though the button launching the script is ID 16.

Thanks for the help!
regards

Re: issues with "MyID"

PostPosted: Mon Mar 24, 2014 9:21 pm
by claude.rivet
I found a workaround for those who have the same issue, I basically use another variable to which I assign MyID, it looks like that:

Code: Select all
VValue,buttonselect2,MyID

if currentpb2 = buttonselect2
{
WDCustomScriptTint,currentpb2,0,0,255
}
else
{
WDCustomScriptTint,currentpb2,0,255,0
}


it also fixes the loop issue