<< Click to Display Table of Contents >> Navigation: 3. Script Language > TXT. Text-File Engine > Insert/Delete Text > Insert_Line_at_Pos |
MiniRobotLanguage (MRL)
TXT.ilap
TXT.Insert_Line_at_Pos
Insert a Line (with an $crlf$ at the end) at the specified Byte-Position in the actual TXT.-Buffer.
Intention
This command is used to Insert a Text-Line including the needed $crlf$ before and after the Text into the internal Text-Buffer at any Position.
Let say that you have the Text:
' Insert Text/Bytes at any Place inside the TXT.Buffer
$$OUT=?exeloc\Result.txt
$$TXT=<ABCDEFG>$crlf$<ABCDEFG>$crlf$<ABCDEFG>$crlf$
TXT.Load_Pure_Text|$$TXT
$$HEA=123
$$POS=2
TXT.Insert_Line_at_Pos|$$HEA|$$POS
TXT.Save_File|$$OUT
ENR.
then the result might look like this:
<
123
ABCDEFG>
<ABCDEFG>
<ABCDEFG>
Syntax
TXT.ilap|P1|P2
TXT.Insert_Line_at_Pos|P1|P2
Parameter Explanation
P1 - (Input,Text) Variable with Line that will be Inserted at Position P2. The $crlf$ will be automatically appended.
P2 - (Input,Numeric) Variable with Byte-Position, where the Text will be inserted. The Text that was before at this position will be moved to the right side.
Example
'*****************************************************
' EXAMPLE 1: TXT.ilap
'*****************************************************
$$OUT=?exeloc\Result.txt
$$TXT=<ABCDEFG>
TXT.Load_Pure_Text|$$TXT
$$HEA=123
$$POS=2
TXT.Insert_Line_at_Pos|$$HEA|$$POS
TXT.Save_File|$$OUT
ENR.
Remarks
-
Limitations:
-
See also:
• IEF. / NEF. - If - exist - File