Computer Science Canada string to integer |
Author: | maiku [ Thu Aug 03, 2006 4:05 pm ] |
Post subject: | string to integer |
I cant figure out how to get a string into an integer ![]() |
Author: | Mazer [ Thu Aug 03, 2006 4:21 pm ] | ||
Post subject: | |||
I don't know if there's a tutorial for it here... actually, there probably is, but it wouldn't be worth looking through all those pages of tutorials for it. Pro tip: in Turing, type a function name or keyword, and (with the cursor located on the word), press F9. The Turing reference will pop up and explain things about what you want to use. |
Author: | richcash [ Thu Aug 03, 2006 4:36 pm ] | ||
Post subject: | |||
For strintok, it's a boolean function that tells you whether or not you can change a string into an integer. You know that a string must be convertable, so the strintok returns true when the string is convertible.
This is helpful just in case value is something like "dog", then it won't give you an error, since the 'put strint (value)' won't run because strintok returns false in the if statement. |
Author: | TokenHerbz [ Fri Aug 04, 2006 3:21 am ] |
Post subject: | |
im curious to weather or not other variations of "strintok" exist... Id look myself if it wern't time for bed... ![]() |
Author: | NikG [ Fri Aug 04, 2006 2:45 pm ] |
Post subject: | |
TokenHerbz wrote: im curious to weather or not other variations of "strintok" exist... Id look myself if it wern't time for bed... Just 3 versions I believe, all for converting numbers to strings: strintok, strnatok, strrealok![]() |
Author: | Albrecd [ Sat Aug 05, 2006 12:56 pm ] | ||
Post subject: | |||
If you're trying to get the number value of the characters in your string, use ord.
|