issues with "MyID"

Moderator: Moderator Group

issues with "MyID"

Postby claude.rivet » Mon Mar 24, 2014 8:01 pm

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
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm

Re: issues with "MyID"

Postby claude.rivet » Mon Mar 24, 2014 9:21 pm

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
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 19 guests

cron