preOpenCard works for db access, not sure about other externals. Pete Molly's Revenge <http://www.mollysrevenge.com>
On Mon, Apr 11, 2011 at 4:00 PM, Mike Bonner <bonnm...@gmail.com> wrote: > Might look at http://forums.runrev.com/viewtopic.php?f=18&t=1694 and see > if > it applies. > > Also noticed you mentioned a database in your post, if you're trying to > access a database from your stack, you can't do anything relating to it in > your preopenstack handler. The external won't be loaded yet and will fail. > If you look at the bottom of a dictionary entry there is a note explaining > this, and I think it applies to all externals not just DB, so anything that > requires a fully loaded external should go into openstack, or I think > preopencard will work but I haven't tested it. > > On Mon, Apr 11, 2011 at 4:27 PM, Paul Foraker <paul.fora...@gmail.com > >wrote: > > > I've built a little app that is generating a script error on Windows 7, > but > > not on XP or Mac. On Win 7, the app generates this error message: > > > > Executing at 2:58:29 PM > > Type > > Object card id 1002 > > Line put 'Object' & tab & the short name of tObject & cr after > > tErrorString > > Hint preOpenCard > > > > I don't have access to the Win 7 machine to run the stack in LiveCode, so > > I'm relying on my user to run the standalone and let me know how it goes. > > So > > far, not so good. > > > > The stack is a one-card stack with a data grid and the revExternalLibrary > > for MySQL support. All three stacks have a card id 1002, but none of them > > have scripts. There is no "preOpenCard" handler in any object in the > stack > > files. There is no such command as in the line above in use in any script > > that I can find. > > > > > > On preOpenStack, the main stack opens a file on the user's hard drive, > > using > > this code: > > > > function actionFile pFname > > if the platform contains "Mac" then > > put specialFolderPath("Preferences") into tPath > > else -- windows > > put "0x000C" into myDocs > > put specialFolderPath(myDocs) into tPath > > end if > > put "/4Spires" after tPath > > if there is no folder tPath then create folder tPath > > put "/" &pFname &".txt" after tPath > > return tPath > > end actionFile > > > > I'm passing this function the string "ActionHistoryURLs" which is the > name > > of a file containing a return-delimited list of urls the user has > entered. > > If there are none yet, I use a default url instead. I use the first one > in > > the list (or the default one) to open a file on the server containing > > encrypted database configuration information. I decrypt the config info > and > > execute a query to get the "action history" from the database, and then > > populate the datagrid. Works fine on Mac and XP. Chokes on Win 7 in two > > ways. First, it never gets the data from the default url; second, when > the > > user clicks that default url in a list, it should go get the data. That's > > when the interrupt occurs, and he sends me the error message. > > > > I'm wondering if this error is occurring in some part of the engine code > > instead of mine, and what's up with the single quotes in the command? > > > > Any ideas? > > > > -- Paul > > _______________________________________________ > > use-livecode mailing list > > use-livecode@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode