[futurebasic] RE: [FB] Living in other DIMmensions

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

From: Chris.Young@...
Date: Wed, 24 Nov 1999 12:12:34 -0600
Russ,

POKE requires an address to poke the data into. Try:

DIM myHandle&
DIM Var1;1
DIM Var2;1
POKE WORD myHandle&, @Var1

This will place Var1 and Var2 in the first two bytes of myHandle&. 
Note, if you were actually using a handle (obtained from the toolbox 
NewHandle), then you would need to POKE the data into the memory block 
pointed to indirectly by myHandle&, as in:

DIM myHandle&
DIM Var1;1
DIM Var2;1

myHandle& = FN NEWHANDLE(_howBig)
OSErr = FN HLOCK(myHandle&)
POKE WORD [myHandle&]+offset, @Var1

Or something similar. hth

Chris Young


On Wednesday, November 24, 1999 11:00 AM, russp@... 
[SMTP:russp@...] wrote:
> OK, here's another dimmension question:
> 
> I need to combine 2 bytes and POKE them into a handle.
> 
> What I wanted to do was DIM them sequentially and then POKE WORD them
> into the handle together. (seemed like a nice way to take advantage of
> multiple byte handling by the processor)
> 
> I've tried the following:
> 
> DIM Var1;1
> DIM Var2;1
> POKE WORD Var1
> 
> DIM MasterVar.0
> DIM Var1;1
> DIM Var2;1
> POKE WORD MasterVar
> 
> DIM MasterVar;0
> DIM Var1;1
> DIM Var2;1
> POKE WORD MasterVar
> 
> DIM MasterVar.0;2
> DIM Var1;1
> DIM Var2;1
> POKE WORD MasterVar
> 
> None of these work.  Rather than fiddling with POKEing anymore, I
> settled down to just trying TestVar=MasterVar and still nothing 
(TestVar
> always =0).
> 
> I've gotten a work around by...
> 
> DIM MasterVar
> DIM Var1;1
> DIM Var2;1
> -Set up Vars-
> MasterVar= (Var1<<8) + Var2
> POKE WORD MasterVar
> 
> but this seems kind of clumsy (besides adding 2 math operations) and 
it
> seems like the previous should work.  Am I doing something wrong here?
> 
> Thanks
> 
> rp
> 
> --
> To unsubscribe, send ANY message to 
<futurebasic-unsubscribe@...>
> 
>  << File: [FB] Living in other DIMmensions.TXT >>