Silverfrost Forums

Welcome to our forums

Program arguments using GETARG

26 Jan 2010 9:55 #5841

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[color=blue:2177afeacf] CALL [/color:2177afeacf][color=green:2177afeacf]GETARG/color:2177afeacf 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?

26 Jan 2010 11:11 #5843

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.

26 Jan 2010 11:20 #5844

I played a bit with [color=blue:a93f1db57d]GET_COMMAND_ARGUMENT[/color:a93f1db57d]. 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.

Please login to reply.