|
Post by Jo on May 19, 2015 18:25:09 GMT -5
I've just started to experiment with Macros, so found some difficulties:
Found 2 interesting Macros in /MACROS/ subdirectory: LCWord.macro and UCWord.macro. Both work fine, except when the Cursor is on the last letter of the word. In this case, I see the "SPFLite Macro Loop Intercept" popup. Update: found the loop in LCWord, UCWord in the WHILE-stmt: the "- 1" is needless. See ULCWord.macro ;-)
SPF_Cmd("LINE Note !"...) issued in a BROWSE-session should return RC=8 Command not allowed in Browse mode Sometimes correct, but sometimes there is RC=0 (seen in and copied from ColSum.macro)
RC = SPF_Shell(Exit1.Bat) does not return the EXIT-code in RC, which is always 0, but Get_RC does. (Exit1.Bat just contains EXIT 1) Therefore I use: RC = SPF_Shell(Exit1.Bat) if RC = 0 then RC = Get_RC Halt("SPF_Shell RC=" + RC)
RC = SPF_Cmd("Create somefile.txt .ZF .ZL") 'always returns RC=0 (also when somefile.txt exists from last run), even with if RC = 0 then RC = Get_RC (seen in and copied from SPMConvert.MACRO, which should have the same problem. But I can't test, cause I have no .SPM file)
Jo
|
|
|
Post by George on May 20, 2015 13:49:52 GMT -5
Jo: Welcome to Macros. Found 2 interesting Macros in /MACROS/ subdirectory: LCWord.macro and UCWord.macro. Both work fine, except when the Cursor is on the last letter of the word. In this case, I see the "SPFLite Macro Loop Intercept" popup. Update: found the loop in LCWord, UCWord in the WHILE-stmt: the "- 1" is needless. See ULCWord.macro ;-) Interesting discovery, because when originally written, all those sample macros were tested to ensure they worked, but obviously we just didn't do that cursor-on-the-last-character test. I've corrected the macros for the next packaging. Thanks for spotting the error.
SPF_Cmd("LINE Note !"...) issued in a BROWSE-session should return RC=8 Command not allowed in Browse mode Sometimes correct, but sometimes there is RC=0 (seen in and copied from ColSum.macro) Checked the SPF_CMD code out, and yes, it calls a cleanup type function following the actual specified command, and that function 'loses' the RC values. So I've altered that so we don't lose the command result. But it also means the ColSum macro needs altering, since it didn't check the result of the command. I've corrected that and it will be included in the next packaging. If wanted sooner, I've attached it here as well.
ColSum.MACRO (4.66 KB)
RC = SPF_Shell(Exit1.Bat) does not return the EXIT-code in RC, which is always 0, but Get_RC does. (Exit1.Bat just contains EXIT 1) Therefore I use: RC = SPF_Shell(Exit1.Bat) if RC = 0 then RC = Get_RC Halt("SPF_Shell RC=" + RC) RC = SPF_Cmd("Create somefile.txt .ZF .ZL") 'always returns RC=0 (also when somefile.txt exists from last run), even with if RC = 0 then RC = Get_RC (seen in and copied from SPMConvert.MACRO, which should have the same problem. But I can't test, cause I have no .SPM file) This was an odd one, the code in SHELL all looked just fine and I couldn't figure out why RC wasn't being passed back properly. Even stepping through it in Debug showed it working properly. Then I spotted it, the last thing the SPF_CMD function did was an unconditional setting of RC to 0.
So, there's yet another corrected version out there:
www.SPFLite.com/Files/SPFLite825140.EX_ Just rename to SPFLite.EXE and swap into the normal install folder.
George
|
|