Hi,
I am developing a small card based data management tool. Each card is the same and I am using grouped backgrounds to keep the data entry fields and buttons the same across cards. But, I also have a script in the card which sets a global variable to keep track of which is the current card (this is accessed from another stack to grab info from the current card to produce a report).
My problem is that when I copy a card the card script from the original card is not in the copied card. I am using "create card" in order to get a card with all the fields emptied. Is this what should happen? Or does create not copy the card level script over? This is what I suspect is the problem. If so, is there a simple workaround?
cheers
Alistair
Does a card script get copied when you make a new card?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Does a card script get copied when you make a new card?
****************************************
PLANIX
"Knowing anything is better than knowing nothing. But knowing that nothing ain't anything, why that's just plain nirvana."
PLANIX
"Knowing anything is better than knowing nothing. But knowing that nothing ain't anything, why that's just plain nirvana."
Re: Does a card script get copied when you make a new card?
create will make a new card. Although all background groups that are on the current cards will be placed on the new card, it's still a new card, and not a copy. So you want to copy or clone the card, instead of creating a new one.
try the copy command, or the clone command, instead of the create command.
try the copy command, or the clone command, instead of the create command.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Does a card script get copied when you make a new card?
Hi,
Thanks. I have tried these and both copy over the data in the fields. I have set the Share Text propert of the relevant fields to false and this still happens. So maybe this only works with the create command?
I did find a work around. It's probably better programming rather than a workaround. I put an OpenCard command in the stack script and wrote a script to put the name of the current card into the global variable. This works exactly the way that I want it to.
cheers
Alistair
Thanks. I have tried these and both copy over the data in the fields. I have set the Share Text propert of the relevant fields to false and this still happens. So maybe this only works with the create command?
I did find a work around. It's probably better programming rather than a workaround. I put an OpenCard command in the stack script and wrote a script to put the name of the current card into the global variable. This works exactly the way that I want it to.
cheers
Alistair
****************************************
PLANIX
"Knowing anything is better than knowing nothing. But knowing that nothing ain't anything, why that's just plain nirvana."
PLANIX
"Knowing anything is better than knowing nothing. But knowing that nothing ain't anything, why that's just plain nirvana."