Any Way to Run a Cmd From Blitzmax?

Started by Hardcoal, November 08, 2019, 14:27:25

Previous topic - Next topic

Hardcoal

Hi

As ive asked on my hardcoal editor thread.

Im looking for a way to make tprocess to open MaxIDE with a certain file I want.
anyone has an Idea?

the second choice is to somehow Run Cmd from blitzmax.
if i go on the second choice, i will have to find a way to know that maxide was closed so i can execute some actions.
Code

Derron

If you kick off a process your TProcess is "alive" until that process has ended ("blide/maxide closed").


I answered your question (a bit of it at least) in your other thread. give the editor a temporary file to open (depends on whether the editor accepts parameters like "blide c:\myfile.bmx"). Once the file is open, check filetime to see when stuff was saved to allow reloading in your editor. When the process exits, remove the temporary file again.

Some editors might lock the file for other applications - so you cannot open it in your application then until the editor removes its lock on the file.


bye
Ron

degac

Hi

you could start a process and wait an answer from the 'output' pipeline.
But for what I know MaxIDE doesn't 'print' any final message (just made a test).
You could try to change MaxIDE if you need this.

If there's a problem, there's at least one solution.
www.blitzmax.org

Hardcoal

I eventually decided to simply use openurl command and let the user decide which app opens his BMX file.
And all I do is check filetime constantly until it changes.
That's how i know it was edited
Code

Kippykip

You can try using TProcess, here's me running windows explorer onto a directory.

'Open a directory
Function OpenDir(Directory:String)
Local Explorer:TProcess = CreateProcess:TProcess("explorer.exe " + Chr(34) + Directory + Chr(34))
DetachProcess(Explorer)
End Function