home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!darwin.sura.net!sgiblab!munnari.oz.au!comp.vuw.ac.nz!newshost.wcc.govt.nz!kosmos.wcc.govt.nz!COCKS_D
- From: cocks_d@kosmos.wcc.govt.nz
- Newsgroups: comp.databases
- Subject: Re: dBASE III+/Foxbase Question
- Date: 23 Jan 1993 20:52:32 GMT
- Organization: Wellington City Council (Public Access), Wgtn, Nz
- Lines: 67
- Message-ID: <1jsb6gINN5kj@golem.wcc.govt.nz>
- References: <1993Jan22.103546.2528@ucbeh.san.uc.edu>
- Reply-To: cocks_d@kosmos.wcc.govt.nz
- NNTP-Posting-Host: kosmos.wcc.govt.nz
-
- In article <1993Jan22.103546.2528@ucbeh.san.uc.edu>, torbecvs@ucbeh.san.uc.edu writes:
- >To whomever can possibly help me,
- > I am using dBASE III+ and Foxbase. Simple question (I hope!)
- >
- > How do you send output to a file? To be a little more specific, I
- >would like to give the user the option to output send to the screen, to a
- >printer, or to a user specified filename. I figure that it has something to do
- >with:
- > SET PRINTER TO (<device>
- > or
- > redirecting using a DOS command
- >
- >Am I close?! Thanks ahead for any help,
- > VST
-
- DO something like the following:
-
- STORE "" TO METHOD
- @10,10 say "Output method (S)creen, (P)rinter or (F)ile"
- DO WHILE .T. && Endless loop which will be broken by the EXIT command
- @10,2 get METHOD
- READ
- IF METHOD $ "SPFspf" && Does the letter S,P or F appear in variable METHOD?
- EXIT
- END IF
- ENDDO
- DO CASE
- CASE METHOD $ "Ss"
- && Don't do a thing cause will default to screen
- CASE METHOD $ "Pp"
- SET CONSOLE OFF && Turn off screen
- SET PRINTER ON
- CASE METHOD $ "Ff"
- STORE "" to FILENAME
- @12,10 say "Name of file" GET FileName
- READ
- SET CONSOLE OFF
- SET ALTERNATIVE TO FileName
- END CASE
-
- ... now put code to output to screen, printer or file
-
- ... and tidy up housekeeping
- SET PRINTER OFF
- SET CONSOLE ON
- CLOSE ALTERNATIVE
- SET ALTERNATIVE TO
-
- Good luck with the above code
-
- Regards, Derryl.
-
- ________________________________________________________________________________
- Mail: Derryl Cocks, Analyst/Programmer
- New Zealand Fire Service, PO Box 2133
- Wellington, New Zealand
- Phone: (4)4724969 Fax: (4)4781603 International: +64 4 47....
- Email: "cocks_d@kosmos.wcc.govt.nz"
- ________________________________________________________________________________
-
-
- ________________________________________________________________________________
- Mail: Derryl Cocks, Analyst/Programmer
- New Zealand Fire Service, PO Box 2133
- Wellington, New Zealand
- Phone: (4)4724969 Fax: (4)4781603 International: +64 4 47....
- Email: "cocks_d@kosmos.wcc.govt.nz"
-