Interview Questions

How to get the integer value from a string ?

SilkTest Questions and Anwsers


(Continued from previous question...)

59. How to get the integer value from a string ?

How to get the integer value from a string
print([int]"100")
this returns some different value some 49
need the value 100 to be print


Answer1:
There is one inbuild Silk's function which converts String value into Integer. Try with that
INTEGER iTemp = Val ("100")


Answer2:
Use Val function.....
print (Val("100"))...The int wrapper returns the ASCII value for the string "100"....

(Continued on next question...)

Other Interview Questions