[futurebasic] Re: [FB] [FB^3] True records and handles

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

From: Jay Reeve <jktr@...>
Date: Wed, 20 Dec 00 10:35:58 -0600
Pete,

I realized after I sent off my suggestion, that you probably weren't 
looking for an array of TABrecDef's. If you want just the one record, I 
_think_ it would go like this:

begin record TABrecDef

dim TDcurrentTabElem%// Number of the tab elem currently selected

dim TDnbrOfTabs%// Max number of tabs is 10 (0 to 9)

dim 255 TDtabTitles$[10]// List of tab titles

dim TDtabTitleRect[10] as rect// List of tab title rects
end record

dim myTabs as handle to TABrecDef'Set up record handle
myTabs = fn newhandle(sizeof(TABrecDef))'Give it memory
'Access array fields directly:
myTabs.TDcurrentTabElem = 3
myTabs.TDnbrOfTabs = 5
for i = 1 to myTabs.TDnbrOfTabs
myTabs.TDtabTitles[i] = "TAB" + str$(i)
setRect(myTabs.TDtabTitleRect[i],20,5+20*i,32,25+20*i)
next

I've not used this configuration much (I usually use XREF@ arrays), so 
ask again if it doesn't work. If you want only the one record, though, 
why not just dim it instead of using a handle?
dim myTabRec as TABrecDef

 0"0
 =J= a  y
  "