[futurebasic] Re: [FB] Re: Reoccuring Bug

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

From: Rick Brown <rbrown@...>
Date: Mon, 14 Jun 1999 18:23:15 -0500

TJ Grant wrote:

> >Both times, it was in line 287, so I could narrow it down to the a TCP/IP
> >function:
> >LOCAL FN TCPSendData%(stream&, dataPtr&, length%, retry%)
> >  LONG IF length% > 0
> >    myWDS.wdsLength%(0) = length%    'This is line 287
> ><snip>
> >
> Ok- well in FB2, records and arrays don't mix. You just can't do it.
> You could work around it by making a pointer the size of two records, and
> writing accessor routines to look into them/write them. This is actually
> covered in the FB2 manual- however, I don't recall a page number or
> chapter.
> I'm kinda surprised it compiles at all. I thought FB2 did checks for
> array/record conflicts.

Records and arrays _do_ mix, in some ways.  FB2 allows arrays of records, but
it doesn't allow a record to contain an array.  An expression like this:


assumes that "myWDS" is an array of records, that was DIM'ed something like

  DIM myWDS.recSize(_maxRecords)

The expression "myWDS.wdsLength%(0)" then refers to the "wdsLength%" element
in record #0 of the myWDS array.

- Rick