|
Post by Stefan on Oct 10, 2022 13:03:22 GMT -5
If a line command MACRO issues a HALT(OK,...), all is well. The message (if any) is displayed as expected, the command line remains clear.
If HALT(WARN,....) or HALT(FAIL,...) is used, the error message appears correctly, and the macro's name is placed on the command line. This is fine if the macro was a primary command, but inappropriate for a line command macro.
Ideally, the line macro command would remain in the line command area under such circumstances, but I imagine this is probably a quite tricky, so I'll settle for not having a line macro command appear in the primary command line.
In addition, HALT(nn,msg) behaves strangely when 'nn' is an odd number (1,3,5, etc). In these cases, the primary command line contains whatever command was issued by the most recent SPF_CMD() before the HALT statement. Probably also not as it should be, but at least avoidable by coding a blank SPF_CMD(" ") statement before the HALT statement.
|
|
|
Post by George on Oct 11, 2022 10:14:44 GMT -5
Stefan: I could not get the error in your last paragraph to occur, however I did clear up the LineCmd appearing on the Primary command line.
George
|
|
|
Post by Stefan on Oct 12, 2022 1:59:46 GMT -5
George,
I probably explained it badly. The error occurs when the return code is an odd neumber.
Try this (which incorrectly leaves the word "rubbish" in the primary command line...
' CK.MACRO SPF_CMD("rubbish") HALT(1,"msg")
and compare with this (which correctly leaves the primary command line blank)
' CK.MACRO SPF_CMD("rubbish") HALT(2,"msg")
|
|
|
Post by George on Oct 12, 2022 15:46:06 GMT -5
Stefan: Interesting CK macros. Yes indeed, it makes no logical sense. The logic basically treats all non-zero RC the same.
Except the CK macro disproves that, should be an interesting debug session.
George
|
|
|
Post by George on Oct 13, 2022 9:25:58 GMT -5
Stefan: As it turns out, an RC=2 has other meanings internally. Looking closer, it appears using anything other than 0 and 8 (OK / FAIL) in a macro can cause weirdness. I'm going to close that off, there's no simple way to just 'allow anything through' without interfering with the internal usage of error codes (there are 7 in use)
I'll change the doc and the code to allow only 0 and 8.
George
|
|
|
Post by George on Oct 13, 2022 11:59:51 GMT -5
Didn't forget - WARN is removed as well. There's no way around it I'm afraid. The RC is used for a lot more internally than just being a relative measure of severity.
George
|
|
|
Post by Stefan on Oct 13, 2022 12:35:24 GMT -5
I think you can deprecate WARN and just change it internally to issue RC=8 instead of RC=4. That way you don't force everyone to immediately change all their macros (not that it would be hard to do with SPFLite as a tool!)
|
|