read from process question

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
BIX
Posts: 33
Joined: Fri Oct 27, 2006 2:54 pm

read from process question

Post by BIX » Mon Mar 19, 2007 1:00 pm

what is wrong with this script? Why does rev freeze after it?

Code: Select all

on mouseUp
  open process "C:/someApp.exe"
  read from process "C:/someApp.exe" until end
  put it into field "someField"
end mouseUp
BIX

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Mar 19, 2007 3:26 pm

Hi BIX,

You open the process, but you don't specify a read/write mode. The following might work:

open process "C:/someApp.exe" for read

Are you sure that the process quits automatically? I would expect a line

close process "someApp"

after the read command. Are you sure that the process actually returns data? If Revolution starts reading but doesn't find any data, it might wait for data and freeze meanwhile (but I haven't really tested this and I might be wrong).

What kind of programme are you using? Do you have any additional information about it? It might be the source of the problem.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

BIX
Posts: 33
Joined: Fri Oct 27, 2006 2:54 pm

Post by BIX » Wed Mar 21, 2007 1:56 pm

OK, i'll change the question. what sort of apps can be read with -read from process- command. that's the only thing i wanted to know, because i tried this command and it freezes every time.
BIX

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Mar 21, 2007 2:17 pm

Hi Bix,

Probably, the best answer is: programmes of which you know that they have been designed to return data to the application calling them. Usually, these are command line utilities, or GUI applications that can also be used as command line utiities.

This doesn't mean that you can't start many applications as a process from within Revolution. You can open them, but you just can't read from them.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply