Using Groups
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Using Groups
Hi i was wondering if there is a way to place a group on all of the cards in a stack, instead of having to do it card by card. The stack was made before the group was created. Thank You!!
Re: Using Groups
HI.
Sure. Look up the "place" command in the dictionary. Note that this can be scripted, so if you have hundreds of cards this might be prudent. if you only have a handful, you might just do it manually.
Do you need help making a handler, if that is the way you need to go?
Craig Newman
EDIT.
Once you finish with this task, make sure to set the backgroundBehavior of the group to "true", so that in the future it will automatically place itself.
Sure. Look up the "place" command in the dictionary. Note that this can be scripted, so if you have hundreds of cards this might be prudent. if you only have a handful, you might just do it manually.
Do you need help making a handler, if that is the way you need to go?
Craig Newman
EDIT.
Once you finish with this task, make sure to set the backgroundBehavior of the group to "true", so that in the future it will automatically place itself.
Re: Using Groups
Hi,
You can also place a group on preopencard and remove it on closecard.
Best regards
Jean-Marc
You can also place a group on preopencard and remove it on closecard.
Best regards
Jean-Marc
https://alternatic.ch
Re: Using Groups
well i know how to place the group on a single card, but is there a any way to place the group on all pre existing cards in my stack? like at the same time instead of doing it all manually one at a time.
Re: Using Groups
Hmmm.
Apparently you do need help writing a handler that will do that. See my post two up.
If nobody else chimes in, I will be back after diinner.
Craig
Apparently you do need help writing a handler that will do that. See my post two up.
If nobody else chimes in, I will be back after diinner.
Craig
Re: Using Groups
Delicious.
Not sure where your group is. On the first card? Does not matter, but this places it on the next card and all subsequent.:
This might go into the stack script, and you can call it from the message box. Do you need to place it on earlier cards as well? Check this out and try that for yourself if you need. Remember what I said earlier about setting the backGroundBehavior...
Craig
Not sure where your group is. On the first card? Does not matter, but this places it on the next card and all subsequent.:
Code: Select all
on placeGroups
repeat with y = the number of this card + 1 to the number of cards
place group "yourGroup" onto cd y
end repeat
end placeGroups
Craig
Re: Using Groups
Hi Craig,
your script will throw an error!
Better:
Best
Klaus
your script will throw an error!

Better:
Code: Select all
on placeGroups
repeat with y = the num of cards
## Check if group has already been placed:
if there is grp "yourGroup" of cd y then
next repeat
end if
## You need to address the group with BG (background), if it is not on the current card!
## Or you get something like -> object not found: group "XYZ"
## Now place group onto cd:
place BG "yourGroup" onto cd y
end repeat
end placeGroups
Klaus
Re: Using Groups
Klaus.
True, if the group is already placed on a distant card, since it is not permitted to place a group on a card that already contains that group.
But the OP asked how to automate placing a group onto subsequent cards. So my handler assumes too much, that all downstream cards do not have it? I guess so. Certainly a more robust handler would check that, as you say.
Craig
True, if the group is already placed on a distant card, since it is not permitted to place a group on a card that already contains that group.
But the OP asked how to automate placing a group onto subsequent cards. So my handler assumes too much, that all downstream cards do not have it? I guess so. Certainly a more robust handler would check that, as you say.
Craig
Re: Using Groups
Hi Craig,
since i only and always want the best for the beloved forum members,
I just wanted to avoid ANY possible and probably unexspected error dialog,
which will, and I speak out of experience, heavily irritate a new LC user
Best
Klaus
since i only and always want the best for the beloved forum members,
I just wanted to avoid ANY possible and probably unexspected error dialog,
which will, and I speak out of experience, heavily irritate a new LC user

Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Using Groups
@hands16: One thing that may be helpful to keep in mind while working in LiveCode is that everything in the IDE is done in the LiveCode language itself. The IDE scripts are complex, and as such not a good place to begin learning, but they can serve as good inspiration for any tools you might want to make to help automate your development - if the IDE can do it, you can too.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn