String-Commands * TXT-Command

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > TXT. Text-File Engine > Load / Save Commands >

String-Commands * TXT-Command

TXT.Load_Textfile

Previous Top Next


MiniRobotLanguage (MRL)

 

TXT.ltf

TXT.Load_Textfile

Load a Textfile into the internal Buffer for further Operations using other TXT.-Commands

 

NTFS-Direct

 

Intention

 

This command is used to load a Textfile into the internal Buffer of the TXT.-Commands.

From there you can do all sorts of operations on the file without accessing the harddrive.

 

' Load Textfile into intrnal Buffer for further TXT.-Command Operations

' $$RES is 0 in case of error

' returns number of loaded lines in case of success

TXT.Load_Textfile|$$FIL|$$RES

MBX.Operation was succesfull, Lines loaded: $$RES

 

 

 

Syntax

 

 

TXT.ltf|P1[|P2]

TXT.Load_Textfile|P1[|P2]

 

 

Parameter Explanation

 

P1 - Filename and Path of the Textfile to load.        

   

P2 - (Output) Variable with the result of the operation.
 On error a "0" is returned also the Timeout-Flag is set.
 On succes, the number of loaded lines is returned.

 If omitted the result is placed on TOS.

 

Speed in Ticks:

This command depends heavily on teh general file-system speed and the size of the Textfile. The command uses typically around 2500 Ticks with a small Textfile.

 

 

Example

 

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

' EXAMPLE 1: TXT.ltf  and TXT.gpt and TXT.gtl

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

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

TXT.ltf|$$LAA|$$RES

TXT.gpt|$$RES

VAN.$$LAB=0

LEN.$$RES|$$LAB

JIV.$$LAB!1040|Lab_failed

VAN.$$LAC=0

TXT.gtl|$$LAC

JIV.$$LAB!1040|Lab_failed

ENR.

 

 

Remarks

 

Can acess very large pathes up to 32767 characters due to the use of NTFS-direct.

 

Limitations:

 

-

 

 

See also:

 

!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.Load Textfile

  TXT.Clear  

  TXT.To_Var

  TXT.From_Var

  TXT.To_Var_and_Clear

  TXT.Get_Filename

  TXT.Get_Lenght