Re: 4GL Reports to user defined file
Posted in 1992
Path: emory!swrinde!cs.utexas.edu!uunet!halexii!halexv!greg From: greg@halexv.uucp (Gregory F. Hogg) Newsgroups: comp.databases.informix Message-ID: <1992Jan24.135913.1068@halexv.uucp> Date: 24 Jan 92 13:59:13 GMT References: <1992Jan23.194151.21508@uwm.edu> Reply-To: greg@halexv.UUCP (Gregory F. Hogg) Organization: HOGG'S SOFTWARE; Abingdon, MD In article <1992Jan23.194151.21508@uwm.edu> peter@miller.cs.uwm.edu (Peter J Diaz de Leon) writes: >I am running INFORMIX 4GL Version 1.10.03J/2.10.03J on >and AT&T 386WGS under AT&T SYS V Release 3.2.1 > >I would like to have my 4gl reports print out >to a file specified by the user. Not hard coded >like: > > OUTPUT TO "file" > >I want file to be whatever the user enters, within reason. >I have checked the 4GL manual I tried everything I could >think of, to no avail. Any ideas? > What I do is : LET Buf = "rpt2file ", FileName OUTPUT TO PIPE Buf where the program is a simple little program I wrote to copy stdin to the given file name. rpt2file.c int main(argc, argv) int argc; char **argv; { FILE *fp; int c; /* ** ----- open output file ----- */ if((fp = fopen(argv[1], "w")) == NULL) { fprintf(stderr, "fopen(%s, w) : failed\\n", argv[1]); exit(-1); } /* ** ----- copy stdin to this file ----- */ while((c = getc(stdin)) != EOF) putc(c, fp); /* ** ----- close the output file ----- */ fclose(fp); } -- +++++++++++++++++ +++++++++++++++++++ Greg Hogg +++ +++