- Home /
How can i get a variable from the for loop before it completes full cycle?
Hello members, I just want to get a string variable(aranan) from the for loop before it completes the cycle. When i do it with my code, it works, but just for a while :) it will disappear with these Errors;
Optimized GUI Block text buffer too large. Not appending further text. UnityEditor.DockArea:OnGUI()
String too long for TextMeshGenerator. Cutting off characters. UnityEditor.DockArea:OnGUI()
count <= std::numeric_limits::max() UnityEditor.DockArea:OnGUI()
var besinler:String[];
var aranan:String;
//inputTextStr is coming from the TouchScreenKeyboard
for (i=1; i<376;i++){
inputTextStr=inputText;
if (besinler[i-1].ToLower().Contains(inputTextStr)){
aranan=aranan+besinler[i-1]+",";
}
else if (!besinler[i-1].ToLower().Contains(inputTextStr)){ aranan=aranan+","; }
if(i==375){break;} aranan=aranan;
}
I use break; because of the solve this errors, but it does not work. So please, help.
You can save it in another class/global variable or fire it out to something using GetComponent from within the loop.
$$anonymous$$ake a Coroutine with the for loop in it to make it run over a number of frames so that this idea has a purpose; the serial nature of the game loop makes it a little pointless attempting this otherwise.
Thank you, i found another way to solve this problem.
Your answer
Follow this Question
Related Questions
For loop never exits 2 Answers
Create a Pause In A For Loop 1 Answer
x=x Assignment made to same variable 3 Answers
Glitch in Monodevelop for loops!!! 1 Answer