forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sdbg and command line tokens

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
RogerLampert



Joined: 11 May 2005
Posts: 12

PostPosted: Tue Jan 15, 2008 5:20 pm    Post subject: sdbg and command line tokens Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7925
Location: Salford, UK

PostPosted: Tue Jan 15, 2008 6:12 pm    Post subject: Reply with quote

You probably need to use the SDBG command line option /PARAMS.
See the help file for further details.
Back to top
View user's profile Send private message AIM Address
RogerLampert



Joined: 11 May 2005
Posts: 12

PostPosted: Wed Jan 16, 2008 1:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7925
Location: Salford, UK

PostPosted: Wed Jan 16, 2008 1:59 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Robert



Joined: 29 Nov 2006
Posts: 445
Location: Manchester

PostPosted: Thu Jan 17, 2008 1:53 am    Post subject: Reply with quote

You can use the shortened /p form:

sdbg yourprog /p "c:\my modcs\p.mdb" /myoption
Back to top
View user's profile Send private message Visit poster's website
RogerLampert



Joined: 11 May 2005
Posts: 12

PostPosted: Thu Jan 17, 2008 2:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7925
Location: Salford, UK

PostPosted: Thu Jan 17, 2008 7:25 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group