<< Click to Display Table of Contents >> Navigation: 3. Script Language > TXT. Text-File Engine > Get Lines and Text > String-Commands * TXT-Command |
MiniRobotLanguage (MRL)
TXT.lnp
TXT.Linenumber_from_Position
Get Line-Number in TXT.-internal Buffer from a Byte-Position.
Intention
This command is used to get a specified Line-Number from a Byte-Position, from the Text that is in the Internal TXT-Buffer.
Variable P2 will contain the Line Nr. P1 contains the Byte-Position.
For example, you have found something at Byte Postion 120 and now you want to know "Which Line is it?".
This Command can be used to work with Bytes on a "Line by line" base through a file without accessing the file on the harddrive.
' Get Line Number from byte 5
TXT.lnp|5|$$LAC
MBX.Byte 5 is in Line Nr.$$LAC
Syntax
TXT.lnp|P1[|P2]
TXT.Linenumber_from_Position|P1[|P2]
Parameter Explanation
P1 - (Input,numeric) Variable with Byte-Position.
P2 - (Output) Variable will contain the Line-Number.If omitted, the result is placed on TOS.
Example
'*****************************************************
' EXAMPLE 1: TXT.gel
'*****************************************************
VAR.$$LAA=?path\..\Pics\Test.txt
TXT.ltf|$$LAA
$$BYT=5
TXT.lnp|$$BYT|$$LIN
' Now we get the Linenumber from the line that contains Byte 5
MBX.Byte 5 is in Line: $$LIN
ENR.
Remarks
-
Limitations:
-
See also:
• Pop_Keep