Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!ncar!noao!arizona!robert From: robert@arizona.edu (Robert J. Drabek) Newsgroups: comp.os.vms Subject: Re: pascal strings Message-ID: <5350@megaron.arizona.edu> Date: 5 May 88 17:14:38 GMT References: <8805021136.AA05274@decwrl.dec.com> <2834@bsu-cs.UUCP> <2864@bsu-cs.UUCP> Organization: U of Arizona CS Dept, Tucson Lines: 52 Summary: test In article <2864@bsu-cs.UUCP>, cfchiesa@bsu-cs.UUCP (Christopher Chiesa) writes: > > That's a VERY GOOD question! Perhaps we have different versions or releases > of Vax Pascal? Although I would think the operation of the LENGTH function > would not change... > All I can say is that I *always* have to write my OWN "string length" function > when I want to work with type VARYING OF CHAR in Vax Pascal... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I tried the following under version 3.6 of VMS Pascal. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - program s(input, output); type string = varying[36] of char; procedure stest(str : string); begin writeln(output, 'The string is <', str, '>' ); writeln(output, ' its length is ', length(str):1) end; { stest } var s1 : string; begin { main } stest('Hello'); { a literal test } s1 := 'Good bye'; { a variable test } stest(s1) end. { main } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The output was: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The string is its length is 5 The string is its length is 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- Robert J. Drabek Department of Computer Science University of Arizona Tucson, AZ 85721