Page 1 of 1
Syntax problem[solved]
Posted: Fri Jun 07, 2024 9:42 am
by Jean-Paul
Hi to all,
Why this doesn't work ?
What is the exact syntax please ?
Note: I don't want to close the stack "zzz" but only the card "xxx" which is in it.
Thanks,
Regards, J-P.
Re: Syntax problem
Posted: Fri Jun 07, 2024 9:54 am
by richmond62
I do not think this is possible.
What you could do is make that card
invisible:
Code: Select all
set the visible of card "xxx" to false
Re: Syntax problem
Posted: Fri Jun 07, 2024 10:12 am
by Jean-Paul
Thanks richmond62 but I made a try of this syntax already and it didn't work either
Regards, J-P.
Re: Syntax problem
Posted: Fri Jun 07, 2024 10:35 am
by richmond62
Yup: that was me being foolish:
viewtopic.php?t=26938
-
Re: Syntax problem
Posted: Fri Jun 07, 2024 12:01 pm
by SWEdeAndy
Jean-Paul wrote: βFri Jun 07, 2024 9:42 am
Note: I don't want to close the stack "zzz" but only the card "xxx" which is in it.
Hi Jean-Paul,
That's not really how cards work. "Closing" a card is not an action in itself, but an effect of either closing the stack or moving to another card. When you do so, a closeCard message is sent to the card, and if no closeCard handler is present in the card script, the message gets passed on to the stack script.
If a stack has only one card, then it doesn't make sense to "close" just the card or make that card invisible.
(From the "visible" entry in the Dictionary: "You can set the visible property of a card, but doing so has no effect. Cards cannot be made invisible.")
What is it you actually want to achieve?
Re: Syntax problem
Posted: Fri Jun 07, 2024 1:13 pm
by richmond62
Hazarding a guess I would suppose the OP wants to 'hide' cards from end-users.
i.e. make certain card
inaccessible to end users.
Obviously a button with this sort of code:
will not cut the mustard.
Probably the best thing is, for any cards the OP wants make inaccessible to the end-user, is to set their
mark to true so that they can be bypassed.
Here's a 3 card stack I whipped up where you can 'hide' the middle card:
-
-
-
The cards are named, sequentially, 'K1', 'K2', and 'K3'.
The button on card 'K1' called "GO NEXT CARD" contains this code:
Code: Select all
on mouseUp
go card "K2"
if the mark of card "K2" is true then
go card "K3"
end if
end mouseUp
There is a button on card "K1" to
unmark card "K2", and a button on card "K2" to
mark card "K2".
Re: Syntax problem
Posted: Fri Jun 07, 2024 1:55 pm
by Jean-Paul
Hi to all and thanks for your answers.
The deal is really simple.
I've plenty of cards which share the same stack "zzz".
The first card "xxx" deal with all the user preferences, init and so one...
This card should not be seen. It's a small card large as 320x200px
When the init are done, the card "xxx" go to card "yyy", close itself then unlock the screen
Code: Select all
on openCard -- it's the card "xxx"
lockScreen
-- init all preferences
go to card "yyy" of this stack
-- close, hide, burn yourself and by by!
unlock screen
I let you guess the line which makes problem
Regards, J-P.
Re: Syntax problem
Posted: Fri Jun 07, 2024 2:45 pm
by dunbarx
Hi.
Glad you have a solution.
The core issue is just what SWEdeAndy said, and this goes back to Hypercard in 1987 where a stack is a collection of one or more cards with a "rolodex" paradigm. The relationship between cards and the stack is different than, say, a card and its controls. Bottom line, you cannot hide or show a card ; a card does not even have the "visible" property. And so a one-card stack is even more tied down that way.
A stack does have that property, though, and you can show and hide the stack, and with a single card stack, that is what you originally wanted to do with the card.
Hope this hurts.
Craig
Re: Syntax problem
Posted: Fri Jun 07, 2024 3:05 pm
by SWEdeAndy
dunbarx wrote: βFri Jun 07, 2024 2:45 pm
Hope this hurts.
Right...

Re: Syntax problem
Posted: Fri Jun 07, 2024 3:10 pm
by SWEdeAndy
Jean-Paul wrote: βFri Jun 07, 2024 1:55 pm
I let you guess the line which makes problem
Possibly "lockScreen" that should be "lock screen". Not sure if it makes a difference, but it kind of should...
Anyway, by going to card "yyy" you have already closed card "xxx". So I don't really see the problem...?
Re: Syntax problem
Posted: Fri Jun 07, 2024 5:09 pm
by dunbarx
by going to card "yyy" you have already closed card "xxx".
This is a good way to "hide" a card. Go somewhere else.
Craig
Re: Syntax problem
Posted: Sat Jun 08, 2024 8:09 am
by Jean-Paul
Hi to all,
My apologies for this question which I realize is very irrelevant.
So itβs true that it hurts
Have a nice week-end, J-P.