Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!iuvax!bsu-cs!cfchiesa From: cfchiesa@bsu-cs.UUCP (Christopher Chiesa) Newsgroups: comp.os.vms Subject: Re: pascal strings Message-ID: <2834@bsu-cs.UUCP> Date: 2 May 88 19:07:03 GMT References: <8805021136.AA05274@decwrl.dec.com> Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 50 Summary: LENGTH doesn't quite do what you want... In article <8805021136.AA05274@decwrl.dec.com>, pfister_rob@rangly.dec.com (full moon today) writes: > > decwrl!labrea!rutgers!elbereth.rutgers.edu!elkins writes > > >Is there a way in VAX Pascal to define a procedure that will take > >a variable length quoted string as a parameter? > [examples of goal, avoided methods, and solution deleted; you've all probably seen it five times by now... besides there's that line counter] > TYPE > STRING=VARYING[255] OF CHAR; > . > . > . > VAR > bar:STRING:='blah blah blah'; > > PROCEDURE foo(line:STRING); > . > . > . > v=LENGTH(line); (* if I wanna know the length of the string...*) > . > . > . > > Is this what you mean? I just wanted to point out that in this context, the Vax Pascal LENGTH function does NOT return the contents of the varying_string ".length" field. It returns the DECLARED SIZE of the particular variable, in this case the value 255, re- gardless of the number of "valid characters" actually in the string. [line counters must die] -- UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!cfchiesa cfchiesa@bsu-cs.UUCP