November 15, 2019, 08:59:24 AM

Author Topic: Any Way to Run a Cmd From Blitzmax?  (Read 91 times)

Offline Hardcoal

  • Sr. Member
  • ****
  • Posts: 298
Any Way to Run a Cmd From Blitzmax?
« on: November 08, 2019, 02:27:25 PM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2569
Re: Any Way to Run a Cmd From Blitzmax?
« Reply #1 on: November 08, 2019, 03:17:33 PM »
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

Offline degac

  • Full Member
  • ***
  • Posts: 123
    • graphio.net
Re: Any Way to Run a Cmd From Blitzmax?
« Reply #2 on: November 10, 2019, 06:56:46 PM »
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

Offline Hardcoal

  • Sr. Member
  • ****
  • Posts: 298
Re: Any Way to Run a Cmd From Blitzmax?
« Reply #3 on: November 10, 2019, 07:05:17 PM »
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