Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ucbvax.ARPA Path: utzoo!watmath!clyde!cbosgd!ulysses!ucbvax!info-vax From: info-vax@ucbvax.ARPA Newsgroups: fa.info-vax Subject: VMS PASCAL question Message-ID: <5073@ucbvax.ARPA> Date: Mon, 25-Feb-85 15:03:48 EST Article-I.D.: ucbvax.5073 Posted: Mon Feb 25 15:03:48 1985 Date-Received: Wed, 27-Feb-85 06:57:33 EST Sender: daemon@ucbvax.ARPA Organization: University of California at Berkeley Lines: 35 From: John_Aronsson_QZ%QZCOM.MAILNET@MIT-MULTICS.ARPA VARYING OF CHAR is a predeclared record type in VMS-PASCAL. Syntax: VARYING [upper-bound] OF [attribute-list] CHAR upper-bound is an integer in the range from 1 throgh 65535 that indicates the length of the longest possible string. VARYING [upper-bound] OF CHAR may be thought of as the record type: RECORD LENGTH : [WORD] 0..upper-bound; BODY : PACKED ARRAY [1..upperbound] OF CHAR; END; LENGTH and BODY are predeclared fields in VMS-PASCAL. Example: VAR st : VARYING [80] OF CHAR; BEGIN st := 'FOO'; Writeln(st.length); (* write 3 *) st := 'BLETCH'; Writeln(st.length); (* write 6 *) Writeln(st); (* This will just write the 6 characters 'BLETCH' *) Writeln(st.body) (* But this will write 80 characters. Mostly junk. *) END.