adding field to stack with unknown name
Bob Hartley
rev at armbase.com
Sat Feb 5 17:05:03 EST 2005
Hi All.
I have a stack with a script that puts a field on another stack. I had this
scripted fine using.
on mouseUp
copy field "TextField" of stack "Fields" to card 1 of stack
"ExperimentDatabase.abd"
end mouseUp
Then I had a save button that saved ExperimentDatabase.abd and prompted for
another name. Now this is not the way I want to do it for various reasons
(overwriting other students's databases).
I would like the person to be forced to save their database so i followed
the employee database demo example and used a button with this
on mouseUp
doFileNew
end mouseUp
and this script in the stack. (PS thanks Richard, excellent example)
on doFileNew
ask file "Name new database file:" with "MyDatabase.abd"
if it is empty then exit to top
put it into tFileName
if char -4 to -1 of tFileName is not ".abd" then put ".abd" after tFileName
set the itemDelimiter to "/"
put last item of tFileName into tStackName
set the visible of stack "Master Database" to false
clone stack "Master database"
Err the result
set the name of stack it to tStackName
set the title of stack tStackName to (char 1 to -5 of tStackName)
set the minWidth of stack tStackName to 500
set the minHeight of stack tStackName to 250
set the fileName of stack tStackName to tFileName
Err the result
set the visible of stack "Master Database" to true
put the stackFileType into tSaveStackFileType
set the stackFileType to "RevoEDB_"
save stack tStackName
Err the result
set the stackFileType to tSaveStackFileType
show stack tStackName
toplevel stack tStackName
end doFileNew
OK Now the stack has a name that I dont know?????
So how do I use a buton on another stack to insert a field in this stack
with a name something .abd?
Cheers
Bob
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.5 - Release Date: 03/02/2005
More information about the use-livecode
mailing list