<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
yes I'm reading it, and making some progress.<br>
I have a program that can read a file and display the contents to screen.<br>
<br>
this is going to be quite a learning curve. but fun!<br>
<br>
thanks guys!<br>
<br>
Dan.<br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Simh <simh-bounces@trailing-edge.com> on behalf of Johnny Billquist <bqt@softjar.se><br>
<b>Sent:</b> February 8, 2018 5:33 PM<br>
<b>To:</b> simh@trailing-edge.com<br>
<b>Subject:</b> Re: [Simh] anyone know how to convert/translate turbo pascal to vax pascal?</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Like I said, you cannot just replace "assign" with "open". The number,
<br>
types, and exact arguments are not the same between assign in <br>
Turbo-Pascal and open in VMS Pascal. You need to read the manual!<br>
<br>
   Johnny<br>
<br>
On 2018-02-08 21:18, Dan Gahlinger wrote:<br>
> So I tried this but the output file is empty. first.txt contains "text' <br>
> and second.txt contains "not test":<br>
> <br>
> Program fcomp(input,output);<br>
> var<br>
>    f, g, h : text;<br>
>    s, t, u : varying [255] of char;<br>
>    c, d : char;<br>
>    i : integer;<br>
> begin<br>
>    s := 'first.txt';<br>
>    t := 'second.txt';<br>
>    u := 'output.txt';<br>
>    i := 0;<br>
>    open(f,s,old);<br>
>    open(g,t,old);<br>
>    open(h,u,new);<br>
>    while (not(eof(f))) do<br>
>      begin<br>
>        read(f,c);<br>
>        read(g,d);<br>
>        i := i + 1;<br>
>        if (c <> d) then<br>
>          writeln(h,i,' = 1:[',c,']/',ord(c),' 2:[',d,']/',ord(d));<br>
>      end;<br>
>    close(f);<br>
>    close(g);<br>
>    close(h);<br>
> end.<br>
> <br>
> ------------------------------------------------------------------------<br>
> *From:* Clem Cole <clemc@ccc.com><br>
> *Sent:* February 8, 2018 12:44 PM<br>
> *To:* Dan Gahlinger<br>
> *Cc:* Gary Lee Phillips; Tim Shoppa; simh@trailing-edge.com<br>
> *Subject:* Re: [Simh] anyone know how to convert/translate turbo pascal <br>
> to vax pascal?<br>
> Yup - traditional Pascal (lack of) portability due to the report having <br>
> been silent.   Associating files with file descriptors could never be <br>
> agreed so ISO never defined how to do.  Every OS does it differently.  <br>
> Since Wirth was silent on it, if they picked one scheme over another the <br>
> Pascal committee was favoring that implementation [Kernighan may have <br>
> even pointed this out in his paper they wrote after writing the software <br>
> tools in Pascal - Why Pascal is Not My Favorite Programming Language <br>
> <<a href="http://wiki.lazarus.freepascal.org/Why_Pascal_is_Not_My_Favorite_Programming_Language> ">http://wiki.lazarus.freepascal.org/Why_Pascal_is_Not_My_Favorite_Programming_Language> </a>].**<br>
> <br>
> Go google the two document I mentioned previously and it should be a <br>
> fairly simply change.  Look up file I/O and then read how VMS <br>
> implemented the association of  name.<br>
> <br>
> I'm now going by memory, but a number of Pascal's did that in the <br>
> reset() function.   A number created a new function as Turbo did <br>
> (assign() in this case, but I think open() was used by a couple of other <br>
> Pascals. I think a couple of other pass it in via the Program function <br>
> and style other that supported separate libraries (usually called units) <br>
> did it other ways still.<br>
> <br>
> For grins, in the late 1970s at an HP/Tektronix  'Hatfield/McCoy' style <br>
> party - in those days HP in particular was Basic happy and Tek was <br>
> mostly Pascal.   We counted over 25 different incompatible 'HP Basic' <br>
> implementations, and over 10 different Tek Pascals.<br>
> <br>
> These are just the sorts of things you need the Turbo Pascal manual in <br>
> one had if that is were you are coming from and in this case the VMS <br>
> Pascal manual in the other.  Look up assign() in the first and the read <br>
> how perform the same action in the other.<br>
> <br>
> Good Luck,<br>
> Clem<br>
> <br>
> ** IMHO: This is a good example of where C 'beat' Pascal - the I/O was <br>
> defined by UNIX and when it came time to create a standard, C mostly <br>
> kept the UNIX semantics and was able to keep many/most of the OS-ism <br>
> from other systems out.<br>
> ᐧ<br>
> <br>
> On Thu, Feb 8, 2018 at 12:21 PM, Dan Gahlinger <dgahling@hotmail.com <br>
> <<a href="mailto:dgahling@hotmail.com">mailto:dgahling@hotmail.com</a>>> wrote:<br>
> <br>
>     so here you go, a simple file compare I wrote using "freepascal"<br>
>     (freepascal.org <<a href="http://freepascal.org">http://freepascal.org</a>>) and I've done what I can to<br>
>     convert it to vms pascal<br>
>     but it doesn't compile.<br>
> <br>
>     code:<br>
>     Program fcomp(input,output);<br>
>     var<br>
>        f, g, h : text;<br>
>        s, t, u : varying [255] of char;<br>
>        c, d : char;<br>
>        i : integer;<br>
>     begin<br>
>        s := 'first.txt';<br>
>        t := 'second.txt';<br>
>        u := 'output.txt';<br>
>        i := 0;<br>
>        assign(f,s);<br>
>        reset(f);<br>
>        assign(g,t);<br>
>        reset(g);<br>
>        assign(h,u);<br>
>        rewrite(h);<br>
>        while (not(eof(f))) do<br>
>          begin<br>
>            read(f,c);<br>
>            read(g,d);<br>
>            i := i + 1;<br>
>            if (c <> d) then<br>
>              writeln(h,i,' = 1:[',c,']/',ord(c),' 2:[',d,']/',ord(d));<br>
>          end;<br>
>        close(f);<br>
>        close(g);<br>
>        close(h);<br>
>     end.<br>
> <br>
>     errors:<br>
>       pas fcomp.pas<br>
>     00016      0  1   assign(f,s);<br>
>                        1<br>
>     %PASCAL-E-UNDECLID, (1) Undeclared identifier ASSIGN<br>
>     at line number 16 in file DUA1:[DAN]FCOMP.PAS;4<br>
>     %PASCAL-E-ENDDIAGS, PASCAL completed with 1 diagnostic<br>
> <br>
>     ------------------------------------------------------------------------<br>
>     *From:* Clem Cole <clemc@ccc.com <<a href="mailto:clemc@ccc.com">mailto:clemc@ccc.com</a>>><br>
>     *Sent:* February 8, 2018 10:58 AM<br>
>     *To:* Dan Gahlinger<br>
>     *Cc:* Gary Lee Phillips; Tim Shoppa; simh@trailing-edge.com<br>
>     <<a href="mailto:simh@trailing-edge.com">mailto:simh@trailing-edge.com</a>><br>
>     *Subject:* Re: [Simh] anyone know how to convert/translate turbo<br>
>     pascal to vax pascal?<br>
>     Dan,<br>
> <br>
>     As others have said something smells wrong here.  It's true the<br>
>     original '71 report from Wirth did not defined I/O and '72 revised<br>
>     report only defined write.  By the time of the Jensen & Wirth book<br>
>     from Springer-Verlag in the mid-late '70s writeln is there.  And by<br>
>     the time of the first standard efforts @ IEEE and ANSI it very much<br>
>     in the language. I do have an old copy ANSI/IEEE770X3.97-1983<br>
>     "American National Standard Pascal Computer Programming Language"<br>
>     which on page 93 (Section 6.9.3) defines the required standard<br>
>     Pascal function writeln:<br>
> <br>
>         *6.9.4 The Procedure Writeln.*<br>
> <br>
>             The syntax of the parameter list of writeln shall be:<br>
> <br>
>                 writeln-parameter-list = [ "(" ( file-variable |<br>
>                 write-parameter )<br>
>                                                | "," write-parameter |<br>
>                 ")" ] .<br>
> <br>
>             *Writeln*shall only be applied to textfiles. If the<br>
>             file-variable or the writeln-parameter-list is omitted, the<br>
>             procedure shall be applied to the required textfile output.<br>
> <br>
> <br>
>      From a quick search on the HP web site<br>
>     (<a href=""></a>http://h41379.www4.hpe.com/commercial/pascal/pascal_index.html<br>
>     <<a href="http://h41379.www4.hpe.com/commercial/pascal/pascal_index.html">http://h41379.www4.hpe.com/commercial/pascal/pascal_index.html</a>> )I<br>
>     found reference to the SPD and the site says: :<br>
> <br>
>         HP Pascal (formerly known as Compaq Pascal and DEC Pascal) runs<br>
>         on OpenVMS for VAX systems, OpenVMS for AlphaServer systems, and<br>
>         OpenVMS for Integrity servers. With HP Pascal, your source code<br>
>         investment is not only protected, it is extended.<br>
> <br>
>         HP Pascal supports code compatible with either level of the ISO<br>
>         specification, meets Federal Information Processing Standard<br>
>         Publications (FIPS-109) requirements, and supports many features<br>
>         from the Extended Pascal Standard. HP Pascal has a solid<br>
>         reputation as a robust, production-quality, high-performance<br>
>         compiler. It is a full compiler, not an interpretive one.<br>
>         Tightly integrated wit<br>
> <br>
>     While I do not have FIPS 109 on my system, FIPS was based on<br>
>     ANSI/IEEE770X3.97, and I do have a copy of the an old DEC pascal<br>
>     manual so I'm 100% sure writeln is there.  I also believe that Turbo<br>
>     Pascal was developed after the ANSI/IEEE770X3.97 was published so<br>
>     the Turbo extension to writeln and any VMS ones should be able to<br>
>     puzzled out.<br>
> <br>
>     Here is a pointer to Pascal for OpenVMS - User Manual Order Number:<br>
>     AA-PXSND-TK<br>
>     <<a href="https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c04619822">https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c04619822</a>>
<br>
>       This may give you hints.<br>
> <br>
>     That said, I have a PDF of the VMS Pascal Reference, but lord knows<br>
>     where it came from; probably my time at DEC.   I have to believe its<br>
>     on bitsavers or the like.   But when I look on page 9-67, Section<br>
>     9.8.26 defines the WRITELN procedure as defined in the standard with<br>
>     the one DEC extension of supporting that last optional parameter to<br>
>     be: [,ERROR := error-recovery] where error-recovery  is defined as<br>
>     the action to be taken when an error occurs.<br>
> <br>
>       As other have said maybe its something silly from file format<br>
>     conversion like <CR><LF> processing as VMS record oriented I/O is<br>
>     different than DOS/Windows. But I suspect you are running into a<br>
>     difference in how I/O is declared and bound to files on the disk. <br>
>       My experience with a number of different Pascal compilers 'back in<br>
>     the day' was this was an area for wide variation.   This is what I<br>
>     would look up in the HP/Compaq/DEC user manuals I just pointed you<br>
>     too.  I suspect that the 'VMS Pascal Language' manual should help<br>
>     you through the DEC variant, so google is your friend to try find a<br>
>     PDF.  With that open and a Turbo Pascal manual I think you'll be<br>
>     fine (and if you cannot find a Turbo manual, I have to believe the<br>
>     freepascal.org <<a href="http://freepascal.org">http://freepascal.org</a>> docs will get you a long way<br>
>     since they claim to be 100% Turbo Pascal and Delphi compatible).<br>
> <br>
>     BTW:  One other though/place where Pascal I/O can differ is<br>
>     character sets, although I don't think it a problem because PCs and<br>
>     Vaxen never had this issue, if you read any the reports or "Jensen<br>
>     and Wirth" you will notice that Pascal was defined for a 6-bit byte<br>
>     on a CDC-6600 system (SCOPE was the OS IIRC).    As I have said<br>
>     elsewhere, a 6-bit character was not unusual on earlier systems -><br>
>     today, we can thank Fred Brooks for the 8-bit byte (Gene Amdahl<br>
>     wanted it to be 6 bits but Brooks kicked him out of his office until<br>
>     he had something that could easily be handled by SW - /i.e/. a power<br>
>     of 2, which Amdahl thought was wasteful for the HW).<br>
> <br>
>     Anyway, characters can be an issue when moving Pascal code because<br>
>     original Pascal was defined with some CDC isms and in those days,<br>
>     CDC had as number of different character sets. I note that if look<br>
>     at the ANSI standard you'll noted the definition of all identifiers<br>
>     is just the lower case [english] chars a-zfor letters, the<br>
>     traditional digits 0-9and very limited number of special-symbols ( +<br>
>     - * / = < > [ ] . , : ' | ( ) ).  They do say:<br>
> <br>
>         The representation of any letter (upper-case or lower-case,<br>
>         differences of font, /etc/.) occurring anywhere outside of a<br>
>         character-string (see 6.1.7) shall be insignificant in that<br>
>         occurrence to the meaning of the program.<br>
> <br>
>     Because of the '6-bit ness' of some systems, the standard even<br>
>     provides for alternative tokens to do things like square braces to<br>
>     (.and .)or vertical bar to @[and I think may allow ^to be used for<br>
>     same IIRC].<br>
> <br>
>     Also remember that DEC manuals tended to show the identifiers in<br>
>     upper case (go figure).  And since both Vaxen and Intel processors<br>
>     (/i.e. /VMS Pascal and Turbo Pascal) support at least 7-bit ASCII<br>
>     fitting into an 8 bit character, and DEC added support for other<br>
>     special symbols such as dollar $, but I have to believe the problem<br>
>     is not in character set.<br>
> <br>
>     Best wishes,<br>
>     Clem<br>
> <br>
>     ᐧ<br>
> <br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> Simh mailing list<br>
> Simh@trailing-edge.com<br>
> <a href="http://mailman.trailing-edge.com/mailman/listinfo/simh">http://mailman.trailing-edge.com/mailman/listinfo/simh</a><br>
> <br>
<br>
-- <br>
Johnny Billquist                  || "I'm on a bus<br>
                                   ||  on a psychedelic trip<br>
email: bqt@softjar.se             ||  Reading murder books<br>
pdp is alive!                     ||  tryin' to stay hip" - B. Idol<br>
_______________________________________________<br>
Simh mailing list<br>
Simh@trailing-edge.com<br>
<a href="http://mailman.trailing-edge.com/mailman/listinfo/simh">http://mailman.trailing-edge.com/mailman/listinfo/simh</a></div>
</span></font></div>
</body>
</html>