String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands > !STR.- String Command >

String Operations

STR.NInstr

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.nis

STR.NInstr
Instring Command, will search for the n'th search-Terms in one run.

 

 

Intention

 

This command is used to find the n'th match of a search Termin in Mainstring.

It will return the Position of the found Term.

 

$$OUT=?exeloc\Result.txt

$$TXT=<ABCDEFG>$crlf$<123456>$crlf$<abcdEFg>$crlf$

$$SEA=EF

$$POS=1

$$NUM=2

STR.nis|$$TXT|$$SEA|$$NUM|$$POS|$$RES

DMP.6

MBX.$$RES

ENR.

 

Result:

clip0370

 

The Text was found at Position 27.

 

 

$$OUT=?exeloc\Result.txt

$$TXT=<ABCDEFG>$crlf$<123456>$crlf$<abcdEFg>$crlf$

$$SEA=ef

$$POS=1

$$NUM=2

STR.nis|$$TXT|$$SEA|$$NUM|$$POS|$$RES

DMP.6

MBX.$$RES

ENR.

 

Result:

clip0371

 

The Text "ef" was not found.

 

 

 

Syntax

 

 

STR.nis|P1|P2|P3[|P4][|P5]

STR.NInstr|P1|P2|P3[|P4][|P5]

 

 

Parameter Explanation

 

P1 - (Mainstring,Text) Variable with Text (Mainstring).

P2 - (Input,Text) Variable with the Text to search for.

P3 - (Input,Numeric) Variable with Number of the wanted appearance of the search term.

P4 - (Input,Numeric) Variable with Starting-Position from where the Search will start.

P5 - (Output,Numeric) Variable that will contain the result. The result will also be put on TOS.

 

Example

 

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

' EXAMPLE 1: STR.nis

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

$$OUT=?exeloc\Result.txt

$$TXT=<ABCDEFG>$crlf$<123456>$crlf$<abcdEFg>$crlf$

$$SEA=CD

$$POS=1

$$NUM=1

STR.nis|$$TXT|$$SEA|$$NUM|$$POS|$$RES

DMP.6

MBX.$$RES

ENR.

 

 

clip0372

 

Remarks

 

-

 

Limitations:

 

-

 

 

See also:

 

    1.5.2 Working with Text-Strings

    VAR. - Variable Set Value/Clear

    VAS. - Variable with String

    RPL. - RePLace in String

    IVS. / NVS. - If-Variable-String

    GSS. - GetSplitString

    GFS. - Get-Filtered-String

    GES. - Get-Extracted-String

    SBD. - String between Delimiter

    SBM. - String between Delimiter-Multiple

    FEM. - For Each Member

    LEN. - Length-of-String