printing and saving from a template
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
printing and saving from a template
I am writing a program which has templates. These templates use pull down menus as well as text entry boxes to make choices and write text respectively. The choices from the pull down menus and the text form a record which I want to save as a separate file (or card?) which could later be amended. There are no actions taken from the pull down menu - only the menu choice is kept as a record and saved. The user should be able to do this many times and save on each occasion as separate entities while leaving the template untouched. How can I implement this?
Re: printing and saving from a template
Code: Select all
answer file ""
put the label of button "my drop down" into url ("file:" & it)
menuhistory property
label property
menuPick message
answer file (with type) command
defaultfolder property
url keyword
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: printing and saving from a template
Thanks BvG.
But I want to save and print the card because the card is a template. The card has about 20 pulldown menus arranged in a structure which I want to preserve, so i really don't want to save each menu option as a part of a text file. As far as I can see it is only possible to save a stack.
There are other cards which also are templates and I want to treat them the same.
Can I set each template(cookie mold) up as a substack? but how do I then save the cookies made from the mold?
But I want to save and print the card because the card is a template. The card has about 20 pulldown menus arranged in a structure which I want to preserve, so i really don't want to save each menu option as a part of a text file. As far as I can see it is only possible to save a stack.
There are other cards which also are templates and I want to treat them the same.
Can I set each template(cookie mold) up as a substack? but how do I then save the cookies made from the mold?
Re: printing and saving from a template
Hi yarran,
What Björnke has suggested is the way to go. Standalones can not be saved, you will have to save the label of each menu externally.
It's not really that hard to do plus it's useful to know how in many situations.
What will happen is:
That assumes each menu item is saved on a single line of myCardOne.txt and your menus are named ComboBox Menu1, ComboBox Menu2 etc.
On closeCard you would do the opposite to save all the currently selected values back to myCardOne.txt
Simon
What Björnke has suggested is the way to go. Standalones can not be saved, you will have to save the label of each menu externally.
It's not really that hard to do plus it's useful to know how in many situations.
What will happen is:
Code: Select all
on openCard
put url("file:myCardOne.txt") into tVar
repeat for each line tLine of tVar
add 1 to n
set the label of button "ComboBox Menu" & n to tLine
end repeat
On closeCard you would do the opposite to save all the currently selected values back to myCardOne.txt
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: printing and saving from a template
Actually, if you want to save a card as a whole, it's possible to copy it to another (fresh) stack, and then save that stack. Look at the dictionary for these helpful entries:
copy command (especially the third example)
create stack command
clone command
save command
copy command (especially the third example)
create stack command
clone command
save 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