Path: news.net.uni-c.dk!logbridge.uoregon.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail From: jochenrollwagen@yahoo.com (Jochen Rollwagen) Newsgroups: comp.lang.beta Subject: Re: how do i include processmanager for a library Date: 3 Dec 2001 01:17:31 -0800 Organization: http://groups.google.com/ Lines: 91 Message-ID: References: NNTP-Posting-Host: 62.96.207.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1007371051 5797 127.0.0.1 (3 Dec 2001 09:17:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 3 Dec 2001 09:17:31 GMT Xref: news.net.uni-c.dk comp.lang.beta:13068 Morten Grouleff wrote in message news:... > jochenrollwagen@yahoo.com (Jochen Rollwagen) writes: > > > I'd like to create a library containing a pattern to start a > > sub-process which i want to include in a beta-program with a GUI. The > > code is taken from an example pattern which obviously is a beta > > program (not a library) since it has systemenv at its top, which seems > > to include the process-pattern and so on. > > > > The fragment-information for my library looks like this: > > > > ORIGIN '~beta/basiclib/systemenv'; > > INCLUDE '~beta/process/commpipe' '~beta/process/processmanager'; > > You should use the ORIGIN suggested below instead. The difference is > that the above ORIGIN specifies that this program uses the non-graphical > environment, e.i. does not use Guienv. The ORIGIN suggested below does > not select any implementation. The program in which your library is used > should be free to select whether it uses Guienv or not. > > ORIGIN '~beta/basiclib/basicsystemenv'; > > > But i get compile-errors saying process isn't defined and so on > > (basically the processmanager seems to be not included). > > Define your patterns in "--- systemlib:attributes ---". From there you > can see all patterns defined in the process library. > > Try posting the file and errormessages if this does not help you. Hello Morten, thanks for your advice, although it didn't really help :-) I think you misunderstood that the ORIGIN i posted was that of the library, not the program. My code for the library is as follows: ORIGIN '~beta/basiclib/basicsystemenv'; 'note i replaced basicsystemenv INCLUDE '~beta/process/commpipe' '~beta/process/processmanager'; execReadWriteInit: (# name,args: ^text; child: @process; openRedirection:< Object; closeRedirection:< Object; enter (name[],args[]) do (* initialize (an object to manage) the child process *) name[]->child.init; (if args[] <> none then args[]->child.argument.append if); &openRedirection; (* run the child process *) child.start; INNER ; (* Await exit of child. * Otherwise it will turn into a zombie. *) child.awaitStopped; #); execRead: execReadWriteInit (# output: @File; 'pipes don't work :-( openRedirection::< (# do (* setup communication channel to retrieve output from child *) 'C:\\Temp\\out.txt'->output.Name; output[]->child.redirectToFile; INNER ; #); do INNER ; #); execReadText: execRead (# T: ^Text; do exit T[] 'doesn't do anything since output is in file #); I'd like to call execReadText from a GUI-based BETA-program. But i can't compile the code above since i get errors "'process' is not declared", "attribute 'init' is not declared" and so forth. ('Process' with a capital p doesn't work either. By the way, there's a mismatch between the examples with 'p'rocess and the library process/processmanager, where 'P'rocess has a capital P). Cheers Jochen