<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic parameter/ variable/ argument passing in Fortran 77 in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901364#M35223</link>
    <description>&lt;!--!*#--&gt;Can some one provide an example for the falling (Fortran 77):&lt;BR /&gt;&lt;BR /&gt;In a .COM (on OVMS 7.3-2) I want to set a parameter/ variable/ argument etc that will only exist for the life of the .COM script.&lt;BR /&gt;&lt;BR /&gt;This first .COM runs another .COM script.  The second .COM runs 2 .FOR(exe) programs.  Each of these .FOR(exe) programs must check for the existance of the original parameter/ variable/ argument within a conditional (if) statement.  Depending on whether the parameter/ variable/ argument is set or not - the (if) statement executes the relevant code.&lt;BR /&gt;&lt;BR /&gt;I hope someone can decipher my description.  Any input would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Neal</description>
    <pubDate>Mon, 20 Nov 2006 13:34:31 GMT</pubDate>
    <dc:creator>Neal Kirby</dc:creator>
    <dc:date>2006-11-20T13:34:31Z</dc:date>
    <item>
      <title>parameter/ variable/ argument passing in Fortran 77</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901364#M35223</link>
      <description>&lt;!--!*#--&gt;Can some one provide an example for the falling (Fortran 77):&lt;BR /&gt;&lt;BR /&gt;In a .COM (on OVMS 7.3-2) I want to set a parameter/ variable/ argument etc that will only exist for the life of the .COM script.&lt;BR /&gt;&lt;BR /&gt;This first .COM runs another .COM script.  The second .COM runs 2 .FOR(exe) programs.  Each of these .FOR(exe) programs must check for the existance of the original parameter/ variable/ argument within a conditional (if) statement.  Depending on whether the parameter/ variable/ argument is set or not - the (if) statement executes the relevant code.&lt;BR /&gt;&lt;BR /&gt;I hope someone can decipher my description.  Any input would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Neal</description>
      <pubDate>Mon, 20 Nov 2006 13:34:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901364#M35223</guid>
      <dc:creator>Neal Kirby</dc:creator>
      <dc:date>2006-11-20T13:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: parameter/ variable/ argument passing in Fortran 77</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901365#M35224</link>
      <description>To get the value of DCL symbols into your FORTRAN programm you may use the LIB$GET_SYMBOL runtime function, e.g. &lt;BR /&gt;STATUS=LIB$GET_SYMBOL('symbol', Cstring, Ilength), see HELP RTL LIB$ for help.&lt;BR /&gt;&lt;BR /&gt;regards Kalle</description>
      <pubDate>Mon, 20 Nov 2006 14:16:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901365#M35224</guid>
      <dc:creator>Karl Rohwedder</dc:creator>
      <dc:date>2006-11-20T14:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: parameter/ variable/ argument passing in Fortran 77</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901366#M35225</link>
      <description>Neal,&lt;BR /&gt;&lt;BR /&gt;and the second part of your question: do the symbol assignment with LOCAL SCOPE; &lt;BR /&gt;&lt;BR /&gt;$ My_symbol = "value_of_my_symbol"&lt;BR /&gt;&lt;BR /&gt;My_symbol  is the name of your variable&lt;BR /&gt; =         is the token for LOCAL SCOPE symbol assignment&lt;BR /&gt;" (double quote) is the beginning and ending for string symbol values. Leave them out for integer values.&lt;BR /&gt;&lt;BR /&gt;The value of a LOCAL SYMBOL exests withing the scope of the .COM procedure, and of .COMs called by it. However, IF a called .COM assigns that same symbol name, in the scope of THAT procedure it takes precedence.&lt;BR /&gt;Any LOCAL symbols loose ant meaning upon EXIT (impleid or explicit) from the defining .COM&lt;BR /&gt;To stress the point: if a called .COM redefines the value of my_suymbol in its scope, upon return into the calling .COM, the value set WITHIN the calling .COM is still valid!&lt;BR /&gt;&lt;BR /&gt;You can also define in GLOBAL SCOPE by using a double ==, which remains in effect until explicitly redefined or deleted, but any existing LOCAL scope symbol always takes precedence. (but again, that CAN be overruled with SET SCOPE/NOLOCAL, which in itself as local scope)&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Nov 2006 14:35:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901366#M35225</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2006-11-20T14:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: parameter/ variable/ argument passing in Fortran 77</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901367#M35226</link>
      <description>Neal, in addition to the DCL symbol passing , eventually use command-line arguments in calling the Fortran programs.&lt;BR /&gt;&lt;BR /&gt;There is the VMS RTL routine LIB$GET_FOREIGN&lt;BR /&gt;(see HELp RTL LIB$ LIB$GET_FOREIGN):&lt;BR /&gt;get the whole, unprocessed DCL "foreign" command-line, and parse it's content inside the fortran program.&lt;BR /&gt;&lt;BR /&gt;Use VMS excellent DCL parsing with the CLI$ routines (see HELP CLI).&lt;BR /&gt;Examples to use it in a Fortran program are e.g. in my &lt;BR /&gt;  &lt;A href="http://www.huber-joseph.de/util/init_cli_for.for" target="_blank"&gt;http://www.huber-joseph.de/util/init_cli_for.for&lt;/A&gt; &lt;BR /&gt; and several programs in &lt;A href="http://www.huber-joseph.de/util/main/" target="_blank"&gt;http://www.huber-joseph.de/util/main/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Finally there are the (forthcoming F2003) standard Fortran library calls to get command-lines.&lt;BR /&gt;&lt;BR /&gt;A preliminary implementation can be found in the F2KCLI package at &lt;BR /&gt;  &lt;A href="http://www.winteracter.com/f2kcli" target="_blank"&gt;http://www.winteracter.com/f2kcli&lt;/A&gt;&lt;BR /&gt;The F2003 standard calls are&lt;BR /&gt;  COMMAND_ARGUMENT_COUNT : Returns the number of command arguments&lt;BR /&gt;  GET_COMMAND_ARGUMENT   : Returns a command argument. &lt;BR /&gt;  GET_COMMAND            : Returns the entire command&lt;BR /&gt;  &lt;BR /&gt; Using f2kcli makes the program portable to any standard Fortran environment.</description>
      <pubDate>Tue, 21 Nov 2006 03:51:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901367#M35226</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2006-11-21T03:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: parameter/ variable/ argument passing in Fortran 77</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901368#M35227</link>
      <description>Thanks to all contributions.  I had used the Symbol passing as suggested and was wondering why it was not working the way it should have been.  My compiler was acting up.  My interpretation was correct - thanks jpe / Karl for your confirmation.  Joseph's solution - I will test at a later date. NK.</description>
      <pubDate>Mon, 11 Dec 2006 05:37:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901368#M35227</guid>
      <dc:creator>Neal Kirby</dc:creator>
      <dc:date>2006-12-11T05:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: parameter/ variable/ argument passing in Fortran 77</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901369#M35228</link>
      <description>Neal,&lt;BR /&gt;&lt;BR /&gt;  If it's an existence yes/no type switch, it might be easier to use a logical name.&lt;BR /&gt;&lt;BR /&gt;  Fortran code:&lt;BR /&gt;&lt;BR /&gt;       LOGICAL LIB$GET_LOGICAL&lt;BR /&gt;   ...&lt;BR /&gt;&lt;BR /&gt;     IF(LIB$GET_LOGICAL('NEALS_SWITCH'))THEN&lt;BR /&gt;       ! Logical name was defined&lt;BR /&gt;     ELSE&lt;BR /&gt;       ! Logical name not defined&lt;BR /&gt;     ENDIF&lt;BR /&gt;&lt;BR /&gt;LIB$GET_LOGICAL will return TRUE if the logical name was defined or FALSE if not.&lt;BR /&gt;&lt;BR /&gt;In your command procedure:&lt;BR /&gt;&lt;BR /&gt;$ DEFINE NEALS_SWITCH YES&lt;BR /&gt;$ RUN ENALS_PROGRAM</description>
      <pubDate>Mon, 11 Dec 2006 21:49:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/parameter-variable-argument-passing-in-fortran-77/m-p/3901369#M35228</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2006-12-11T21:49:15Z</dc:date>
    </item>
  </channel>
</rss>

