Silverfrost Forums

Welcome to our forums

GETCOMMANDLINE

22 Jun 2006 4:29 #762

How do you use the GETCOMMANDLINE function please?

It has been declared in win32api.ins as:

      STDCALL GETCOMMANDLINE 'GetCommandLineA':INTEGER*4

The manual for GetCommandLineA gives the following declaration:

LPTSTR GetCommandLine(void);

(I know that Fortran2003 has GET_COMMAND & GET_COMMAND_LINE which you can use in Salford)

thanks Clint

22 Jun 2006 5:28 #764

Clint

Will the Salford FTN95 function 'COMMAND_LINE' or 'CMNAM' do what you require?

Not being direct API calls they are very simple to use.

John

22 Jun 2006 7:03 #765

They will do but I wanted to know how the the win32api should be used (out of interest). The function appears to be unusable as it is defined in the header.

Useful if I come acorss another function without an F2003 equivalent.

22 Jun 2006 8:59 #768

Clint

GetCommandLine is really not very useful in a Fortran context.

However here is some simple code for what it is worth....

include 'windows.ins' integer addr character100 c character cc c = ' ' addr = GetCommandLine() do i=0,99 cc = ccore1(addr+i) if(ichar(cc) == 0) exit c(i+1:i+1) = cc
enddo print
,c end

Please login to reply.