understanding switch and variables
Posted: Mon Sep 13, 2010 10:15 pm
In other projects I have used simple if/then statements, but I now have situation where switch might be better. I have read the documentation again and again, but I still don't quite get it.
My needs are as follows:
I have a main stack (foundation) with a substack (console). All of my buttons, etc. are in the console substack which trigger things in the main stack. I have a button that I want to have show the next field of a set of invisible fields on the current card of the main stack. There are seven cards in the main stack each with different sets of fields, but I want the same button to function for all of them dependent on which card is current.
Here is just one sample of the many that I have tried:
What am I not understanding? This doesn't give me back any errors, but nothing happens. Can you guys help me better understand "switch," etc.?
Thanks,
Scott
My needs are as follows:
I have a main stack (foundation) with a substack (console). All of my buttons, etc. are in the console substack which trigger things in the main stack. I have a button that I want to have show the next field of a set of invisible fields on the current card of the main stack. There are seven cards in the main stack each with different sets of fields, but I want the same button to function for all of them dependent on which card is current.
Here is just one sample of the many that I have tried:
Code: Select all
on mouseUp
go to current card of stack "foundation"
put cardName into Here
switch Here
case Here = "one"
if visible of fld "F1" is true
then show fld "F2"
if visible of fld "F1" is false
then show fld "F1"
break
case Here = "two"
if visible of fld "F3" is true
then show fld "F4"
if visible of fld "F3" is false
then show fld "F3"
break
end switch
end mouseUp
Thanks,
Scott