[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

2906.0. "Getting output from other appl." by NBOSWS::FRIES () Mon Sep 11 1989 04:13

    Does anyone know how to get text output from other
    applications into a private buffer? ("appl >file" is not wanted)
    
    With this information it would be possible to code an application
    being able to get back lines of text which scrolled off the screen.
    
    Thanks in advance
    Gerald
    (Sorry for my grammar)
    
T.RTitleUserPersonal
Name
DateLines
2906.1WJG::GUINEAUImpossible ConcentrationTue Sep 12 1989 09:117
With ARP  and ASHELL you could use a PIPE to your own application which
did these functions for you:


	1> appl | my_processor

John
2906.2WShell & ARexx, too...FRAMBO::BALZERChristian Balzer DTN:785-1029Tue Sep 12 1989 09:537
    Yeah, and with WShell and ARexx I'm doing stuff like this for over
    a year now. Works just great.
    Give me a call, Gerald, and I can tell you more...
    
    Regards,
    
    <CB>
2906.3Thank you, but ...NBOSWS::FRIESTue Sep 12 1989 10:4220
    Thanks for your infos, but what I want to code (Aztec-C), 
    is an application being able to get back normal text output to 
    the CLI-window (perhaps with a scroll bar or such (see DECwindows)).
    
    The problem is:
    	How to read from stdout?
    	( fgets(string,255,stdout) doesn't work (of course))
    	Please: No pipe or '>file' (I don't own AREXX, too).
    
    Another example:
    I wrote an application to start editor, compiler, assembler, linker
    and debugger with my mouse. All necessary options are stored in
    a specific file, so I needn't use my keyboard at all.
    Now it would be nice to put the dozens of compiler errors on the
    screen AND into a file AT THE SAME TIME to watch the compiler working
    (perhaps I want to abort it) and to watch the first error again.
    I start the compiler with the function 'fexecv()', so no
    output-redirection is allowed. (The other unsolved problem
    is that this functions waits until the started application ends
    (See my separate question)).                     
2906.4WJG::GUINEAUImpossible ConcentrationTue Sep 12 1989 12:096
MAybe look into getting your input/output file handles from the process
structure (proc = FindTask(0)). Then from there you could intercept I/O
and do scroll bar/backing store processing


John
2906.5NBOSWS::FRIESWed Sep 13 1989 10:4614
    Thanks !!!
    I'll try to capture outputs this way.       
    
    But isn't there any buffer in memory including all text-outputs of a 
    specific window?  Or how does scrolling work?
    
    I think of some contents of the CommandLineInterface-structure.
    	...->cli_StandardOutput
    	...->cli_CurrentOutput
    or such.
    
    Regards
    Gerald
    
2906.6WJG::GUINEAUImpossible ConcentrationWed Sep 13 1989 11:4611
I doubt the shell keeps anything other than the RastPort around.

Your application would have to maintain a "display list" of everything
that scrolled off the cli window. Waqtching for  resize events and all. 

You'ld probably be better off closing the CLI's window and opening your
own, maintaining all the data yourself and just using the shell for it's
cli features. Is there a" callable shell"?


John
2906.7Perhaps there is a way...NBOSWS::FRIESThu Sep 14 1989 03:3513
    Coding an own shell is what a have apprehended (but expected).
    
    But I interpreted process->pr_COS as BPTR to a FileHandle structure
    and ...->fh_Buf as a BPTR to a string.
    printf("%s",...->fh_Buf*4L) (Perhaps without '\0' at the end.)
    
    VOILA: There was the last CLI output (mostly the prompt).
    Examined the CommandLineInterface structure the same way, the same
    results occured.                     
    
    Perhaps there is a way, yet !?
    
    Gerald
2906.8WJG::GUINEAUImpossible ConcentrationThu Sep 14 1989 09:028
Definetly post what you come up with!!  

scroll bars and saved text off the screen are sore spots badly missing
from WorkBench. I guess X and DECwindows spoils you :-)

CB, any chance 1.4 will have this feature?!?!?

John
2906.9YesFRAMBO::BALZERChristian Balzer DTN:785-1029Thu Sep 14 1989 09:131
    
2906.10WJG::GUINEAUImpossible ConcentrationThu Sep 14 1989 09:321
Now *that's* your shortest reply :-) 
2906.11Verbose answer follows... ;-)FRAMBO::BALZERChristian Balzer DTN:785-1029Thu Sep 14 1989 09:4410
    Re: .8, .9, .10 
    
    Yeah, and I take great pride in delivering such a crystal clear
    answer... ;-)
    1.4 is still in alpha, nothing has been fixed. But one can safely
    assume text windows and screen CLI editors in it...
    
    'Nuff said,
    
    <CB>
2906.12A Slightly Different FlavorDRUMS::FEHSKENSThu Sep 21 1989 15:396
    Along these lines, does anybody have any suggestions as to how I
    could trick Grabbit into seeing a ctrl-alt-s from AmigaBASIC?  What
    I want to do is snapshot my BASIC output screen under program control.
    
    len.
    
2906.13not much help, but...WJG::GUINEAUImpossible ConcentrationThu Sep 21 1989 21:157
I believe there were recently (past year) some articles in Amazing Computing
(?) on "Using Intuition from AmigaBASIC".

I guess all you need is to get IntuiEvents of the RAWKEY class,and then look
for the keypress you want.

John