How can i exclude chr(26) (ESC character) from the end when i use memowrit?
Regards
A.S.K
Vladimir Grigoriev wrote:In Clipper MEMOWRITE() is nothing more than sequence of the functions fopen(), fwrite(), fclose(). The only thing MEMOWRITE() does itself is appending EOF character. Though I don't use Harbour but I think the same is justly for Harbour. So you can use fopen(), fwrite(), fclose() functions by youself instead of MEMOWRITE(). Though it is better to know what will say Harbour guru.
Vladimir Grigoriev wrote:As I have understood the new function MEMOWRITE() has three parameters. The third parameter of type Logical specifies either to write EOF character ( .T. by default) or not (.F.).
So you should specify MEMOWRITE() function with three parameters and the third parameter should be specified as .F..
I think you mean this code :
if( hb_parinfo(0) == 3 && ISLOG( 3 ) )
bWriteEof = hb_parl( 3 );
Vladimir Grigoriev wrote:I think you mean this code :
if( hb_parinfo(0) == 3 && ISLOG( 3 ) )
bWriteEof = hb_parl( 3 );
Yes I have meant this code above. So maybe there is a bug in your Harbour build or there is another idea. What about your string data <text> contains EOF character itself? Can you test last character of your data before you will write on a disk it with MEMOWRITE()?
Vladimir Grigoriev wrote:Unfortunately I can not test your code as I have not Harbour. From the source code of memofile.c one should conclude that MEMOWRITE() will work correctly i.e. it will write into file without EOF character if the third parameter will be set to .F..
By the way how do you determine that EOF character does present in you file? What is the file size of cc.txt?
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 64 guests