Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!orstcs!jacobs.CS.ORST.EDU!louxj From: louxj@jacobs.CS.ORST.EDU (John W. Loux) Newsgroups: comp.sys.hp Subject: Re: system() for pascal Keywords: system, pascal Message-ID: <11793@orstcs.CS.ORST.EDU> Date: 22 Jul 89 18:45:48 GMT References: <461@oetl1.oetl.UUCP> <4936@ucdavis.ucdavis.edu> Sender: usenet@orstcs.CS.ORST.EDU Reply-To: louxj@jacobs.CS.ORST.EDU.UUCP (John W. Loux) Organization: Solve and Integrate, Corp. - Corvallis Oregon Lines: 34 In article <4936@ucdavis.ucdavis.edu> lee@iris.ucdavis.edu (Peng Lee) writes: > Is there a function like the "system('ls')" in C for the >hpux pascal?? Yes. Since system is defined in /lib/libc.a (which is automatically linked at compile time), it is accessible in the following way: PROGRAM poop (INPUT, OUTPUT); CONST max_string_length = 255; TYPE strng = PACKED ARRAY[1..max_string_length] OF CHAR; PROCEDURE system(s:strng); EXTERNAL; BEGIN system('ll'#0); END. Note particularly the EXTERNAL declaration and that no other provisions are required to load the library. Note also the declaration of a C compatible string type and the addition of character 0 as the last character in the string before the C function is called. Good luck, John louxj@jacobs.cs.orst.edu