|
Post by George on May 27, 2021 12:18:10 GMT -5
Robert: Good job for a simple macro.
George
' TL.macro ' Truncate left if Get_Arg_Count <> 1 then Halt(8, "No search argument") dim txt, arg as string dim fcol, flin as long arg = Get_Arg$(1) spf_trace(off) WHILE SPF_Cmd("FIND " + arg + " NEXT") = 0 fcol = Get_Find_Col - 1: flin = Get_Find_LPtr if fcol > 0 then SPF_Cmd("LINE (" + format$(fcol) + " ." + format$(Get_LNum(flin))) end if WEND halt(0)
|
|
|
Post by George on May 27, 2021 13:16:26 GMT -5
Robert: Look carefully, the LINE command is building a shift left (nn command where nn is the column-1 of the found string.
George
|
|
|
Post by George on May 27, 2021 14:13:00 GMT -5
Yep, that works just as well.
George
|
|
|
Post by George on Jun 8, 2021 8:34:52 GMT -5
Something else I did yesterday was similar and would work as well
ALIGN ';' 25 ALL (or some suitably large column number X ALL (25 (on the X'd line)
or I guess a macro would just need
ALIGN ";" 25 ALL LINE "(25" .ZF .ZL
|
|
|
Post by George on Jun 9, 2021 10:56:56 GMT -5
Shows how flexible all the various commands are if you work at them.
George
|
|