[futurebasic] Re: [FB] XREF vs Growing your own

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

From: Jay Reeve <jktr@...>
Date: Thu, 26 Nov 98 22:19:35 -0600
>I don't think you can even XREF record variables anyway, just shorts and 
>longs.
>
>____________
>wave (Toronto, Canada)
>
Nope. Please see my XREF@ Arrays Demo which uses _only- records. 

You set it up exactly the same way you would set up a standard array of 
records--just replace DIM with XREF@ and provide the handle.
  DIM myRGBArray&
  XREF@ myRGBArray.6(99)

Put a handle into myRGBArray& and use the array just as if you had written
  DIM myRGBArray.6(99)

Then, if you like, you can also set it up to address the individual 
values:
  DIM myRandGandBArray&
  XREF@ myRandGandBArray%(99,2)

If you put the same handle into both myRGBArray& and myRandGandBArray&, 
you can address the _same_ set of values either way you choose--as color 
records, or as R%, G%, and B% values:

  myRandGandBArray%(9,0) = 27397   'Red
  myRandGandBArray%(9,1) = 18452   'Green
  myRandGandBArray%(9,2) = 29124   'Blue

  colorRecord2Use = myRGBArray&(9)

Now colorRecord2Use (a 6-byte record var) containes the RGB you just 
defined (providing you gave both arrrays the same handle, of course).

 0"0
 =J= a  y
  "