Advice on: sharing data between stacks

Emilio Gagliardi emilio at ualberta.ca
Mon Jun 6 14:19:52 EDT 2005


Hello,
I was wondering what the best mechanism is to share data between  
loaded stacks.  I am trying to build a utility stack (that will  
always load first.  I guess that makes it a standalone application)  
that gathers some demographic information, loads a second stack,  
which performs some custom task based on the demographic data,  
accepts data from the second stack, and writes a combination of the  
user data and retrieved data to a file.  The second stack is  
dynamically selected (based on the directory structure and file  
nomenclature) so I want to make the sharing generic.  But I am new to  
runrev so this might not be a good idea.

The plan is to create the utility standalone application to be  
dropped onto a parent directory.  The user selects some child  
directory (modifying defaultfolders) which contains a custom stack  
for performing some function.  The custom stack generates lists or  
arrays of data and calls a handler in the utility application to  
handle the writing of data to disk.  The premise is that many  
different people will write the custom stacks to do various unrelated  
tasks, but they all must save data in a consistent format to a  
central location.  I want to move the code, which writes the data to  
a file, out of each custom stack and place it in a central stack  
because then the end user doesn't have to worry about the mechanics  
or guidelines that I impose when writing the data file.

Here is how I envision the usage

/Disk/Parent/GenericStack.rev
1) user selects a directory
2) directory contains another stack (ex. load great grandchild 2)
3) user provides data for several variables (ex. a file name)
4) pass file name to great grand child2
5) write data from great grand child 2 to file

/Disk/Parent/Child/Grandchild/GreatGrandChild.rev
1) use file name from GenericStack
2) do some task
3) pass the data back to GenericStack.rev

/Disk/Parent/Child/Grandchild/GreatGrandChild2.rev
1) use file name from GenericStack
2) do some task
3) pass the data back to GenericStack.rev


Any suggestions are greatly appreciated.
Cheers,
Emilio


More information about the use-livecode mailing list