Article View: comp.sys.atari.st
Article #30571Re: Print redirection routine
From: John Stanley
Date: Mon, 08 Feb 1988 09:49
Date: Mon, 08 Feb 1988 09:49
54 lines
2347 bytes
2347 bytes
>In article <8801271313.AA10750@lasso.laas.fr>,
>ralph@lasso.UUCP (Ralph P. Sobek) writes:
>> To: inria!score.stanford.edu!info-atari16
>> Subject: Print redirection routine
>>
>> what I'm looking for is an assembler or C program which would redirect
>> the output of one of these programs to an ascii file rather than the printer.
The best program to accomplish this is called barrel written by
Moshe Braner. It has several functions to allow capturing text or
screen dumps to a file. It is TSR (terminate & stay resident) which
may or may not be what you originaly wanted, but it is good and it
works....
In article <15@obie.UUCP> wes@obie.UUCP (Barnacle Wes) writes:
>You can redirect the output to printer in your program via the
>following:
>
[part of sample deleted]
> /* Now execute the program, the standard handles are inherited. */
> Pexec(0, "disk:/program/name/path.prg", NULL, tail);
>....
>
> Hope this helps whoever it was!
Not likely... The example you gave will bomb miserably... The
parameters you gave for Pexec are in the wrong order and ignore an
important pecularity in the Pexec call (the command tail is a Pascal
style string, not a C style string).
The correct order for Pexec parameters is:
Pexec mode: zero is fine
Program name: standard C string format
Command tail: a pointer to a Pascal style string (a string
with the character count in the first byte!)
Environment: A pointer to an environment block or NULL if
you want to use the default environment.
Thus, a corrected version would read:
static unsigned char tailbuf[255];
....
tailbuf[0] = strlen(tail);
strcpy(tailbuf+1,tail);
Pexec(0, "A:\\folder1\\folder2\\program.ttp", tailbuf, (char*)NULL);
---
John Stanley (john@viper.UUCP)
Software Consultant - DynaSoft Systems
UUCP: ...{amdahl,ihnp4,rutgers}!meccts!viper!john
Technical Details
Message-ID:
<595@viper.Lynx.MN.Org>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!rutgers!uwvax!umn-d-ub!umn-cs!mmm!ems!viper!johnReferences:
<8801271313.AA10750@lasso.laas.fr> <15@obie.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!rutgers!uwvax!umn-d-ub!umn-cs!mmm!ems!viper!john From: john@viper.Lynx.MN.Org (John Stanley) Newsgroups: comp.sys.atari.st Subject: Re: Print redirection routine Message-ID: <595@viper.Lynx.MN.Org> Date: 8 Feb 88 09:49:38 GMT References: <8801271313.AA10750@lasso.laas.fr> <15@obie.UUCP> Reply-To: john@viper.UUCP (John Stanley) Organization: DynaSoft Systems Lines: 54