check box's & if else statements
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
check box's & if else statements
I was curious, can you structure an "if then/else" statement to trigger two different commands in a check box script? Example....I have code that puts the "label of me"(checkbox) into a field on another card. I would like to be able to remove the label when a user "uncheck's" the box. So far, all my attempts have failed!!!
edit- better yet...what is the best way to remove a string of text if the user de-selects the check box?
edit- better yet...what is the best way to remove a string of text if the user de-selects the check box?
Re: check box's & if else statements
Hi Kenny,
that's pretty easy: You can check "the hilite of btn xyz".
Best
Klaus
that's pretty easy: You can check "the hilite of btn xyz".
Code: Select all
...
if the hilite of btn "your checkbox here..." then
## You can omit the = TRUE here!
## In that case the engine always presumes you mean TRUE :-)
## checkbox checked!
## do your stuff
else
## checkbox UNchecked
## do other stuff here...
end if
...
Klaus
Re: check box's & if else statements
Thank you for the quick response! Much KUDOS!
Re: check box's & if else statements
I feel like a complete idiot...I cannot for the life of me delete the entry after it has been placed in the field and the box is unchecked....I want to do something like this....
but the "Delete" portion of the code gives me an error after "from"
any suggestions?
Code: Select all
on mouseUp
if the hilite of button "v" then
put label of me into fld "total" card "Finish"
else
Delete label of me from fld "total" card "Finish"
end if
end mouseUp
any suggestions?
Re: check box's & if else statements
Hi.
Just a little more experience with LC syntax and you should be OK.
You don't empty the text of a field by deleting anything. If you want to empty a field:
put empty into field "total" of card "finish".
You are always putting; here you are just putting nothing.
This is no different than your earlier command to "put the label of me into field "total" of card "finish".
Craig Newman
Just a little more experience with LC syntax and you should be OK.
You don't empty the text of a field by deleting anything. If you want to empty a field:
put empty into field "total" of card "finish".
You are always putting; here you are just putting nothing.
This is no different than your earlier command to "put the label of me into field "total" of card "finish".
Craig Newman
Re: check box's & if else statements
Hi Kenny,
You can't delete a lavel. Only set it
But if you want empty in fld card "Finish you can try
Best regards
Jean-Marc
You can't delete a lavel. Only set it
But if you want empty in fld card "Finish you can try
Code: Select all
on mouseUp
if the hilite of button "v" then
put label of me into fld "total" of card "Finish"
else
put empty into fld "total" of card "Finish" -- empty or what you want
end if
end mouseUp
Jean-Marc
https://alternatic.ch
Re: check box's & if else statements
thanks so much everyone! I love that we have a friendly forum to ask questions....