Post by Stefan on Oct 9, 2024 7:58:43 GMT -5
George,
I think the description for TRACKIDs is open to misinterpretation.
There are two sections where the nature is described as part of the Get_Trk_TrkID(LPtr) function.
(1) Working with SPFLite - Tracking Screen Positions
(2) Help for GET_Trk_TrkID function
"Every line in an Edit session has a permanently assigned Track ID. The ID is assigned once, and is never changed or removed. Obtaining this ID allows a macro to obtain a guaranteed pointer to a specific data line.
The operand is a normal line-pointer (NOT a Line Number)
The answer returned is the assigned Track ID (a simple numeric value)
The Return-code should be checked before using the return value, since an invalid line-pointer will simply return a zero. This could occur if the line-pointer references a line which has been deleted."
The answer returned is the assigned Track ID (a simple numeric value)
The Return-code should be checked before using the return value, since an invalid line-pointer will simply return a zero. This could occur if the line-pointer references a line which has been deleted."
The words in bold may lead a user to interpret this as "once assigned, a Track ID stays with the line as long as the line exists".
But that is incorrect.
If a line is moved (M/MM line command), that line's Track ID changes.
Effectively a line "move" is treated like a "DELETE line" followed by an "INSERT line".
That all makes perfect sense, given the purpose for which Track IDs were introduced.
To avoid misconceptions, I suggest rephrasing the documentation to describe the behaviour of the TRACK ID more precisely, e.g.
"A Track ID is a unique numerical 'token', assigned to every line in an Edit session when a file is loaded, and whenever a new line is created.
Once assigned, a line's Track ID remains unchanged unless the line is deleted.
If a line is moved (M/MM line command) to a new place within the file, the original line is treated as having been deleted and a new line added in the new location.
The numerical value of the token does not imply any sequence or order of lines within the file."
The operand is a normal line-pointer (NOT a Line Number)
The answer returned is the assigned Track ID (a simple numeric value)
The Return-code should be checked before using the return value, since an invalid line-pointer will simply return a zero. This could occur if the line-pointer references a line which has been moved or deleted.
I think it might also be useful to place a link in the "(2) GET_Trk_TrkID function" referring the user to the (1) Tracking Screen Positions section.