Can anyone help me with that? Thanks.
You have to parse string to int like below (int.Parse(“string value”))
completecode = int.Parse(varnumber1.ToString() +""+ varnumber2.ToString() +""+ varnumber3.ToString());
if (completecode == int.Parse(code1.ToString() +""+ code2.ToString() +""+ code3.ToString())) {
correctcode = true;
}
And for future readers, some simple examples of using TryParse
function forceToInt( aString:String ):int
{
var nn:int;
if ( ! int.TryParse( aString, nn ) ) return 0;
return nn;
}
another one…
var couldBeFloat:float;
if ( float.TryParse( _line, couldBeFloat ) )
{
... couldBeFloat is your float result
}
else
{
... the string was not a float, be careful
}