Oh does the @serror actually say operation completed successfully. I did not try that as I misunderstood the example instructions to mean that I put my own error message in.

It is very unusual (as far as I am aware) to have -1 as a successful outcome! I would expect it to be 0. Oh well, mystery explained!

One of my jobs soon is to add a global @error, @serror to the entire sript as even Chatgpt says I need to add @error functionality in! I am just busy with other aspects of my coding at the moment, removing obsolete coding that is not being used anymore, using Chatgpt to optimise my existing coding - did wonders for my XML load script - two thirds of the original coding is gone!

But on the whole, my scripts work really well. When I did a complete of the code about 2 years ago, I really improved the flow of the script and removed a lot of duplicate files for each user group and thus duplicate coding. Now, I am just tweaking to the nth degree as I have time!