[Metacard] Re: Using a stack as a small data base
Sadhunathan Nadesan
sadhu at castandcrew.com
Wed Nov 21 15:35:17 EST 2001
Kevin, you sent me this a while back: (on how to save data with
standalones)
| You need to place the stack that you want to save changes in an external
| file, then reference this stack using the stackFiles property. When you
| load your standalone, load this stack, make changes and save as normal.
| Developers often place such stacks in a "data" folder. Distribution Builder
| can do all of this automatically when you create a Distribution.
|
| Regards,
|
| Kevin
I finally got around to this, also, to reading the article on stackfiles
on the xworlds web site. Finally made it work. Wasn't easy for me,
but, it does work, at last. So, a few notes for the list someone may
someday find helpful, elaborating on a couple of minor points.
One gotcha, and a reason I'm trying to post this to the mailing list, is
that in the stackfiles property there cannot be a space after the comma
after stack name and before the path/file name. That is unexpected
(for Unix developers anyway) that white space matters, but I suppose
the convention of allowing spaces in file names on other systems may
be responsible?
In any case, for others out there like me stuggling to "save data" in
their stand alone applications, the basic idea is that you have your
stand alone executable be a stack that opens another stack (or stacks).
This other stack is NOT a substack of your main stack. It is located by
the first stack using the fact that the stackfiles property can contain
a stack name, comma, full or relative file path name. So if your primary
stack (which is compiled as the executable) has a statement like
go foostack
and the stackfiles property contains a line like
foostack,Data/foostack.mc
Then it can find it, without it being a substack.
Per earlier note, it wasn't working for me when I had it as
foostack, Data/foostack.mc
And that took a while to grasp what was wrong.
But if this is correct, then the first stack can find the second stack,
and this second stack is not compiled into your executable, it is a
separate MC file for data (doesn't have to have an .mc extension).
Then your 2nd or data stack has to have some save code which again is
relative to the main executable, and has the file name, such as
save this stack as "Data/foostack.mc"
Those are the basic elements for saving data that are now working for me.
Kevin, thank you for your help.
Aloha,
Sadhu
Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <bugs at metacard.com>, not this list.
More information about the metacard
mailing list