Page 1 of 1

Integer to string

Posted: 9 Apr 2014 11:00
by george123
Hello guys

if i have an integer: Counter and i want to get the string i use toString(Counter)

if i have a string: Money = "10" and i want to make how can i convert it to integer ??


and if i have the integer: Value = 10 and i want to convert it to positive, how can i do that ??

so i want

i) string to integer

and
ii) integer to positive

Thank you

Posted: 9 Apr 2014 13:02
by Thomas Linder Puls

Code: Select all

tryToTerm(integer, String) % will fail if String is not an integer toTerm(integer, String) % will raise an exception if String is not an integer

Code: Select all

tryConvert(positive, Integer) % will fail if Integer cannot be converted to a positive concert(positive, Integer) % will raise an exception if Integer cannot be converted to a positive