doubts about globals, seeking advise...
Andre Garzia
soapdog at mac.com
Sun Jan 4 04:52:55 EST 2004
On Jan 3, 2004, at 7:39 PM, Ken Ray wrote:
> Andre,
>
> Globals are just that... "global". This means that as long as Rev is
> running (i.e. the engine is in operation and you haven't quit), the
> values you put in a global will remain and be accessible from all
> stacks
> that are open.
>
Ken
Thanks for the quick and very very usefull reply! :D thank God global
trully means global....
> Well, I'd make your DB Connections open/close with the
> openStack/closeStack handlers of the app stack, but don't open that
> stack until the splash has fully displayed. After the splash goes away,
> open the app stack and have it run the connections to the database. If
> you need to pass information between the splash stack and the app
> stack,
> you can use globals, but my question would be: where do the IDs come
> from? Does the splash stack even need to *know* the IDs? Or can the IDs
> just get initiated when the app stack opens? As in:
>
> -> Launch executable
> -> Splash stack displays
> -> Splash stack closes
> -> App stack displays, makes initial DB connection, stores IDs
The splashscreen is supposed just to pop up, show itself presenting
language options (software is localized) then it should go away.
All DB funcs and stuff relate only to the app stack. The problem is
just that:
1) app stack is working standalone.
2) splashscreen is working standalone.
3) Use distribution builder to pack both, and treat splashscreen as
main stack.
4) When run, everything explodes... The stack cannot find tDatabaseID
(declared as global in both stacks, outside the handlers) so it throws
an error that
database is not opened. But in openStack I use this code:
-- open the database connection.
if tDatabaseID is empty then
get revOpenDatabase("MySQL", "blablabla", "blablabla", "blablabla"
,"blablabla")
if it contains "err" then
answer "Cannot open database: " & it
exit openStack
else
put it into tDatabaseID
end if
end if
This code is simple and straight forward, in my handlers I always check
if tDatabaseID is empty, if so I throw an error... It works inside the
IDE, also works if make standalone by itself, it's only when put
together with splashscreen (which does not call any db func) that this
strange behaviour occours...
Cheers, thanks for your help
Andre
>
> ???
>
> Ken Ray
> Sons of Thunder Software
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
Andre Alves Garzia ð 2003 ð BRAZIL
http://www.soapdog.org
More information about the use-livecode
mailing list