[futurebasic] Re: [FB] Dimming vars

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 1999 : Group Archive : Group : All Groups

From: tedd <tedd@...>
Date: Mon, 2 Aug 1999 21:58:39 -0400
>>In this format we pass the address of a string explicitly, instead of the
>>string itself (actually FB passes addresses anyways but now we have more
>>control over what is being done).
>
>I don't understand why we would want to pass the address rather than the
>string itself.
>
>Jim Mumaugh
>jamesm98@...


Jim:

If the receiving FN just uses the string the calling FN gives, then you
wouldn't need the pointer. However, if the receiving FN is supposed to
change the variable, then passing it's pointer makes sense.

For example, if FN A send FN B a string such as "tedd", and FN B is just
supposed to print it, then passing the string (or pointer) is fine.
However, if the receiving FN is supposed to change the contents of the
string to "tedd's", then sending its pointer makes sense. If you tried to
do this as by just sending a string, then you would have to have FN B
return an altered string.

tedd

___________________________________________________________________
<mailto:tedd@...>	               http://sperling.com/