String-Commands * TXT-Command

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > TXT. Text-File Engine > Get Lines and Text >

String-Commands * TXT-Command

TXT.Get_Line_Position

Previous Top Next


MiniRobotLanguage (MRL)

 

TXT.glp

TXT.Get_Line_Position
Get Byte-Position of Line with the specified Number from TXT.-internal Buffer into Variables.

 

 

 

Intention

 

This Command is used to get a specified Line-Position from the Text that is in the Internal TXT-Buffer into a Variables.

Variable P2 will contain the number of the first byte of Line Nr. P1. Variable P3 will contain the number of the last character of Line P1,

the following $crlf$ is not included. Threrefore if a line is followed by $crlf$ then these bytes will come after P3.

 

' Get Line Number $$NUM into $$LIN

VAR.$$LAA=?path\..\Pics\Test.txt

TXT.lft|$$LAA

$$NUM=15

' Get star- and ENd-Byte from Line 15

TXT.glp|$$NUM|$$STA|$$END

CFF.$$LAA|$$TXT

GSS.$$STA|$$END|$$TXT|$$LAE

' Line is now in $$LAE

LEN.$$LAE|$$RES

MBX.Line 10 is: $crlf$ $$LIN

 

 

Syntax

 

 

TXT.glp|P1|P2|P3

TXT.Get_Line_Position|P1|P2|P3

 

 

Parameter Explanation

 

P1 - (Input,numeric) Variable with Line-Number.

P2 - (Output) Variable will contain the Start-Byte of the specified Line. If omitted, the result is placed on TOS.

P3 - (Output) Variable will contain the End-Byte of the specified Line. If omitted, the result is placed on TOS.

 

 

Example

 

'*****************************************************

' EXAMPLE 1: TXT.glp

'*****************************************************

' Get Line Number $$NUM into $$LIN

VAR.$$LAA=?path\..\Pics\Test.txt

TXT.lft|$$LAA

$$NUM=15

' Get star- and ENd-Byte from Line 15

TXT.glp|$$NUM|$$STA|$$END

CFF.$$LAA|$$TXT

GSS.$$STA|$$END|$$TXT|$$LAE

' Line is now in $$LAE

LEN.$$LAE|$$RES

MBX.Line 10 is: $crlf$ $$LIN

ENR.

 

 

Remarks

 

-

 

Limitations:

 

-

 

 

See also:

 

•   TXT.Load Textfile

•   TXT.Clear

•   TXT.From_Var

•   TXT.Load_pure_Text

•   TXT.Get_pure_Text

•   FIL.Generate numbered Name

•   FIL.Move numbered File

•   ATF - Append-to-File

•   CFF. - Copy-From-File

•   CTF - Copy-To-File

•   COP. - Copy File

•   TXT.Get_Filename

•   TXT.Get_Lenght

•   TXT.To_Var_and_Clear

•     GLC. - Get-Line-Count

•     TXT.Get_Line

•     IEF. / NEF. - If - exist - File

•     LFF - Line-From-File

•     WFF. - Wait-For-File

•     REN. - Rename File/Dir