[net.lang] readf, writef

guadagna@daemen.uucp (Dale K9 Guadagna) (03/18/86)

I am currently learning Modula-2 on the VAX and it doesn't have the 
WriteString, ReadString, WriteCard, ReadCard, etc, functions, instead it 
uses Readf and Writef. The system documentation doesn't include the syntax
for Readf and Writef. Could someone out there shed some light on the subject?
Much appreciated.
-- 
          		Dale K-9 Guadagna
UUCP :{decvax/dual/rocksanne/watmath/rocksvax}!sunybcs!daemen!guadagna
Doctor Who quote: "Doctor, sometimes I think your not quite right in the head."
Cartoon Quote: "OOPPS. I DISTINCTLY HEARD AN OOOPPS"  -Opus

hand@ncsu.UUCP (Steven Hand) (03/26/86)

>I am currently learning Modula-2 on the VAX and it doesn't have the 
>WriteString, ReadString, WriteCard, ReadCard, etc, functions, instead it 
>uses Readf and Writef. The system documentation doesn't include the syntax
>for Readf and Writef. Could someone out there shed some light on the subject?

I think Readf and Writef correspond to scanf and printf in C and have
similar syntax.

Has anyone written a standard input/output module for this compiler? (it is
the "Powell" research compiler for UNIX distributed by DEC for a nominal fee.)

BTW, I would like to see a lot of Modula-2 software posted to the net.
Class projects, custom modules, anything like that would be great!

broman@noscvax.UUCP (Vincent P. Broman) (03/27/86)

I haven't seen a standard library implemented for powell's compiler,
though I hacked together an approximation to InOut in an hour.
Harder question is: has anyone seen a STANDARD library?

vincent broman, code 632,  naval ocean systems center, san diego, ca 92152, usa
phone: +1 619 225 2365     starship: 32d 42m 22s n/ 117d 14m 13s w
arpa: broman@bugs.nosc.mil uucp: {sdcsvax,gould9,bonnie,hp-sdd}!noscvax!broman

barad@brand.UUCP (Herb Barad) (03/27/86)

In article <3065@ncsu.UUCP> hand@ncsu.UUCP (Steven Hand) writes:
>
>>I am currently learning Modula-2 on the VAX and it doesn't have the 
>>WriteString, ReadString, WriteCard, ReadCard, etc, functions, instead it 
>>uses Readf and Writef. The system documentation doesn't include the syntax
>>for Readf and Writef. Could someone out there shed some light on the subject?
>
>I think Readf and Writef correspond to scanf and printf in C and have
>similar syntax.
>
>Has anyone written a standard input/output module for this compiler? (it is
>the "Powell" research compiler for UNIX distributed by DEC for a nominal fee.)
>
>BTW, I would like to see a lot of Modula-2 software posted to the net.
>Class projects, custom modules, anything like that would be great!

I have been using the DECWRL ("Powell") compiler for some time now.  I
don't know if I have the most up to date version here (USC), but I
have been running into many problems with it.

First of all, Readf and Writef do correspond to printf and scanf.
Note that you have to use a certain switch (I forget which one
offhand) to allow for special characters.  That is, with the switch
set one way, Writef(output, "Hello\n") will print out Hello with a
newline, and with the switch set the other way, it will print out
"Hello\n" (as I have found out).

About the compiler, I have been finding many bugs.  Some I have
reported to decwrl, but I have never received a response.  One
tradgedy was when I decided to change the stucture (completely) of a
module that I had written.  I drastically altered the number of
parameters passed for all of the procedures in that module.  I then
compiled that module - fine.  Then I went to lunch.  After coming back
from lunch, I forget to re-compile the module that calls those
procedures that I had changed.  I linked all the object files - it
LINKED!!!  You see, it uses the normal unix linker - no checking of
versions of object code.

Several other problems have been occurring.  I cannot list them all
here, but I will tell you that I have been devloping code on a Mac
using the MacModula compiler (a very good one for a no-so-powerful
machine) and then porting it to the vax (just write a few machine
dependent modules to handle i/o and system calls).  At least the
MacModula adheres to Wirth's guidelines.  You cannot disable all of
the DEC extensions (supposedly you can using certain switches, but the
compiler bombs when all switches are applied).  Well...........



-- 
Herb Barad	[USC - Signal and Image Processing Institute]

USENET:

...!sdcrdcf!usc-oberon!brand!barad			or
...!{lbl-csam|trwrb|trwspp}!trwspf!herb			or
...!{lbl-csam|trwrb|trwspp}!trwspf!brand!barad

ARPANET:	barad%brand@usc-ecl.ARPA