Clarion - Abrir cualquier archivo desde clarion

 
Vista:

Abrir cualquier archivo desde clarion

Publicado por Antonio (3 intervenciones) el 23/10/2008 01:39:39
Hola a todos soy nuevo en clarion y requiero en tiempo de ejecucion seleccionar la ruta de un archivo (esa ya la pase a un string con el DOSFILELOOKUP) pero ahora quiero abrilo es decir si el archivo es de bmp que se pueda abrir con paint (o el programa predeterminado) o si es un mp3 que se abra con al aplicacion predeterminada en windows.

Agradezco la atencion.

saludos
Antonio
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Abrir cualquier archivo desde clarion

Publicado por Asdrubal Petit Serrano (36 intervenciones) el 28/10/2008 02:38:58
Pregunta es:
Quiero cargar un archivo (bmp o mp3) como una aplicación predeterminada de quindows desde mi aplicación de windows?

Respuesta:
RUN('comando de linea')

RUN Executes a command as if it were entered on the DOS command line.

command A string constant or variable containing the command to execute. This may include a full path and command line parameters.
waitflag An integer constant, variable, or EQUATE indicating whether RUN should launch the command and wait for its termination, or immediately return after launching. If omitted or zero (0), control immediately returns to the statement following the RUN. If one (1), control returns to the statement following the RUN only after the command has completed its execution.

The RUN statement executes a command to execute a DOS or Windows program. If the command parameter is a STRING variable, you must first use CLIP to remove trailing spaces (not necessary if the command is a CSTRING variable). Internally, RUN uses the winexec() Windows API call to execute the command.
When the command executes, the new program is loaded as the ontop and active program. Execution control in the launching program returns immediately to the statement following RUN and the launching program continues executing as a background application if the waitflag is set to zero (0). The user can return to the launching program by either terminating the launched program, or switching back to it through the Windows Task List. Execution control in the launching program returns to the statement following RUN only after the command has terminated its execution if the waitflag is set to one (1).

If the command does not contain a path to the program, the following search sequence is followed:

1. The DOS current directory
2. The Windows directory
3. The Windows system directory
4. Each directory in the DOS PATH
5. Each directory mapped in a network

The successful execution of the command may be verified with the RUNCODE procedure, which returns the DOS exit code of the command. If unsuccessful, RUN posts the error to the ERROR and ERRORCODE procedures.

Errors Posted: RUN may post any possible error

Example:

ProgNameC CSTRING(100)

ProgNameS STRING(100)

CODE
RUN('notepad.exe readme.txt') !Run Notepad, automatically loading readme.txt file

RUN(ProgNameC) !Run the command in the ProgNameC CSTRING variable

RUN(CLIP(ProgNameS)) !Run the command in the ProgNameS STRING variable

RUN('command.com /c MyBat.bat',1) !Run the command and wait for it to complete
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Abrir cualquier archivo desde clarion

Publicado por FRANCISCO (Construdata) (376 intervenciones) el 29/10/2008 23:19:08
POR QUE NO USAS EL TEMPLATE DE SHELLEX QUE SIRVE EXACTAMENTE PARA ESO.

UN SALUDO DESDE MEXICO...

FEM
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar