• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

BSFN code to set return code to 2

johndanter

Legendary Poster
Hi folks,

I am writing a little NER that needs to throw an error back to the calling PGM. (DC Link)

In the past I've used
Set NER Error(BF szErrorMessageKey, <None>)

and then
Set NER Return Code
(= 2)

This works fine but for some reason, this time it isn't

All the N3DNxxxx DC Link BSFNs also do this and even when I call them and test them myself they do this. I can't fathom this out as it should be very simple.

Any ideas list? How do you do it?

Thanks

John

EDIT: For future readers: Set NER Return Code needs to be the last BSFN call in your code before you exit. Thanks to Craig Welton
 
Last edited:

johndanter

Legendary Poster
It's working!

I just deleted the code and entered it again from scratch. Must have been a previous dodgy cut and paste
 

craig_welton

Legendary Poster
John, any chance you are calling another BSFN after Set NER Return Code? I believe that will change the error status.

Craig
 

johndanter

Legendary Poster
Hi Craig,

It's working now. Really annoyed as I've wasted a day on this :)

Craig, you are right - I was calling Get Error With Text Substitution afterwards :)

So this needs to be the last thing before you exit?

Tested twice and it works. The instant I move the code it stops. So thanks mate
 
Last edited:
Top