[futurebasic] Re: [FB] question about pointers [important]

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2000 : Group Archive : Group : All Groups

From: Robin <robinc@...>
Date: Wed, 26 Jul 2000 08:40:19 +1000
> Now, one last question which I had sort of skipped because I jumped to an
> assumption, but I had better make sure.  Would this:
> 
> LOCAL FN Caller
> DIM weapon as WeaponRec, aPointer as POINTER
> ...
> aPointer = FN WhatWeapon(2,@weapon)
> ...
> PRINT FN WhatText(2, aPointer); aPointer
> INPUT FN WhatText(2, -1); aPointer
> END FN
> 
> First print the value of Weapon.middle, then ask the user to put a new value
> to weapon.middle, and assign it to weapon.middle?  I just assumed that it
> would, but I should make sure.
> 
No, what you should do is:

> PRINT FN WhatText(2, aPointer); aPointer.nil%
> INPUT FN WhatText(2, -1); aPointer.nil%

(note: that is for integers. If the value was a long, you'd use
aPointer.nil&, if a single-precision real, use aPointer.nil! etc). I won't
comment on using INPUT instead of EDIT FIELD...

-- 
Robin
====================================================
Genesearch Pty Ltd
E-mail: robinc@...
WWW:    http://www.genesearch.com.au
====================================================