home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / 9357 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  2.4 KB

  1. 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
  2. From: cocks_d@kosmos.wcc.govt.nz
  3. Newsgroups: comp.databases
  4. Subject: Re: dBASE III+/Foxbase Question
  5. Date: 23 Jan 1993 20:52:32 GMT
  6. Organization: Wellington City Council (Public Access), Wgtn, Nz
  7. Lines: 67
  8. Message-ID: <1jsb6gINN5kj@golem.wcc.govt.nz>
  9. References: <1993Jan22.103546.2528@ucbeh.san.uc.edu>
  10. Reply-To: cocks_d@kosmos.wcc.govt.nz
  11. NNTP-Posting-Host: kosmos.wcc.govt.nz
  12.  
  13. In article <1993Jan22.103546.2528@ucbeh.san.uc.edu>, torbecvs@ucbeh.san.uc.edu writes:
  14. >To whomever can possibly help me,
  15. >    I am using dBASE III+ and Foxbase.  Simple question (I hope!)
  16. >
  17. >    How do you send output to a file?  To be a little more specific, I
  18. >would like to give the user the option to output send to the screen, to a
  19. >printer, or to a user specified filename.  I figure that it has something to do
  20. >with: 
  21. >    SET PRINTER TO (<device>
  22. >        or
  23. >    redirecting using a DOS command
  24. >
  25. >Am I close?!  Thanks ahead for any help,
  26. >    VST
  27.  
  28. DO something like the following:
  29.  
  30. STORE "" TO METHOD
  31. @10,10 say "Output method (S)creen, (P)rinter or (F)ile"
  32. DO WHILE .T. && Endless loop which will be broken by the EXIT command
  33.  @10,2 get METHOD
  34.  READ
  35.  IF METHOD $ "SPFspf" && Does the letter S,P or F appear in variable METHOD?
  36.   EXIT
  37.  END IF
  38. ENDDO
  39. DO CASE
  40.  CASE METHOD $ "Ss"
  41.   && Don't do a thing cause will default to screen
  42.  CASE METHOD $ "Pp"
  43.   SET CONSOLE OFF && Turn off screen
  44.   SET PRINTER ON
  45.  CASE METHOD $ "Ff"
  46.   STORE "" to FILENAME
  47.   @12,10 say "Name of file" GET FileName
  48.   READ
  49.   SET CONSOLE OFF
  50.   SET ALTERNATIVE TO FileName
  51. END CASE
  52.  
  53. ... now put code to output to screen, printer or file
  54.  
  55. ... and tidy up housekeeping
  56. SET PRINTER OFF
  57. SET CONSOLE ON
  58. CLOSE ALTERNATIVE
  59. SET ALTERNATIVE TO
  60.  
  61. Good luck with the above code
  62.  
  63. Regards, Derryl.
  64.  
  65. ________________________________________________________________________________
  66. Mail:     Derryl Cocks, Analyst/Programmer
  67.     New Zealand Fire Service, PO Box 2133
  68.     Wellington, New Zealand
  69. Phone:    (4)4724969  Fax: (4)4781603  International: +64 4 47.... 
  70. Email:    "cocks_d@kosmos.wcc.govt.nz"
  71. ________________________________________________________________________________
  72.  
  73.  
  74. ________________________________________________________________________________
  75. Mail:     Derryl Cocks, Analyst/Programmer
  76.     New Zealand Fire Service, PO Box 2133
  77.     Wellington, New Zealand
  78. Phone:    (4)4724969  Fax: (4)4781603  International: +64 4 47.... 
  79. Email:    "cocks_d@kosmos.wcc.govt.nz"
  80.