Hi,
If you really want to cast a string into an int, you need to create an own method that runs through each character of a string.
For example method StringToInt32( string aString ) that returns a int32:
var int32 result = 0;
var int32 i = 0;
var char s = aString[i];
while ( s >= '0' && s <= '9' )
{
result = 10 * result + ( s - '0' );
i = i + 1;
s = aString[i];
}
return result;
Just an idea: Instead of using a string input (your text view), I would suggest to create an own input that only allows integer values. You could use the standard "Text Editor" (see Components in Gallery), change its String-property to int32 (modify its onSet and onGet) and modify also the slots like onCharacterKey, which should only accept int-values. Alternative: Use the String-property, but remember any changes to int in another int-property that is accessible. I guess this would be a cleaner way to avoid string casting. It is up to you.
HTH,
Chris