View previous topic :: View next topic |
Author |
Message |
RogerLampert
Joined: 11 May 2005 Posts: 12
|
Posted: Tue Jan 15, 2008 5:20 pm Post subject: sdbg and command line tokens |
|
|
I am trying to read a command line token into a simple program, TESTFORT.FOR:
CHARACTER*3 CMNAM, TOKEN
TOKEN = CMNAM()
WRITE(*, 10) TOKEN
10 FORMAT('TOKEN IS ', A3)
END
If I compile with FTN95 testfort.for/debug/params and run it with the command "testprog abc" this works perfectly.
If I try to run it with "sdbg testprog abc" I get a system 2 error 'cannot find the file specified' as it tries to find abc.exe
How can I run the debugger and use a command line token?
Grateful for any help.
Roger |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue Jan 15, 2008 6:12 pm Post subject: |
|
|
You probably need to use the SDBG command line option /PARAMS.
See the help file for further details. |
|
Back to top |
|
|
RogerLampert
Joined: 11 May 2005 Posts: 12
|
Posted: Wed Jan 16, 2008 1:31 pm Post subject: |
|
|
Paul,
Thanks, this works
As far as I can tell, sdbg requires me to put in the token by hand. Does this have to be the case? (My token is the name of a database. This will change during the course of the run)
Roger |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Jan 16, 2008 1:59 pm Post subject: |
|
|
Roger
Of necessity command line parameters can only specify initial values that may change from one run to the next. Runtime changes must be programmed in some other way.
If you are using a project in Plato3 then command line parameters can be set in the project Properties via Compiler options->Miscellaneous->Launch arguments.
Paul |
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 445 Location: Manchester
|
Posted: Thu Jan 17, 2008 1:53 am Post subject: |
|
|
You can use the shortened /p form:
sdbg yourprog /p "c:\my modcs\p.mdb" /myoption |
|
Back to top |
|
|
RogerLampert
Joined: 11 May 2005 Posts: 12
|
Posted: Thu Jan 17, 2008 2:11 pm Post subject: |
|
|
Thanks, Paul and Robert.
I have tried Robert's suggestion and it certainly gives me a solution, but maybe I have misunderstood. Looking at the suggested code, I thought that the file c:\my modcs\p.mdb contained the token to be input to the program yourprog.exe. In fact, using the code in my original question, I put the token into 'token.dat' and used the command line:
sdbg testfort/p "c:\token.dat"
.. and the token that was received by the program was "c: This is a good outcome for me as I now know how to get the token into the program without doing it by hand, so very grateful for that, but was the intention of the reply that I could put the tokens into a file and read them from there?
Roger |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Jan 17, 2008 7:25 pm Post subject: |
|
|
There are various standard Fortran 2003 routines and FTN95 specific routines for getting information from the command line. These are described in the help file and some of them are described in terms of "tokens". These tokens are items on the command line with specified delimiters. See the FTN95 help file for further information. |
|
Back to top |
|
|
|