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.Linenumber_from_Position

Previous Top Next


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:

 

TXT.Load Textfile

TXT.Clear

TXT.Get_pure_Text

!TXT. - Text File Engine

TXT.Load Textfile

TXT.Clear

TXT.From_Var

OPT. - Optional Settings

TXT.Load Unicode_File

TXT.Load_pure_Text

TXT.Save_File

  Push_Intern

  Pop_Intern  

  Push_Keep

  Pop_Keep

  Clear_Intern

  TXT.To_Var

  TXT.From_Var

  TXT.To_Var_and_Clear

  TXT.Get_Filename

  TXT.Get_Lenght