Subject STUFF() returns incorrect character
From John Gillen <johngillen@cox.net>
Date Sat, 02 Jan 2021 12:53:08 -0500
Newsgroups dbase.getting-started

Hello,

I am using low level file functions (FOPEN(), FEOF(), FREAD(), FWRITE() and FCLOSE() to parse a text file. As part of this parsing, I am using three commands to replace characters in the incoming file: mstring = <incoming string>; mpos = AT(<where character to replace is found in the incoming string>);  mstring = STUFF(mstring,mpos,1,"") to do the character replacement.

If I run these three steps in the Command window, it works as expected.

If I run these three steps in a program, instead of NULL, I get a comma (,).

I tried "",'', and NULL CHR(0) all with the same result - a comma.

dBASE 8/Windows 10 64bit

Any ideas/suggestions are appreciated.

John