Thread View: net.lang.pascal
1 messages
1 total messages
Started by Douglas J Freyburger
Fri, 27 Sep 1985 22:29
VMS to BSD Pascal port: thanks
Author: Douglas J Freyburger
Date: Fri, 27 Sep 1985 22:29
Date: Fri, 27 Sep 1985 22:29
65 lines
3214 bytes
3214 bytes
About a month ago, I posted a question about porting Pascal from VMS to a VAX running BSD 4.2. I was having problems with open/rewrite()ing files and with separate compilation. I would like to thank all of the people who offered suggestions. Most of them worked, and my program set is now on BSD and running fine. The rest of this message is a review of the differences in file opening and separate compilation. 1) For file "output", Unix defaults to it open. A rewrite will cause your output to go to a wierdly named file. On VMS, the rewrite just restarts output to the terminal again (useful to clear possible error bits). Comment out a rewrite() from VMS to Unix, add one from Unix to VMS. 2) For files other than "output", VMS seems to be more forgiving about forgetting to open them somehow. I'm not sure exactly what the difference was, though. 3) For separate compilation, Unix uses a syntax very similar to the "forward" keyword in Jensen-Wirth, but in the modules, there is no "program" statement or anything like that. Instead of "forward", use "external", and put those declarations in an include file. VMS builds a module very similarly to a program, but the new keyword "MODULE" is used in place of "program". Also, where the "begin top-level-code end." would be in a program there is an "end;". The "forward" syntax is NOT required. From Unix to VMS, add the "module foo(input...);" to the front, the "end;" to the end, and change all of your "external"s to "forward"s. From VMS to Unix, you have to make sure that ALL of your routines are declared with "forward" first, then cut off the "module..." and "end;", change the "forward"s to "external"s, and cut them out into an include file. 4) Other changes: To Unix, flush the case to lower and remove "_" and "$" from all names. To VMS, probably change rewrite()s to complicated open()s that look like ForTran open statements. Doug Freyburger DOUG@JPL-VLSI, DOUG@JPL-ROBOTICS, JPL 171-235 ...escher!doug, doug@aerospace, Pasadena, CA 91109 etc. Disclaimer: The opinions expressed above are far too ridiculous to be associated with my employer. Unix is a trademark of Bell Labs, VMS is a trade mark of DEC, and there are others that I'm probably forgeting to mention. -- Doug Freyburger DOUG@JPL-VLSI, DOUG@JPL-ROBOTICS, JPL 171-235 ...escher!doug, doug@aerospace, Pasadena, CA 91109 etc. Disclaimer: The opinions expressed above are far too ridiculous to be associated with my employer. Unix is a trademark of Bell Labs, VMS is a trade mark of DEC, and there are others that I'm probably forgeting to mention.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads