Xref: utzoo comp.os.vms:5866 comp.lang.pascal:851 Path: utzoo!mnetor!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.os.vms,comp.lang.pascal Subject: Re: Quoted string parameters in VAX Pascal? Message-ID: <3167@enea.se> Date: 30 Apr 88 22:17:33 GMT Organization: ENEA DATA AB, Sweden Lines: 30 George Elkins (elkins@elbereth.rutgers.edu) writes: >Is there a way in VAX Pascal to define a procedure that will take >a variable length quoted string as a parameter? >... > foo ('This is a string of any length'); {User-written procedure foo} Normally I should have used mail, but Christopher Chiesa messed things up in his article, so I take it officially if someone else got confused. The answer to your question is: Yes. Simple do as below: PROCEDURE Foo(Str : PACKED ARRAY(. Low..High : integer .) OF char); or if you prefer the varying strings Chiesa told you of: PROCEDURE Foo(Str : VARYING(. Len .) OF char); This is known as a conformant array. Low, High and Len are available as constants (actually I don't know whether you can modify them) in Foo. If your procedure takes more than one string parameter, be sure to use different names for the bounds (like Low1, Low2 etc), since your parameters are not likely to be of the same length. >Is this possible or conceivable in VAX Pascal? (I'll admit that I haven't >consulted the documentation. I don't have easy access to it.) Have you tried HELP PASCAL? I don't know exactly under which subtopic you should look to learn about conformant arrays and varying strings, but the PASCAL entry under HELP does give a condensed version of the manual, so the info you need should be there. -- Erland Sommarskog "No protection on a motor-bike, then ENEA Data, Stockholm Sooner or later, that normal traffic's gonna get you" sommar@enea.UUCP -- Peter Hammill