- Home /
I got it by myself
easy Code does not work
Hi, why does this code doesn't work? Normally this would be an easy code for me but now it doesn't work:
I want it to generate an url with some values look at it: var s :String;
var varname :String[];
var values :String[];
function getting(scriptname :String, varName :String[], values :String[]){
var url = "http://www.myurl.com/" + scriptname;
if(varName.Length > 0){
url = url + "?";
}
var i :int;
while (i <= varName.Length){
url = url + varName[i] + "=" + values[i] + "&";
i++;
}
return url;
}
function Start () {
s = getting("process.php", varname, values);
}
First of all there are no compiler errors but then the string "s" keeps being null and I get the following warning:
IndexOutOfRangeException: Array index is out of range. Verbindung.getting (System.String scriptname, System.String[] varName, System.String[] values) (at Assets/Verbindung.js:14) Verbindung.Start () (at Assets/Verbindung.js:23)
sorry it is very strange with the script preview at the moment
Remove = and ins$$anonymous$$d only check while less than. Is there a reason why you want to keep those variables public?
Follow this Question
Related Questions
C# String Array Has Missing or Incorrect Keycode Strings 2 Answers
how to randomly pick a string from an array 3 Answers
C# Incrementing a String Array 1 Answer
Extending the Array class? 1 Answer