How do you call and run another Revmade.exe

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
user#606
Posts: 217
Joined: Sun Jan 27, 2008 12:25 pm
Contact:

How do you call and run another Revmade.exe

Post by user#606 » Mon May 05, 2008 2:59 pm

I need to be able to call or run another exe programme made by Rev from the main one and then return back to the calling point to continue.

Can anyone tell me how this can be done?

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

Post by reelstuff » Tue May 06, 2008 10:13 am

There are a few examples, depending on what you want to do in the Rev online viewer, under programming.

I know that it is possible, however it could and probably is somewhat difficult but it does not have to be that way.

You could just use a .REV file, again dont know what your goal is, or what type of communication you wish to achieve.


From what I read in the docs, using an external you could just about do anything you wanted to do, given enough time and energy.

have you downloaded the external kit, here is some information on externals, I have yet to jump into it but I know it is just a matter of time before I do, but not today, LOL

http://runrev.com/developers/tutorials/ ... ls-part-1/
8)

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Tue May 06, 2008 11:05 am

I think the easiest way would be similar to this approach:

Code: Select all

--calling application
on mouseUp
  --put something meaningfull into passedData here
  put passedData into url ("file:" & "passedData.txt")
  delete file "resultData.txt"
  launch "/other/rev/aplication"
  send "checkResult" to me in 10 seconds
end mouseUp

on checkResult
  if there is a file "resultData.txt" then
    send "checkResult" to me in 10 seconds
  else
  put url ("file:" & "resultData.txt") into theResult
  -- do other stuff here
  end if  
end checkResult

Code: Select all

on startup
  put url ("file:" & "passedData.txt") into theInput
  -- do stuff here
   put theOutput into url ("file:" & "resultData.txt")
end startup
As you see the easiest way isn't exactly an overly easy way ;-)

Oh, and watch out for the paths (defaultfolder property), so you don't delete/read/check for a wrong file.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

user#606
Posts: 217
Joined: Sun Jan 27, 2008 12:25 pm
Contact:

Post by user#606 » Tue May 06, 2008 1:09 pm

To Reelstuf and Bvg,

Thank you for your suggestions.

In simple terms then, MainProg is running and reaches a point where SecondaryProg.exe is called.
MainProg.exe saves data that needs to be used by SecondaryProg.exe in a text file, SecondaryProg.exe starts and reads the text file, then does its processing and saves the result back to a text file and terminates.
MainProg.exe is the currently running program, so perhaps a continue button is pressed and the Result file is read and the MainProg.exe continues.

If this is what you had in mind BvG, in your code, then that looks to be just what I want.

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Tue May 06, 2008 3:55 pm

Yes that's what the code does. Well mostly... there's no button, "MainProg.exe" would just continue when there is data in the correct file (resultData.txt).
You did look at the code and understood what it does, right?
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

user#606
Posts: 217
Joined: Sun Jan 27, 2008 12:25 pm
Contact:

Post by user#606 » Tue May 06, 2008 4:18 pm

I will study it when I get time.

I have been plunged back into work again, so it may be several days before I can study and experiment. Be assured, I would be programming it now if I could.

For your interest, the software I am writing is very ordinary at a technical level, but is quite unique in its application. It also has a ready made market of professionals ready to use it. So I am trying very hard to get it out there for them.
In case you think I am going to make a fortune from it, the product will be free. That is why no one else would produce this essential tool. I dont need the money, but I would like to leave something worthwhile behind when I kick the bucket.
In the same way, all you people who help users like me are making a difference and it is appreciated.

Post Reply