PDA

View Full Version : fortrtan


peter2
14-07-2003, 22:31
esiste un comando che manda in esecuzione un exe mentre sta girando il programma che lo contiene (il comando)?
azz come mi spiego male......

ciao

a2000
15-07-2003, 06:17
__________________________________________________________________________________________________________________________
RUNQQ
Run-Time Function: Executes another program and waits for it to complete.

Module: USE DFLIB

Syntax

result = RUNQQ (filename, commandline)


filename
(Input) Character*(*). Filename of a program to be executed.


commandline
(Input) Character*(*). Command-line arguments passed to the program to be executed.
Results:

The result is of type INTEGER(2). If the program executed with RUNQQ terminates normally, the exit code of that program is returned to the program that launched it. If the program fails, -1 is returned.

The RUNQQ function executes a new process for the operating system using the same path, environment, and resources as the process that launched it. The launching process is suspended until execution of the launched process is complete.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: SYSTEM, NARGS

Example

See example in NARGS.

USE DFLIB
INTEGER(2) result
result = RUNQQ('myprog', '-c -r')
END


__________________________________________________________________________________________________________________________
[b]SYSTEM
Portability Function: Sends a command to the shell as if it had been typed at the command line.

Module: USE DFPORT

Syntax

result = SYSTEM (string)


string
(Input) Character*(*). Operating system command.
Results:

The result is of type INTEGER(4). The result is the exit status of the shell command. If -1, use IERRNO to retrieve the error. Errors can be one of the following:

E2BIG: The argument list is too long.
ENOENT: The command interpreter cannot be found.
ENOEXEC: The command interpreter file has an invalid format and is not executable.
ENOMEM: Not enough system resources are available to execute the command.
On WNT systems, the calling process waits until the command terminates. On W9* systems, the calling process does not currently wait in all cases; however, this may change in future implementations. To insure compatibility and consistent behavior, an image can be invoked directly by using the Win32 APICreateProcess( ) in your Fortran code.

Commands run with the SYSTEM routine are run in a separate shell. Defaults set with the SYSTEM function, such as current working directory or environment variables, do not affect the environment the calling program runs in.

The command line character limit for the SYSTEM function is the same limit that your operating system command interpreter accepts.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: SYSTEMQQ

Example

USE DFPORT
INTEGER(4) I, errnum
I = SYSTEM("dir > file.lst")
If (I .eq. -1) then
errnum = ierrno( )
print *, 'Error ', errnum
end if
END


__________________________________________________________________________________________________________________________
SYSTEMQQ
Run-Time Function: Executes a system command by passing a command string to the operating system's command interpreter.

Module: USE DFLIB

Syntax

result = SYSTEMQQ (commandline)


commandline
(Input) Character*(*). Command to be passed to the operating system.
Results:

The result is of type LOGICAL(4). The result is .TRUE. if successful; otherwise, .FALSE..

The SYSTEMQQ function lets you pass operating-system commands as well as programs. SYSTEMQQ refers to the COMSPEC and PATH environment variables that locate the command interpreter file (usually named COMMAND.COM).

On WNT systems, the calling process waits until the command terminates. On W9* systems, the calling process does not currently wait in all cases; however, this may change in future implementations. To insure compatibility and consistent behavior, an image can be invoked directly by using the Win32 APICreateProcess( ) in your Fortran code.

If the function fails, call GETLASTERRORQQ to determine the reason. One of the following errors can be returned:

ERR$2BIG - The argument list exceeds 128 bytes, or the space required for the environment formation exceeds 32K.
ERR$NOINT - The command interpreter cannot be found.
ERR$NOEXEC - The command interpreter file has an invalid format and is not executable.
ERR$NOMEM - Not enough memory is available to execute the command; or the available memory has been corrupted; or an invalid block exists, indicating that the process making the call was not allocated properly.
The command line character limit for the SYSTEMQQ function is the same limit that your operating system command interpreter accepts.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: SYSTEM

Example

USE DFLIB
LOGICAL(4) result
result = SYSTEMQQ('copy c:\bin\fmath.dat &
c:\dat\fmath2.dat')[/size]

a2000
16-07-2003, 12:48
di niente.

peter2
20-07-2003, 12:08
grazie per le info....ho controllato solo ora la discussione.
ciao

a2000
20-07-2003, 15:44
Originariamente inviato da a2000
di niente.

a2000
20-07-2003, 15:45
fortratan uber alles !

a2000
20-07-2003, 16:08
uberino

a2000
21-07-2003, 10:35
uber !

a2000
21-07-2003, 12:40
uberone !!

ilsensine
21-07-2003, 13:18
Potresti mantenere il numero di post inutili al di sotto di un ragionevole 5%?