[futurebasic] Re: Increasing DIM without crashing

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

From: BMichael <BMichael@...>
Date: Tue, 7 Apr 1998 09:04:11 EDT
>DIM RECORD MTInfo
>  DIM 35 MTfontName$      'was 24
> 'Other stuff here
>  'etc
>DIM END RECORD.MTInfo
>
>DIM gMT.MTInfo
>
>I found it necessary to increase the DIM for fontName$
>(some fonts have horrendous long names).
>
>If I increase the size of fontName$, this locks up the computer when reading
>in old parameter files DIMMed for 24 char long fontnames.

If you can tell the "old" data files from the "new" ones, possibly by 
putting some additional info in the new ones (in the resource fork if you 
can't change the data fork) then you can do this;

DIM RECORD OldMTInfo
  DIM 24 OldMTfontName$
 'Other stuff here
  'etc
DIM END RECORD.OldMTInfo

DIM gOldMT.OldMTInfo

Then when you get an old data file, read it in using the "OldMTInfo" 
record structure; copy the data across to the new structure (one element 
at a time, unfortunately) and go from there. When you write it back out, 
it becomes a "new format" data file.

Bill