Post by Stefan on Feb 25, 2021 5:43:25 GMT -5
Hi George,
This may just be my misunderstanding or they may be bugs, you decide.
(1) Get_Find_xxxx where 'xxxx' is LPtr, Col, Len
I expected that the 'find_xxxx' values change only when a FIND/CHANGE, etc command (re)sets them, ie. after a command that did some kind of FINDing.
But I note that (at least one) other primary command also resets the values returned by Get_Find_xxxx.
I have a macro that issues a FIND command which completes RC=0 and sets Get_Find_LPtr to the correct value.
Based on that result, some subsequent processing takes place which invokes a subroutine via CALL AddTag(Get_Find_LPtr)
The subroutine is defined as SUB AddTag(lineP AS NUMBER).
It does some pure thinBasic processing, culminating in statement SPF_Cmd("LINE '."+lab$+"' !"+lineP) before returning.
Inside the subroutine, the value of <lineP> is correct, and the correct line is labelled.
However, the SPF_CMD("LINE...) statement resets the value returned by Get_Find_LPtr to 0.
If I comment out that statement, the value of Get_Find_Lptr in the calling procedure is still correct when the subroutines returns.
The same is true of Get_Find_Col and Get_Find_Len which are both reset to 0.
If this is 'working as designed', I think the documentation should mention that the values returned by the Get_Find_xxxx functions are not reliable after other, unrelated primary commands were issued.
(2) Set_Csr(<LinePtr>,<Column>,<HighlightLength>)
I can't get the highlighting aspect to work as described in the Help documentation.
The cursor is placed in the correct row/col, but despite a non-zero 3rd parameter, the highlight does not appear.
What magic incantation am I missing?
----
Hope you're well. Here's a 'senior moment' chuckle for you...
I just spent a good hour wondering why the WHILE clause on a FOR statement did not work.
Guess what - thinBasic and REXX are not mix'n'match!
FOR i = 1 TO eyeMax WHILE eye$(i) <> "" & selPtr = 0 doesn't work, but...
FOR i = 1 TO eyeMax WHILE eye$(i) <> "" AND selPtr = 0 is just fine!
And I even promised myself to always use '+' for concatenation so I'd never have to code '&' in a macro. D'Uh!