Hi all,
I have a problem that is driving me nuts... I am trying to select text that sits between 2 token characters.
The following code illustrates my problem.
Now if this is run over the following text :-
0012345678900
0012345678900
0012345678900
0012345678900
0012345678900
0012345678900
The result output is:-
9
9
9
9
9
9
Script succeeded.
Why is just the "9" being returned? I would have thought that "123456789" would have be returned. Maybe I'm missing something?
Thanks
Anthony.
I have a problem that is driving me nuts... I am trying to select text that sits between 2 token characters.
The following code illustrates my problem.
Code: Select all
//--------------------------------------
UltraEdit.outputWindow.showWindow(true);
UltraEdit.outputWindow.clear();
// start at top
UltraEdit.activeDocument.top();
// set search values
UltraEdit.activeDocument.findReplace.matchWord = false;
// loop to end of file
var done = false;
while (!UltraEdit.activeDocument.isEof() && !done)
{
// find the start
UltraEdit.activeDocument.findReplace.find("1");
if (UltraEdit.activeDocument.isFound())
{
// found, now start the selection and then find the last char
UltraEdit.activeDocument.startSelect();
UltraEdit.activeDocument.findReplace.find("9");
if (UltraEdit.activeDocument.isFound())
{
// ok, have that, now grab the text
UltraEdit.activeDocument.endSelect();
var s = UltraEdit.activeDocument.selection;
UltraEdit.outputWindow.write(s);
}
else
{
// done
done = true;
}
}
else
{
// done
done = true;
}
}
//--------------------------------------
0012345678900
0012345678900
0012345678900
0012345678900
0012345678900
0012345678900
The result output is:-
9
9
9
9
9
9
Script succeeded.
Why is just the "9" being returned? I would have thought that "123456789" would have be returned. Maybe I'm missing something?
Thanks
Anthony.