How execute a file from blitzmax ?

BlitzMax Forums/BlitzMax Programming/How execute a file from blitzmax ?

How execute an exe file from blitzmax ? i need this to make
my breakout editor :)

Thanks :)

system_("your_editor.exe")

This should do it if you mean to run another App from an BMax app.

Many thanks !

it should be noted that your calling app will wait until the app you call with system_ is finished.

@Klepto,
that is indeed handy.

I modified the Kernel32.bmx and added the WinExec API declaration to it, which has turned to be successfull, and when I came here to answer filax, I've noticed your post !

:)

I have a question, where did you find the documentation of the 'system_' command ? Am I right to assume that it is a multiplatform command - that is, it would work also on a linux or a mac OS ?

Anyway, if you want to use WinExec API, then:
1) go to the pub.mod directory and make a copy of the win32.mod directory - just in case !
2) open the win32.mod directory and locate the kernel32.bmx file
3) open the kernel32.bmx file from the IDE, and add this statement to the functions declared in it:
Function WinExec (lpCmdLine:Byte Ptr,nCmdShow)

4) save the kernel32.bmx file
5) now go in the bin directory of your main BMAX installation, and create a file .bat which contains the following statements:
bmk makemods pub.win32
pause

6) run that .bat file
7) now you can use the WinExec function:
WinExec("calc.exe",10)


Note that WinExec does not halt the calling application as the command system_ does.

Hope it helps,
Sergio.

Excellent ! many thanks

Its part of the pub.StdC Module.
As I remember right its an undocumented Module. But you can make the commands visible by using the documenta tool of Fredborg.
Maybe you have to set 'undocumented' to True in the Code to let documenta list them.

But at least i haven't found it. This command was mentioned in a previous Topic before.

Ok thanks for informations !

Under Linux is this very cool!

system_("gedit") ' starts and waits for end the program.

system_("gedit &") ' starts, however your program continues.


:-)

Under Linux is it very cool!
Now that is cool!

yup yup, very handy.

Is there a similar command to wait a program end on PC ?