- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: parameter/ variable/ argument passing in Fortr...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2006 05:34 AM
тАО11-20-2006 05:34 AM
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.
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.
I hope someone can decipher my description. Any input would be appreciated.
Thanks
Neal
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2006 06:16 AM
тАО11-20-2006 06:16 AM
Re: parameter/ variable/ argument passing in Fortran 77
STATUS=LIB$GET_SYMBOL('symbol', Cstring, Ilength), see HELP RTL LIB$ for help.
regards Kalle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2006 06:35 AM
тАО11-20-2006 06:35 AM
Solutionand the second part of your question: do the symbol assignment with LOCAL SCOPE;
$ My_symbol = "value_of_my_symbol"
My_symbol is the name of your variable
= is the token for LOCAL SCOPE symbol assignment
" (double quote) is the beginning and ending for string symbol values. Leave them out for integer values.
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.
Any LOCAL symbols loose ant meaning upon EXIT (impleid or explicit) from the defining .COM
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!
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)
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2006 07:51 PM
тАО11-20-2006 07:51 PM
Re: parameter/ variable/ argument passing in Fortran 77
There is the VMS RTL routine LIB$GET_FOREIGN
(see HELp RTL LIB$ LIB$GET_FOREIGN):
get the whole, unprocessed DCL "foreign" command-line, and parse it's content inside the fortran program.
Use VMS excellent DCL parsing with the CLI$ routines (see HELP CLI).
Examples to use it in a Fortran program are e.g. in my
http://www.huber-joseph.de/util/init_cli_for.for
and several programs in http://www.huber-joseph.de/util/main/
Finally there are the (forthcoming F2003) standard Fortran library calls to get command-lines.
A preliminary implementation can be found in the F2KCLI package at
http://www.winteracter.com/f2kcli
The F2003 standard calls are
COMMAND_ARGUMENT_COUNT : Returns the number of command arguments
GET_COMMAND_ARGUMENT : Returns a command argument.
GET_COMMAND : Returns the entire command
Using f2kcli makes the program portable to any standard Fortran environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2006 09:37 PM
тАО12-10-2006 09:37 PM
Re: parameter/ variable/ argument passing in Fortran 77
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2006 01:49 PM
тАО12-11-2006 01:49 PM
Re: parameter/ variable/ argument passing in Fortran 77
If it's an existence yes/no type switch, it might be easier to use a logical name.
Fortran code:
LOGICAL LIB$GET_LOGICAL
...
IF(LIB$GET_LOGICAL('NEALS_SWITCH'))THEN
! Logical name was defined
ELSE
! Logical name not defined
ENDIF
LIB$GET_LOGICAL will return TRUE if the logical name was defined or FALSE if not.
In your command procedure:
$ DEFINE NEALS_SWITCH YES
$ RUN ENALS_PROGRAM