> I think you will find that static has a slightly different meaning. If you
> wish to limit a procedures scope to the current Module/Class/Source File
> then the procedure need only be defined as Private. Static means that the
> code persists even when the module is out of scope. This holds true for
> variable definitions. A variable defined within a module or procedure will
> persist through to the next call of the module or procedure. I am not so
> sure with procedures. It would make sense for static to mean that the
> procedures code remains in memory rather then being released when the module
> is released. Can anyone verify this to be the correct behaviour for a static
> procedure.

I'm not sure which computer language you're speaking of here, but it
doesn't appear to be C.  In C, static means two different things,
depending on where the variable or procedure using it is declared. For
objects declared at the global level (this includes procedures), it
means that the object in question will only be visible to other
objects within the same source module. For objects declared within
procedures, it means that the variable will keep the same value from
one invocation of the procedure to the next.  To answer the original
question, (below), static only applies within one compiled
program. Two different Palm apps can use the same procedure name, and
they won't interact with one another at all (unless of course one
writes data to a database that the other reads, or one app
specifically launches the other app; those things are totally separate
from the two apps having a procedure of the same name).

Dean Gahlon
[EMAIL PROTECTED]


> 
> -----Original Message-----
> From: Gaurav Palvia [mailto:[EMAIL PROTECTED]]
> Sent: 07 January 2000 16:04
> To: [EMAIL PROTECTED]
> Subject: Re: why we use static before a function what is the
> significanceof it
> 
> 
> what exactly meant by the same source.does it mean that if there r
> two different apps on  Palm which has two different functions of the same
> name then it will cauuse conflict.if yes then how does it happen
> -----Original Message-----
> From: Eric VERGNAUD <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Friday, January 07, 2000 7:02 PM
> Subject: Re: why we use static before a function what is the significanceof
> it
> 
> 
> >Yes, it avoids possible name conflicts betwwen sources.
> >
> >> De : "Ramel Levin" <[EMAIL PROTECTED]>
> >> R�pondre � : [EMAIL PROTECTED]
> >> Date : Fri, 7 Jan 2000 12:40:54 +0200
> >> � : <[EMAIL PROTECTED]>
> >> Objet : Re: why we use static before a function what is the significance
> of it
> >>
> >> It means that this function can only be accesses from the same source...
> >> this is good programming behavior so you functions are kept "private"
> from
> >> other sources.
> >>
> >> R.
> >>
> >> ----- Original Message -----
> >> From: Gaurav Palvia <[EMAIL PROTECTED]>
> >> To: palm-dev-forum <[EMAIL PROTECTED]>
> >> Sent: Friday, January 07, 2000 12:36 PM
> >> Subject: why we use static before a function what is the significance of
> it
> >>
> >>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> 
> 
> 
> 

Reply via email to