Post by Stefan on Jan 13, 2022 11:17:37 GMT -5
Hi George,
I think an error has crept in that affects macros which expect to capture pending line commands.
I believe the functions Get_Src_LCmd$ and Get_Dest_LCmd$ no longer return any value.
I cannot tell you when the problem started, but I can confirm that all was well in v21149 (found on a 'forgotton-I-had-this' Samsung Netbook).
My recent versions only go back to v21289 and it was broken by then, as well as in all more recent versions.
One of my macros 'captures' any pending line commands using the code segment below, in order replace them after it has finished doing its 'thing'.
Problem is, it doesn't capture anything any more.
The SPF_DEBUG statements display only empty strings.
'---------------------------------------------------------------------------------------
' Capture details for any pending line commands
' Uses Line handles because line pointers/numbers may change during macro execution
'---------------------------------------------------------------------------------------
srcCmd$ = Get_Src_LCmd$
IF srcCmd$ <> "" THEN ' If there's a SOURCE line command
src1Hnd$ = Get_Handle$(Get_Src1_Lptr) ' Capture the line range
src2Hnd$ = Get_Handle$(Get_Src2_Lptr)
END IF
dstCmd$ = Get_Dest_LCmd$
IF dstCmd$ <> "" THEN ' If there's a DESTINATION line command
dst1Hnd$ = Get_Handle$(Get_Dest1_Lptr) ' Capture the line range
dst2Hnd$ = Get_Handle$(Get_Dest2_Lptr)
END IF
SPF_Debug("BEFORE: srcCmd$=["+srcCmd$+"] handles are ["+src1Hnd$+"] ["+src2Hnd$+"]")
SPF_Debug(" dstCmd$=["+dstCmd$+"] handles are ["+dst1Hnd$+"] ["+dst2Hnd$+"]")
<Macro does its "thing" here>
'---------------------------------------------------------------------------------------
' Restore any line commands that were pending when LP macro started
' Remove the line handles (handles are persistent especially with STATE ON)
'---------------------------------------------------------------------------------------
SPF_Debug("AFTER: srcCmd$=["+srcCmd$+"] handles are ["+src1Hnd$+"] ["+src2Hnd$+"]")
SPF_Debug(" dstCmd$=["+dstCmd$+"] handles are ["+dst1Hnd$+"] ["+dst2Hnd$+"]")
IF srcCmd$+dstCmd$ <> "" THEN
IF srcCmd$ <> "" THEN ' If there were SOURCE line command(s)
SPF_Cmd("LINE "+srcCmd$+" "+src1Hnd$) ' Re-place on the relevant line(s)
SPF_Cmd("LINE "+srcCmd$+" "+src2Hnd$)
temp$ = Drop_Handle$(src1Hnd$) ' Drop the associated line handles
temp$ = Drop_Handle$(src2Hnd$)
END IF
IF dstCmd$ <> "" THEN ' If there were DEST line command(s)
SPF_Cmd("LINE "+dstCmd$+" "+dst1Hnd$) ' Re-place on the relevant line(s)
SPF_Cmd("LINE "+dstCmd$+" "+dst2Hnd$)
temp$ = Drop_Handle$(dst1Hnd$) ' Drop the associated line handles
temp$ = Drop_Handle$(dst2Hnd$)
END IF
END IF
Halt(G_myRC,G_msg$)