swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: replacing objc method with c function; ivars inside function no good


From: W. Simmons
Subject: Re: replacing objc method with c function; ivars inside function no good...
Date: Tue, 3 Apr 2001 06:40:39 -0700 (PDT)

--- Paul E Johnson <address@hidden> wrote:
  But two of the variables inside the method
> are important ivars
> that condition the next response to
> getMyUnsignedFunction().  So is the
> only correct response to pass-by-reference those
> IVARS into the
> function

Don't know if objective C has it, (or wait you're
using C right?) but you might also make them static
local variables. ie:  
void getMyIvar( void )
{ static int ivar1, ivar2;
//redeclare others
 int x,y,z;
 ...
}  
then initialize them at the global scope, outside the
function. ie:
ivar1 = 10;
ivar2 = 12;
void getMyIvar ( void ) ... etc.

Now these variables will hold their value between
calls to the function.  If I understand your question
this is another solution, I don't know which is
better. Hope this helps.
-Wayne Simmons

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/


                  ==================================
   Swarm-Modelling is for discussion of Simulation and Modelling techniques
   esp. using Swarm.  For list administration needs (esp. [un]subscribing),
   please send a message to <address@hidden> with "help" in the
   body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]