SyntaxBomb - Indie Coders

Languages & Coding => BlitzMax / BlitzMax NG => Topic started by: Hardcoal on November 08, 2019, 14:27:25

Title: Any Way to Run a Cmd From Blitzmax?
Post by: Hardcoal on November 08, 2019, 14:27:25
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.
Title: Re: Any Way to Run a Cmd From Blitzmax?
Post by: Derron on November 08, 2019, 15:17:33
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
Title: Re: Any Way to Run a Cmd From Blitzmax?
Post by: degac on November 10, 2019, 18:56:46
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.

Title: Re: Any Way to Run a Cmd From Blitzmax?
Post by: Hardcoal on November 10, 2019, 19:05:17
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
Title: Re: Any Way to Run a Cmd From Blitzmax?
Post by: Kippykip on December 14, 2019, 14:26:26
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
Title: Re: Any Way to Run a Cmd From Blitzmax?
Post by: Hardcoal on December 14, 2019, 14:44:03
Thanks