Good afternoon
Can you tell me why MemoWirit writes strange characters at the end of the last line?
Problem with MemoWirit
Problem with MemoWirit
- Attachments
-
- MemoWirit.jpg (134.98 KiB) Viewed 11974 times
Nolberto Paulino
Regards
Regards
Re: Problem with MemoWirit
MemoWrit() adds an EoF-character to the file contens (HEX 1A, Dec 26). Use StrFile() instead (take care - parameters are exchanged), or the low level functions.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Problem with MemoWirit
Hi,
You can use this as a replacement:
You can use this as a replacement:
Code: Select all
function abomemowrite(cTargetFile,cBuffer)
******************************************
Local nTarget := FCreate( cTargetFile, FC_NORMAL )
if nTarget == -1
return .F.
else
FWrite( nTarget, cBuffer)
FClose(ntarget)
endif
return .T.
Re: Problem with MemoWirit
This.
Also memoread/memowrit is not that good when using UTF-8 data ; it tries to do some chardata conversion on its own. Found it the hard way when using xml with international IBAN processing resoults years ago.
Using regular fileio functions is much safer choice.
Also memoread/memowrit is not that good when using UTF-8 data ; it tries to do some chardata conversion on its own. Found it the hard way when using xml with international IBAN processing resoults years ago.
Using regular fileio functions is much safer choice.
skiman wrote: ↑Mon Dec 18, 2023 1:47 am Hi,
You can use this as a replacement:Code: Select all
function abomemowrite(cTargetFile,cBuffer) ****************************************** Local nTarget := FCreate( cTargetFile, FC_NORMAL ) if nTarget == -1 return .F. else FWrite( nTarget, cBuffer) FClose(ntarget) endif return .T.
Re: Problem with MemoWirit
StrFile() does the same, without any conversions.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."