home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / database / 7787 < prev    next >
Encoding:
Internet Message Format  |  1992-11-11  |  2.5 KB

  1. Path: sparky!uunet!ogicse!psgrain!hippo!shrike.und.ac.za!pc17.cc.und.ac.za!lotter
  2. From: lotter@cc.und.ac.za (Eddie Lotter)
  3. Newsgroups: comp.databases
  4. Subject: Re: Clipper 5.01 warning.
  5. Message-ID: <lotter.110.721569977@cc.und.ac.za>
  6. Date: 12 Nov 92 12:06:17 GMT
  7. Article-I.D.: cc.lotter.110.721569977
  8. References: <1992Nov3.212404.2892@pegasus.com> <fletcher.0269@saxon.UUCP>
  9. Organization: University Of Natal (Durban)
  10. Lines: 52
  11. NNTP-Posting-Host: pc17.cc.und.ac.za
  12.  
  13. fletcher@saxon.UUCP (Edward F Eaglehouse) writes:
  14.  
  15. >The first, if you are are not using SET EXCLUSIVE ON, is that the file you
  16. >are printing to will be locked when you try to read it.  Unless you close it
  17. >with the SET PRINTER TO command beforehand.  The low level file functions
  18. >Clipper provides do not give any way to open a file in shared mode, and I
  19. >would guess that the same is true of the redirection functions (SET PRINTER
  20. >TO and SET ALTERNATE TO).
  21.  
  22. No, I'm not trying to read the file I'm writing to.
  23.  
  24. >The second problem, and what is the most likely source of what you are
  25. >experiencing, is that the file you are writing to is buffered.  Trying to
  26. >use MemoRead() to read the file that may not be completely written will not
  27. >yield the results you wanted.  I presume you are using these functions to
  28. >write a report that a user can scroll through.
  29.  
  30. No again. I'm simply writing to a temporary text file to give the user
  31. the option of saving to a file they specify, or print it.
  32.  
  33. Basically I did something like the following:
  34.  
  35. Set Printer to PRINT.TMP
  36. Set Device to Printer
  37.  
  38. /* various @y,x say 's here. */
  39.  
  40. cTextFile := "DSR" + LTrim( Str( Dsr->DsrNum, 5, 0 ) ) + ".TXT"
  41. cText := MemoRead( cTextFile )
  42.  
  43. etc...
  44.  
  45. At this point cText will continually receive "" instead of the actual
  46. contents of the text file, which *does* exist and *does* have a few
  47. lines of text.
  48.  
  49. Now horror of all horrors, I took Tom's advice and wrote the bare
  50. bones necessary to reproduce the problem and (you guessed it!)
  51. no problem! It worked fine.
  52.  
  53. So I immediately suspected I had a handle problem, but a quick
  54. check for the number of handles available put paid to that idea.
  55. I am still trying to find what else could possibly be influencing
  56. this simple bit of code to the extent that it does not work.
  57.  
  58. I'll have to get back to you when (if?) I get to the bottom of it.
  59. Cheers
  60. Eddie                                              lotter@cc.und.ac.za
  61. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62. Most people ask for happiness on condition. Happiness
  63. can be felt  only if you  don't set  any  conditions.
  64. - Arthur Rubenstein
  65.