There is no reason why your normal launch can't be written without globals so that it is the same as your sublaunch case. It will require a little extra effort though. Here's what I do to make a nice tight module that has no globals:
1.) Put all globals into a single structure (or several structures inside a single structure). 2.) Create an init function for that module (either called during AppStart or during a form open event). This function allocates a chunk of memory and then stuffs it into a feature. 3.) Now every time you enter that module (every external entry function), you simply get the feature pointer and then access the "globals". 4.) If other modules need to see these globals then you simple publish the feature number and structure so they can get it (or provide access functions in the module that allows retrieval and setting). 5.) Create a GetModuleGlobals function 6.) Create a DestroyGlobals function to be called during AppStop or during the form close processing. If you do all these things, then your normal launch doesn't use globals, and then any sublaunches can just use the same code and not worry about globals. Kevin -----Original Message----- From: Henk Jonas [mailto:[EMAIL PROTECTED]] Sent: Friday, August 02, 2002 1:54 AM To: Palm Developer Forum Subject: Re: Hello ! Need some real help..... Ah, now I understand. Why do you need global variables? You could write a separat EventLoop which is used if you have to display this form and are called without globals. It will be lead to some double parts in your code, one for normal launch and one for beeing called without globals, but it would be the straightforward design. hope it helps, Henk (have a look in the example source from Palm, they do it alos for Find etc.) Abhijit Roy wrote: > Hi Henk, > > >>it's not the first time you come with this question. >> > > I know its not the first time I am putting this in > the forum . But u know am in need of real help .... > > >>Just for >>curiousity, how will the other app call your form? >>Something I don't >>understand... >> >> > The external App has some defined calling sequences > with which it can send calls to a set of applications > listed in its database .Now my app. has a number of > entry points (Launch Codes to b precise) which has > distinct set of jobs to perform . In one such launch , > > I am going to display the form . But U know in > external calls u dont have access to globals . > > Hope U get my Problem ! > > Regards, > Abhijit. > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - Feel better, live better > http://health.yahoo.com > > > > -- ------------------------------------------------------------------------- [EMAIL PROTECTED] www.metaviewsoft.de <A HREF="http://www.handango.com/PlatformTopSoftware.jsp?authorId=95946"> <IMG SRC="http://user.cs.tu-berlin.de/~jonash/werbung.jpg"></A> ------------------------------------------------------------------------- -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ ------------------------------------------ The information in this transmittal and any attachments is privileged and confidential and is intended only for the recipient(s) listed above. You are hereby notified that any unauthorized distribution or copying of this transmittal or its attachments is prohibited. If you have received this transmittal in error, please notify Invivodata immediately at (831) 438-9550. ------------------------------------------ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
