Hi Daniel,
when you use IF... THEN you really have to write:
Code: Select all
...
if fld "a" = "Daniel" OR fld "a" = "William" OR fld "a" = "XXX" ...
...
Here some hints:
1. use a variable = LESS typing
Code: Select all
...
put fld "a" into tFa
if tFa = "Daniel" OR tFa = "William" OR...
...
2. In cases like this one could even consider to use a SWITCH structure!
Not really less typing, but more readable!
...
Code: Select all
put fld "a" into tFa
switch tFa
## Since we wnat to show the button if any of the mentioned names are in the field
## we can simply put several "CASE" statement here!
case "Daniel"
case "William"
case "Bob"
## etc... for every name you want to check
show btn "BMyButton"
break
default
## No conditon above has matched
hide btn "MyButton"
break
end switch
...
3. Monsieur BOOLE is your friend!
A long but one liner
Code: Select all
...
put fld "a" into tFa
set the visible of btn "MyButton" to (tFa = "Daniel" OR tFa = "William" OR tFa = "Bob")
...
The engine will at first evaluate everything in parenthesis which will be TRUE or FALSE.
Then the visibilty of the namely button will be set ot this value.
Get the logics?
Once you got it you can save a lot of typing since then you often can avoid IF THEN
when setting TRUE/FALSE values.
Instead of:
Code: Select all
...
## Let the user en-/disable the navigation through card with the arrow keys:
if the hilite of btn "Navigate with arrows" = true then
set the navigationarrows to true
else
set the navigationarrows to true
end if
...
Use this one liner:
Code: Select all
...
set the navigationarrows to (the hilite of btn "Navigate with arrows" = true)
## Note: Prenthesis not necessary here, just to demonstrate that you could use several different BOOLE checks here...
...
Hope that helps.
Best
Klaus