> Register for sysNotifyDBCreatedEvent notification.

Ah! That would solve the problem, indeed, thanks! I'll just have to find a way 
to pass the information that a database has been created from the notification 
handler to the code that's looping through the databases - so that it knows it 
must abort. OK, I can probably do that with feature memory...

But wait - this notification is available only in PalmOS 5.x. What about the 
earlier versions?

> The worst thing that can happen is that some DB will be skipped.

That could be bad enough if the *wrong* one gets skipped. :-)

> Implement GetNextFile() like this:
> Keep the directory list along with the enumeration. At the
> beginning the dirList is initialized to the root dir.
> 1. Pop a directory from the dirList or terminate (empty dirList).
> 2. Start directory enumeration.
> 3. If the enumeration yields a file, return it.
> If a directory is obtained, add it to the dirList.
> If the enumeration ends, go to step 1.

It's probably not quite that simple... For instance, remembering the directory 
list is not sufficient (and, in fact, might be even unnecessary - after all, 
the full path already shows in which directory I am). As a minimum, I'll have 
to remember on the stack the current values of the file iterator (and probably 
the volume iterator too)... Probably there will be other complications too... 
I'll give it a thought...

> Yes, but I would consider it safe only for a fg application.
> Imagine an app that performs a modal event loop as part of
> processing of the dialog button press. (I.e. called from the
> form handler of the active dialog.)
> Assume further that the active form did not change.
> In this scenario the bkg application cannot do what you suggest.

But can that actually happen? When I start the scanning of multiple databases 
or files from a HotSync or card insertion event, I'll show my own user 
interface (progress bar or current path or whatever). I'll have my current form 
- I need that, in order to allow the user to abort the process. If the 
foreground application doesn't let me do that (e.g., because it's polling a 
control in a loop), then it won't let me work at all (or anybody else, for that 
matter).

Or have I misunderstood what you wrote above?

Regards,
Vesselin
-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to