home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!psgrain!hippo!shrike.und.ac.za!pc17.cc.und.ac.za!lotter
- From: lotter@cc.und.ac.za (Eddie Lotter)
- Newsgroups: comp.databases
- Subject: Re: Clipper 5.01 warning.
- Message-ID: <lotter.110.721569977@cc.und.ac.za>
- Date: 12 Nov 92 12:06:17 GMT
- Article-I.D.: cc.lotter.110.721569977
- References: <1992Nov3.212404.2892@pegasus.com> <fletcher.0269@saxon.UUCP>
- Organization: University Of Natal (Durban)
- Lines: 52
- NNTP-Posting-Host: pc17.cc.und.ac.za
-
- fletcher@saxon.UUCP (Edward F Eaglehouse) writes:
-
- >The first, if you are are not using SET EXCLUSIVE ON, is that the file you
- >are printing to will be locked when you try to read it. Unless you close it
- >with the SET PRINTER TO command beforehand. The low level file functions
- >Clipper provides do not give any way to open a file in shared mode, and I
- >would guess that the same is true of the redirection functions (SET PRINTER
- >TO and SET ALTERNATE TO).
-
- No, I'm not trying to read the file I'm writing to.
-
- >The second problem, and what is the most likely source of what you are
- >experiencing, is that the file you are writing to is buffered. Trying to
- >use MemoRead() to read the file that may not be completely written will not
- >yield the results you wanted. I presume you are using these functions to
- >write a report that a user can scroll through.
-
- No again. I'm simply writing to a temporary text file to give the user
- the option of saving to a file they specify, or print it.
-
- Basically I did something like the following:
-
- Set Printer to PRINT.TMP
- Set Device to Printer
-
- /* various @y,x say 's here. */
-
- cTextFile := "DSR" + LTrim( Str( Dsr->DsrNum, 5, 0 ) ) + ".TXT"
- cText := MemoRead( cTextFile )
-
- etc...
-
- At this point cText will continually receive "" instead of the actual
- contents of the text file, which *does* exist and *does* have a few
- lines of text.
-
- Now horror of all horrors, I took Tom's advice and wrote the bare
- bones necessary to reproduce the problem and (you guessed it!)
- no problem! It worked fine.
-
- So I immediately suspected I had a handle problem, but a quick
- check for the number of handles available put paid to that idea.
- I am still trying to find what else could possibly be influencing
- this simple bit of code to the extent that it does not work.
-
- I'll have to get back to you when (if?) I get to the bottom of it.
- Cheers
- Eddie lotter@cc.und.ac.za
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Most people ask for happiness on condition. Happiness
- can be felt only if you don't set any conditions.
- - Arthur Rubenstein
-