TextBuffer.find Method [AX 2012]
Searches the TextBuffer object for any occurrence of a string expression.
public boolean find(str searchText, [int start])
Run On
CalledThe following example searches the TextBuffer object for all occurrences of a specified string and prints the position at which the match is found.
int pos;
TextBuffer textBuffer;
textBuffer = new TextBuffer();
textBuffer.setText("ABC DEF GHI JKL MNO ABC ABC");
pos = 0;
while (textBuffer.find("ABC",pos))
{
print "String found at position: ", textBuffer.matchPos();
pause;
pos = textBuffer.matchPos()+1;
}
Community Additions
ADD
Show: