Remember returning 0 means the file did not write. It will return true if sorry i should have wrote that better in my code it’s not lError should be lOK to be more clear.
First we wabt to make sure the lritorno variable is in fact a string since you are using writecharacter instead of $writeentirefile.
If that is the case break it before
Do lFileOps.$writecharacter(kUniTypeAnsiLatin1,lritorno) Returns lError
See what this line returns:
Do lFileOps.$openfile(lnomefile,kTrue) Returns lError
If it returns 0 (this is false) the file does not exist and you will need to use the Do lFileOps.$createfile() first if the file doesn’t exist.
Lastly make sure the variable lFileOps is an object reference mapped to the FileOps object.