swarm-support
[Top][All Lists]
Advanced

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

Re: Problems with createActionTo and arg types...


From: bleydorf
Subject: Re: Problems with createActionTo and arg types...
Date: Wed, 27 Aug 1997 00:39:15 -0400

Alex Lancaster wrote:
> 
> Dear Swarm folks,
> 
> I am trying to create a dynamic schedule using a createActionTo message.
> 
> The Swarm interface guide says that when creating an action to with one or
> more arguments, the argument needs to be cast to the Objective C id type,
> to whit:
> 
> [createActionTo: neurone message: M(receivePulse:) : (id) pulseAmplitude]
> 
> This seems fine if the type of the argument (i.e. pulseAmplitude in the
> above e.g.) is an integer. But gcc won't allow compilation if the argument
> is a float, with an error message to the effect "can't cast that arg to a
> pointer". (I can send the exact code and error message if necessary).
> 
> Is this a known problem? If so, are there any workarounds? I really need my
> arguments to be floats, as integers are far too coarse to represent the
> variables in my model.
> 
> Any ideas?

This might be a stupid suggestion, but what if you divided up the float
into the mantissa and the exponent, and store both of these as integers
(or long integers) and then pass them into the method as integers cast
to ids, and then inside the method "reconvert" them back to floats?
I know theres got to be a simplier way....

Brad.

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of 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]