Re: AGT Version 1.83


Sun, 13 Aug 1995 16:12:18 -0600


On 11 Aug 1995, Joe Schlimgen wrote:

> The biggest problems I had to worry about were strings and arrays. Pascal can
> base arrays from [min..max] and C++ always bases them from 0 -- hence the
> PArray<class T, int min, int max> template. Strings were a bit trickier -- the
> ANSI string class works well, but I hade to work on the i/o to make it
> fixed-length (which Pascal appears to have -- more research is needed there,
> any answers from the vast and unpaid research dept?).

Pascal DOES NOT have fixed length strings, strings are kinda like arrays,
this is how it works:

var
whatever: string;

That's a string of 256 the maximum and standard length, howerver you can
always do this

type
string40: string[40];

var
whatever: string40;

That's a string of 40 characters. Strings can be anywhere from 1-256, if
no length is specified with the [ ] it's assumed to be 256

Strings also can be used as an array, for example if the string whatever
= 'Interactive Fiction' then whatever[3] = 't'

Nicholas Gorrell
nick@xmission.com