Page 1 of 1

Posted: Wed Nov 27, 2002 4:27 pm
by BackupUser
Restored from previous forum. Originally posted by high key.

Is it possible to start a *document* with its registered application?
Would be nice to have a command runfile() equal to runprogram()


(I've changed my name from hkey to high key, because hkey didn't make any sense :wink:

Posted: Wed Nov 27, 2002 6:58 pm
by BackupUser
Restored from previous forum. Originally posted by Hi-Toro.

This should do it... if you're running an executable, you can supply the parameter$ and runfrom$ strings if you want (runfrom$ is the folder the program gets run from); if it's a document you want to open, use blank strings, like this example...

Code: Select all

Procedure Launch (file$, parameter$, runfrom$)
  ShellExecute_ (0, "open", file$, parameter$, runfrom$, "")
EndProcedure

f$ = OpenFileRequester ("Open a file...", "", "", -1)

; The interesting part... :wink:

Launch (f$, "", "")

--
See ya,
James L Boyd.
http://www.hi-toro.com/
--

Posted: Wed Nov 27, 2002 8:42 pm
by BackupUser
Restored from previous forum. Originally posted by high key.

I didn't think, it would be that easy :)

Thank you, Hi-Toro!

Posted: Wed Nov 27, 2002 9:36 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.
Would be nice to have a command runfile() equal to runprogram()
But RunProgram does just what you ask.
Try it...

Code: Select all

file.s=OpenFileRequester("Open File","","",0)
If file""
  RunProgram(file,"","",0)
EndIf

----------
Visit the PB Resources Site at http://www.reelmediaproductions.com/pb