View previous topic :: View next topic |
Author |
Message |
jjgermis
Joined: 21 Jun 2006 Posts: 404 Location: N�rnberg, Germany
|
Posted: Tue Jan 26, 2010 10:55 am Post subject: Program arguments using GETARG |
|
|
The question is how to handle a program argument like:
C:\Documents and Settings\adgejo1\MoDaMa\Hydro_9.6mm\RESULTS
To assure that the complete path (including the empty spaces) is passed the argument needs to be placed between " or ', i.e.
"C:\Documents and Settings\adgejo1\MoDaMa\Hydro_9.6mm\RESULTS"
Using CALL GETARG(1,PATH) the " of ' are included in the variable path and must be removed in the program to get the correct path. Usually the " or ' must be removed automatically.
Is my interpretation correct or are the perhaps some compiler option? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Tue Jan 26, 2010 12:11 pm Post subject: |
|
|
If you pass a path as a command line argument then it is best to enclose it in double quotes.
GET_COMMAND and GET_COMMAND_ARGUMENT are standard Fortran 2003 intrinsics that have been implemented in FTN95. |
|
Back to top |
|
 |
jjgermis
Joined: 21 Jun 2006 Posts: 404 Location: N�rnberg, Germany
|
Posted: Tue Jan 26, 2010 12:20 pm Post subject: |
|
|
I played a bit with GET_COMMAND_ARGUMENT. The following arguments are valid:
1.) C:\Docume~1\adgejo1\MoDaMa\Hydro_9.6mm\RESULTS and
2.) "C:\Documents and Settings\adgejo1\MoDaMa\Hydro_9.6mm\RESULTS"
In case of the second option, the double quotes are removed automatically. |
|
Back to top |
|
 |
|