dorkauf89
03-10-2008, 08:08 PM
Hi.... What I want to do is search for some text in an input object. The inputtext variable is what I want to find in the input object. The text variable is the text in the input object. I want to convert this java script to autoplay script but it is confusing and I don't know how... I started and did good until I got to the hard part... Can anyone please convert the following java script to work on autoplay?:
String inputtext = "inputed text";
String text = "pad text";
int start = 0;
int end = 0;
int lengthofinputtext = inputtext.length;
int lengthoftext = text.length;
for (i = 0; i<lengthoftext; i++) {
for (h = 0; h<lengthofinputtext; h++) {
String now = text.charAt(i);
String input = inputtext.charAt(h);
if (now == input) {
start = i;
end = start+lengthofinputtext;
}
}
}
and after it does that, I want it to select text starting at the variable "start" and ending with "end"... I think I know how to do that part... help... I got stuck when I got to the "for" lines... What it does is it says do the following script the amount of times that lenghoftext variable is equal to. So if lenghoftext variable (the number of characters in a input object) is equal to 20, it should to the following script 20 times... HELP... THANKS
String inputtext = "inputed text";
String text = "pad text";
int start = 0;
int end = 0;
int lengthofinputtext = inputtext.length;
int lengthoftext = text.length;
for (i = 0; i<lengthoftext; i++) {
for (h = 0; h<lengthofinputtext; h++) {
String now = text.charAt(i);
String input = inputtext.charAt(h);
if (now == input) {
start = i;
end = start+lengthofinputtext;
}
}
}
and after it does that, I want it to select text starting at the variable "start" and ending with "end"... I think I know how to do that part... help... I got stuck when I got to the "for" lines... What it does is it says do the following script the amount of times that lenghoftext variable is equal to. So if lenghoftext variable (the number of characters in a input object) is equal to 20, it should to the following script 20 times... HELP... THANKS