> > I am using PalmOS 3.5.
> >
> > There's a bunch of routines to create UI objects at runtime, e.g.
> > FldNewField() and CtlNewControl().  All routines require to specify
> > the ID of the new object.  As I understand, this ID should be unique
> > throughout the application (at least throughout the current form).
> >
> > How do I create an ID which is unique?
> >
> > Of course I can use #define and manually select IDs.  I would consider
> > this as "hardcoded" as it might interfere with any automatic creation
> > of IDs, e.g. when using PilRC to create static UI objects.  Is there
> > a safer way?
> >
Synthesis <[EMAIL PROTECTED]> wrote:
>  
>  Let's say your the last UID of a control in your form is 9999 (unlikely).
>  Even now you could use UIDs up to 32768 (or something like that). For each
>  new dynamicaly created control increase the number, e.g.:
>  
>      first control: 10000
>      second control: 10001
>      third control: 10002
>  
>  AFAIK you can have the same ID in two (or more) different forms, but not in
>  the same.

My question was more academic.  Of course I know how to generate new
IDs which are "unlikely" to exist.  Currently I use PilRC and I observe
that PilRC assigns ID counting from 9999 downwards; hence it is unlikely
that IDs below 9000 ever get assigned.

I expected that the OS was supplying a routine which provides an ID 
which is guranteed to be unique.

hcw


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

Reply via email to