i am trying to grab the text form a textbox which is always a number value, so i grag the text using the textbox.GetText (); and then i cast the string value to an integer like so
iValue = [STRING] sValue;
sValue = 50
iValue = 53
why this is, i have no idead may a bug with silktest?? has anyone else seen this before..???
I have no idea why the above produce these results. However Typing:
iValue = val(textbox.GetText) instead should give the correct result!
[STRING]sValue casts the value as a string and not an integer. [INTEGER]sValue should be what you want to do.
Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.
Nice bug. Nice catch. It appears that Silk is taking the Asc() value of the first character of sValue.
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">main()
string sValue = "50" ;
int iValue = [INT]sValue;
Print("ASC :",Asc(sValue)) ;
Print("VAL :",Val(sValue)) ;
Print("CHR :",Chr(iValue)) ;
}</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">John