can't access database functions from an inserted script
Eric Peden
ericpeden at homemail.com
Thu Jun 5 17:02:02 EDT 2003
For some reason, when I insert a script from a utility stack into the back
from a main stack, the inserted script is unable to call any database
functions.
I am building a system for providing interaction between an instructor and
students in distance learning classes. This system has an administrative
and client interface, implemented in two Revolution stacks. Because the
two front-ends share quite a bit of core code, I have broken up
functionality into several stacks that are shared between the front-ends.
One of these shared stacks contains the database management code. It works
fine in the IDE, but fails miserably when built as a standalone. The two
stacks, mainStack and databaseUtilityStack, are saved as separate files,
not substacks. databaseUtilityStack appears in the "Stack Files" of
mainStack. For the purposes of debugging, I set up something like this:
mainStack ::
============
on openStack
try
get revdb_connections()
answer "mainStack was able to call revdb_connections()"
catch tError
answer "mainStack was unable to call revdb_connections():" && tError
end try
insert script of stack "databaseUtilityStack" into back
tryDatabaseCallWithUtilityStack
end openStack
databaseUtilityStack ::
=======================
on tryDatabaseCallWithUtilityStack
try
get revdb_connections()
answer "dbUtilityStack was able to call revdb_connections()"
catch tError
answer "dbUtilityStack was unable to call revdb_connections():" &&
tError
end try
end tryDatabaseCallWithUtilityStack
Opening the mainStack yields these results:
"mainStack was able to call revdb_connections()"
"dbUtilityStack was unable to call revdb_connections():
219,89,9,revdb-connections223,89,1"
So, I know that revdb_connections() is available, but the utility stack is
unable to call it. I'm not sure how to decode the error value that is
generated. I include the database library when I build the standalone
(otherwise mainStack would fail too, right?); is there some reason why the
utility stack would be unable to access those functions? Is there a more
efficient approach I should be following?
I'm using Rev 2.0 on OS X; however, OS X and OS 9 standalones both exhibit
the behavior. Any help would be immensely appreciated; I've got to this
software ready in time for it to be used in the distance courses being
taught this fall, and I've already lost a month's worth of opportunities
for feedback since I've been unable to distribute standalones to our
testers.
--
eric
More information about the use-livecode
mailing list