the first segment of code is the issue, without it, it works fine. I have tried int(string), Intiger.valueOf and Intiger.ParseInt. If you have any ideas pls tell me. (btw i saw no issue with the file, if you want i can link it, but its just random Slovenian words)
//Trying to find a word with different search methods, from a .txt document called "besede.txt"
//loading the number of word in the .txt from the first line of it.
String wLen = loadStrings("besede.txt")[0];
int intA = int(wLen); //trying to change String to Int, i'vs seen it work
int wnum = intA; //int(loadStrings("besede.txt")[0]); //number of words
String words[] = new String[intA];
int wl = 7; //word length //one of the search parimiters; length of the word
boolean searchBy[] = {true,false,false}; //1st - length, 2nd- letters, 3rd- letters known
String output[] = new String[wnum]; //output of all of the words, matching the criteria
int ol = 0; //output length
void setup() {
size(100,100);
for(int i = 0; i < wnum; i++) { //loading all the words from .txt
words[i] = loadStrings("besede.txt")[i+1];
}
//for(int i = 0; i < wnum; i++) {
// println(words[i]);
//}
}
void draw() {
//first criteria; length test
for(int i = 0; i < wnum; i++) {
if(words[i].length() == wl) {
output[ol] = words[i];
ol++;
}
}
finish();
}
void finish() {
for(int i = 0; i < ol; i++) {
println(output[i]);
}
exit();
}