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: 4 Dec 2001 03:09:51 -0800 Organization: http://groups.google.com/ Lines: 144 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 1007464191 1551 127.0.0.1 (4 Dec 2001 11:09:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 4 Dec 2001 11:09:51 GMT Xref: news.net.uni-c.dk comp.lang.beta:13070 jochenrollwagen@yahoo.com (Jochen Rollwagen) wrote in message news:... > 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 Now being able to compile execRead (see above) and my GUI-Pattern, i have problems with my main pattern. My execRead-Pattern has ORIGIN '~beta/basiclib/basicsystemenv'; INCLUDE '~beta/process/commpipe' '~beta/process/processmanager'; and fragment-form 'systemlib' My GUI-Pattern: ORIGIN '~beta/guienv/guienv'; INCLUDE '~beta/guienv/controls' '~beta/guienv/scrolllists'; fragment-form 'guienvLib' My main pattern looks like this: guienv (# MainWindow: myGUI (# doFind: (# do ('subProcess','-args')->&execReadText; #) 'callback from GUI-library #); MyMainWindow: @MainWindow; do MyMainWindow.Open; #) with ORIGIN '~beta/basiclib/systemenv'; INCLUDE 'execRead' 'myGUI'; fragment-form 'program' When compiling the main pattern i get Target machine type nti_gnu Building dependency graph for: 'C:\beta\cc_myProgram' ... Translating fragments ... Bind fragments in: 'C:\beta\cc_myProgram.exe'!Checking ('subProcess','-args')->&execReadText ^ ***** "execReadText" is not declared -------------------------------------------- No. of fatal errors: 1 ?? Cheers Jochen