• Coding examples (Re: VMS Pascal article)

    From David Meyer@21:1/5 to arne@vajhoej.dk on Sun Jan 5 13:19:12 2025
    Arne Vajhøj <arne@vajhoej.dk> writes:

    $ search sys$common:[syshlp.examples.pascal]*.pas varying
    $ search sys$common:[syshlp.examples.pascal]*.pas "string("

    Wow! That directory and the others around it are a real treasure
    trove. I found answers to questions I had about calling RTL routines
    from Pascal.

    Is there some introduction to VMS that collects links to resources like sys$common:[syshlp.examples] where VMS newbies can look to answer their
    own questions?

    --
    David Meyer
    Takarazuka, Japan
    papa@sdf.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Sun Jan 5 11:12:50 2025
    On 1/5/2025 11:06 AM, Arne Vajhøj wrote:
    On 1/4/2025 11:19 PM, David Meyer wrote:
    Arne Vajhøj <arne@vajhoej.dk> writes:
    $ search sys$common:[syshlp.examples.pascal]*.pas varying
    $ search sys$common:[syshlp.examples.pascal]*.pas "string("

    Wow! That directory and the others around it are a real treasure
    trove. I found answers to questions I had about calling RTL routines
    from Pascal.

    For system services and LIB$ (and other RTL) routines, then
    I recommend:

    General prep:
    1) browse through documentation for system services and LIB$
       routines to get an overview
    2) learn about the VMS calling convention
    3) learn about how to use VMS calling convention
       in your favorite programming language
    For specific task:
    A) identify the system services and LIB$ routine you need
       to use
    B) read the language independent description of how to call it
    C) implement call in your favorite programming language

    For specific questions then you can always ask here (or at
    the VSI forum).

    There is a fair chance that someone has tried it before and
    maybe even have an example laying around.

    I have written a few things that may be useful.

    From the article that is the topic:

    https://www.vajhoej.dk/arne/articles/vmspascal.html#proc_nonpas

    https://www.vajhoej.dk/arne/articles/vmspascal.html#mod (scroll
    down a page)

    Other:

    https://www.vajhoej.dk/arne/articles/call4.html#vms

    And Pascal examples in:

    https://www.vajhoej.dk/arne/articles/vmsipc.html

    https://www.vajhoej.dk/arne/articles/rms.html

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to David Meyer on Sun Jan 5 11:06:48 2025
    On 1/4/2025 11:19 PM, David Meyer wrote:
    Arne Vajhøj <arne@vajhoej.dk> writes:
    $ search sys$common:[syshlp.examples.pascal]*.pas varying
    $ search sys$common:[syshlp.examples.pascal]*.pas "string("

    Wow! That directory and the others around it are a real treasure
    trove. I found answers to questions I had about calling RTL routines
    from Pascal.

    For system services and LIB$ (and other RTL) routines, then
    I recommend:

    General prep:
    1) browse through documentation for system services and LIB$
    routines to get an overview
    2) learn about the VMS calling convention
    3) learn about how to use VMS calling convention
    in your favorite programming language
    For specific task:
    A) identify the system services and LIB$ routine you need
    to use
    B) read the language independent description of how to call it
    C) implement call in your favorite programming language

    System services:


    https://docs.vmssoftware.com/vsi-openvms-system-services-reference-manual-a-getuai/


    https://docs.vmssoftware.com/vsi-openvms-system-services-reference-manual-getutc-z/

    Deep dive in SYS$QIO(W):

    https://docs.vmssoftware.com/vsi-openvms-io-user-s-reference-manual/

    (the name give different associations than what it is)

    LIB$:

    https://docs.vmssoftware.com/vsi-openvms-rtl-library-lib-manual/

    SMG$:


    https://docs.vmssoftware.com/vsi-openvms-rtl-screen-management-smg-manual/

    Utility routines (do not forget these!!):

    https://docs.vmssoftware.com/vsi-openvms-utility-routines/

    Calling convention:

    https://docs.vmssoftware.com/vsi-openvms-calling-standard/

    General overview:


    https://docs.vmssoftware.com/vsi-openvms-programming-concepts-manual-volume-i/


    https://docs.vmssoftware.com/vsi-openvms-programming-concepts-manual-volume-ii/

    Is there some introduction to VMS that collects links to resources like sys$common:[syshlp.examples] where VMS newbies can look to answer their
    own questions?

    I link to some some stuff at:

    https://www.vajhoej.dk/arne/vms/docs.html

    https://www.vajhoej.dk/arne/vms/faq.html

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to David Meyer on Sun Jan 5 15:49:59 2025
    On 2025-01-05 04:19:12 +0000, David Meyer said:

    Arne Vajh°j <arne@vajhoej.dk> writes:

    $ search sys$common:[syshlp.examples.pascal]*.pas varying
    $ search sys$common:[syshlp.examples.pascal]*.pas "string("

    Wow! That directory and the others around it are a real treasure trove.

    While I haven't poked at the Pascal example code specifically (in the
    past couple of decades), unfortunately most of the other example source
    code examples included with OpenVMS itself also tended to be old, ill-maintained, insecure, and/or buggy.

    Various of the C code examples won't cleanly compile in recent decades,
    or uses older or outdated APIs.

    Decades ago, I tried to fix some of that mess, but other projects and
    other funding priorities interceded.

    I found answers to questions I had about calling RTL routines from Pascal.

    Pascal is the proverbial deep end of the OpenVMS calling standard and
    argument passing pool.

    Usual path for figuring out the more obscure parts of Pascal argument
    passing is the debugger, combined with the calling standard manual.

    Write some code to call Pascal to Pascal for whatever argument-passing
    you need, and use the debugger to reverse-engineer the descriptors used.

    Is there some introduction to VMS that collects links to resources like sys$common:[syshlp.examples] where VMS newbies can look to answer their
    own questions?

    Not that I've ever found. Most newbies don't do that. (And I write that
    as somebody that worked on the OpenVMS FAQ, a document which was posted
    here ~monthly in decades past.) You are, however, doing far better than
    many of the newbies over the decades, in that you're asking for these resources.

    https://www.digiater.nl/openvms/freeware/v80/vmsfaq/vmsfaq.txt (with
    other formats available)

    https://web.archive.org/web/20061105000841/http://seqaxp.bio.caltech.edu/www/vms_beginners_faq.html


    I can assure you that any such FAQ will also routinely be ignored too,
    as will be the posting archives for this newsgroup, among other
    resources.

    Suggested reading from the OpenVMS manuals: the Users Guide manual, the Programming Concepts manuals, and then either or both the OpenVMS
    System Manager's Manuals and/or the OpenVMS Pascal docs.

    In ancient times, what used to be the DEC "TIMA/STARS" support database
    were also part of the usual path. Directly, or via llong-gone access
    paths including the old AskQ site. VSI has a support database with
    source code examples as well, but AFAIK they don't have that accessible
    for non-contract customers.

    There are source code postings in the archive of this comp.os.vms
    newsgroup. Google Groups has a fast search of that, but recent years of
    the Google newsgroup archives are filled with dreck and spam. There are
    other less-searchable options including https://www.usenetarchives.com

    https://www.digiater.nl/openvms/freeware/ (OpenVMS Freeware)

    https://www.digiater.nl/openvms/decus/ (DECUS library)

    https://www.eight-cubed.com/examples.shtml (C examples)

    https://decuserve.org (resource info, "free shell" access to DCL on
    OpenVMS Alpha, decades of DEC Notes conferences)




    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marc Van Dyck@21:1/5 to All on Mon Jan 6 10:50:55 2025
    Stephen Hoffman formulated on Sunday :
    On 2025-01-05 04:19:12 +0000, David Meyer said:

    Arne Vajh°j <arne@vajhoej.dk> writes:

    $ search sys$common:[syshlp.examples.pascal]*.pas varying
    $ search sys$common:[syshlp.examples.pascal]*.pas "string("

    Wow! That directory and the others around it are a real treasure trove.

    While I haven't poked at the Pascal example code specifically (in the past couple of decades), unfortunately most of the other example source code examples included with OpenVMS itself also tended to be old, ill-maintained, insecure, and/or buggy.

    Various of the C code examples won't cleanly compile in recent decades, or uses older or outdated APIs.

    Decades ago, I tried to fix some of that mess, but other projects and other funding priorities interceded.

    I found answers to questions I had about calling RTL routines from Pascal.

    Pascal is the proverbial deep end of the OpenVMS calling standard and argument passing pool.

    Usual path for figuring out the more obscure parts of Pascal argument passing is the debugger, combined with the calling standard manual.

    Write some code to call Pascal to Pascal for whatever argument-passing you need, and use the debugger to reverse-engineer the descriptors used.

    Is there some introduction to VMS that collects links to resources like
    sys$common:[syshlp.examples] where VMS newbies can look to answer their own >> questions?

    Not that I've ever found. Most newbies don't do that. (And I write that as somebody that worked on the OpenVMS FAQ, a document which was posted here ~monthly in decades past.) You are, however, doing far better than many of the newbies over the decades, in that you're asking for these resources.

    https://www.digiater.nl/openvms/freeware/v80/vmsfaq/vmsfaq.txt (with other formats available)

    https://web.archive.org/web/20061105000841/http://seqaxp.bio.caltech.edu/www/vms_beginners_faq.html


    I can assure you that any such FAQ will also routinely be ignored too, as will be the posting archives for this newsgroup, among other resources.

    Suggested reading from the OpenVMS manuals: the Users Guide manual, the Programming Concepts manuals, and then either or both the OpenVMS System Manager's Manuals and/or the OpenVMS Pascal docs.

    In ancient times, what used to be the DEC "TIMA/STARS" support database were also part of the usual path. Directly, or via llong-gone access paths including the old AskQ site. VSI has a support database with source code examples as well, but AFAIK they don't have that accessible for non-contract customers.

    There are source code postings in the archive of this comp.os.vms newsgroup. Google Groups has a fast search of that, but recent years of the Google newsgroup archives are filled with dreck and spam. There are other less-searchable options including https://www.usenetarchives.com

    https://www.digiater.nl/openvms/freeware/ (OpenVMS Freeware)

    https://www.digiater.nl/openvms/decus/ (DECUS library)

    https://www.eight-cubed.com/examples.shtml (C examples)

    https://decuserve.org (resource info, "free shell" access to DCL on OpenVMS Alpha, decades of DEC Notes conferences)

    There used to be a book from Digital Press named "programming OpenVMS applications using Pascal" or something like that. Unavailable today
    unless you manage to find a used copy, of course. But before its
    publication, various versions of this book floated on the Digital
    network. It was named "Pastools". I still have a hardcopy of that book,
    version 0.9, so very close to the published version. Can electronic
    versions of this book still be found somewhere ? It is a very valuable
    resource for people who want to call system services from Pascal.

    --
    Marc Van Dyck

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to Marc Van Dyck on Mon Jan 6 06:58:51 2025
    On 1/6/25 3:50 AM, Marc Van Dyck wrote:

    There used to be a book from Digital Press named "programming OpenVMS applications using Pascal" or something like that. Unavailable today
    unless you manage to find a used copy, of course. But before its
    publication, various versions of this book floated on the Digital
    network. It was named "Pastools". I still have a hardcopy of that book, version 0.9, so very close to the published version. Can electronic
    versions of this book still be found somewhere ? It is a very valuable resource for people who want to call system services from Pascal.


    I don't see that specific name, but the Internet Archive has a couple of
    books on VAX Pascal:


    <https://archive.org/details/stx_AA-L369B-TE_VMS_3.0_Programming_in_VAX_Pascal_Mar85>


    <https://archive.org/details/vaxpascal0000hume>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Marc Van Dyck on Mon Jan 6 15:22:12 2025
    On 1/6/2025 4:50 AM, Marc Van Dyck wrote:
    There used to be a book from Digital Press named "programming OpenVMS applications using Pascal" or something like that. Unavailable today
    unless you manage to find a used copy, of course. But before its
    publication, various versions of this book floated on the Digital
    network. It was named "Pastools". I still have a hardcopy of that book, version 0.9, so very close to the published version. Can electronic
    versions of this book still be found somewhere ? It is a very valuable resource for people who want to call system services from Pascal.

    Writing VAX/VMS Applications Using Pascal / Theo De Klerk from 1991.

    Not available any longer. But still covered by copyright.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Mon Jan 6 15:28:38 2025
    On 1/6/2025 3:22 PM, Arne Vajhøj wrote:
    On 1/6/2025 4:50 AM, Marc Van Dyck wrote:
    There used to be a book from Digital Press named "programming OpenVMS
    applications using Pascal" or something like that. Unavailable today
    unless you manage to find a used copy, of course. But before its
    publication, various versions of this book floated on the Digital
    network. It was named "Pastools". I still have a hardcopy of that book,
    version 0.9, so very close to the published version. Can electronic
    versions of this book still be found somewhere ? It is a very valuable
    resource for people who want to call system services from Pascal.

    Writing VAX/VMS Applications Using Pascal / Theo De Klerk from 1991.

    35 years ago DEC had a training course "VMS for Programmers" with
    a generic guide and a language specific workbook. They covered a
    lot of LIB$ and SYS$ calls.

    I think I still have my copy somewhere. But my workbook was the
    Fortran edition - not the Pascal edition.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)