Having fun with multiple monitors
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Having fun with multiple monitors
I understand "rhetorical" full well, but I felt like a spot of fun, so I replied to your
question anyway.
question anyway.
Re: Having fun with multiple monitors
I know!richmond62 wrote: ↑Tue Mar 10, 2020 6:41 pmI understand "rhetorical" full well, but I felt like a spot of fun, so I replied to your
question anyway.

-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Having fun with multiple monitors
The most important thing is that the "dirty deed" is now done.
-
-
Re: Having fun with multiple monitors
But now, of course, the question is whether or not it "was done dirt cheap!"richmond62 wrote: ↑Tue Mar 10, 2020 7:34 pmThe most important thing is that the "dirty deed" is now done.


-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Having fun with multiple monitors
Well, it took me about 60 minutes + 60 minutes in bed with the cat when my brain was going round in circles.bogs wrote: ↑Tue Mar 10, 2020 8:34 pmBut now, of course, the question is whether or not it "was done dirt cheap!"richmond62 wrote: ↑Tue Mar 10, 2020 7:34 pmThe most important thing is that the "dirty deed" is now done.![]()
I am still looking for a LOGICAL reason for why including setting variables inside a switch statement did not work.
Re: Having fun with multiple monitors
I learned this a long time ago about "Switch" constructions, which I love.
You just cannot put stuff inside a "Switch" construction, but outside the "case" statements. Check this out, with a button and a field on a new card:
Comment, in turn, only ONE of the "random" statements. If you comment out the bottomMost, you get a random number. But if you comment the topMost, you get LC ignoring you.
Craig
You just cannot put stuff inside a "Switch" construction, but outside the "case" statements. Check this out, with a button and a field on a new card:
Code: Select all
on mouseUp
put random(42) into fld 1
switch the number of btns
--put random(42) into fld 1
case 1
break
case 2
break
end switch
end mouseUp
Craig
Re: Having fun with multiple monitors
Surely once the “switch” statement is read the engine searches for the first “case” statement that qualifies.
Anything else is redundant and ignored.
I daresay any statement between the “switch” and the first “case” will be ignored.
Anything else is redundant and ignored.
I daresay any statement between the “switch” and the first “case” will be ignored.
Re: Having fun with multiple monitors
@jameshale is correct - the switch statement reads the statements inside it in order, and then operates like a jump table:
The engine evaluates X - if it matches A then it jumps to (2), when it hits the break it will jump to 'end switch' (skipping the other blocks); it matches B then it jumps to (3), as there is no break it will then continue to execute (4). If it matches C then (4) only executes. If it matches none of them then it jumps to (5) (the default section).
At no point can any statements at point (1) be executed, nor would any statements between any of the breaks and cases.
Code: Select all
switch X
... (1)
case A
... (2)
break
case B
... (3)
case C
... (4)
break
default
... (5)
end switch
At no point can any statements at point (1) be executed, nor would any statements between any of the breaks and cases.
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Having fun with multiple monitors
Thank you very much for a complete and easily comprehensible answer.