[comp.lang.pascal] Unix pascal.

chernesk@ucunx1.san.uc.edu (Chris Chernesky) (04/18/91)

Hey all! Just wondering if you know the Unix Pascal equivilent of Turbo
Pascal's "assign". I would consult a manual, but no one I know has one
and I'm not about to run out to the Univ. bookstore and get one for
$30-$40.
Any help will be greatly appreciated.

--

Chris Chernesky

	- chernesk@ucunix.san.uc.edu
	- ccherne@moe.eng.uc.edu
   	- chernesk@ucbeh.san.uc.edu

cs202216@umbc5.umbc.edu (cs202216) (04/18/91)

In article <1991Apr18.012315.26542@ucunx1.san.uc.edu> chernesk@ucunx1.san.uc.edu (Chris Chernesky) writes:
>Hey all! Just wondering if you know the Unix Pascal equivilent of Turbo
>Pascal's "assign". I would consult a manual, but no one I know has one
>and I'm not about to run out to the Univ. bookstore and get one for
>$30-$40.
>Any help will be greatly appreciated.
>
>--
>
>Chris Chernesky
>
>	- chernesk@ucunix.san.uc.edu
>	- ccherne@moe.eng.uc.edu
>   	- chernesk@ucbeh.san.uc.edu


	Unix pascal just uses the rewrite/reset procedures. Ex: 
	
		rewrite(infile,'indata.dat');
		reset(outfile,'outdata.dat');


Easy enough?
-- 
******************************************************************************
* Matt Gove                         *  Need any magnetic tape with one       *
* Internet: cs202216@umbc5.umbc.edu *  sticky side?                          *
******************************************************************************

ebergman@isis.cs.du.edu (Eric Bergman-Terrell) (04/18/91)

To open a file in TP you need to assign & then reset.  Most other Pascal
compilers don't require the assign, just the reset.  However you must 
specify the filename in the reset.

Terrell

fsbrn@BRL.MIL ( Ferd Brundick) (04/18/91)

Haah,

Berkeley Pascal does not have an assign command.  Instead you
associate the file name with the file pointer like this:

	reset(f,a)	where 'a' is a string causes the file whose
			name is 'a' to be associated with 'f' in
			addition to the normal function of reset
	rewrite(f,a)

                                        dsw, fferd
                                        Fred S. Brundick
                                        USABRL, APG, MD.
                                        <fsbrn@brl.mil>