Results 1 to 7 of 7

Thread: converting a string to int

  1. #1
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default converting a string to int

    so Val() is the way to convert it in Pascal, but simba apparently does not support this:
    Code:
    [Error] (897:32): Unknown identifier 'Val' at line 896
    Compiling failed.
    so after trying to figure this out for ever, i have finally given up and decided to ask if you guys knew. any ideas on how i can convert a string '1' to int 1?

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    StrToInt

  3. #3
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    LOL dude i literally spent like 2 hrs trying to find that stupid function (for some reason, i never expect it to be so correctly named) and like 2 mins after i posted this, i found it XD. thanks though mormonman! man was that torturing me :/

  4. #4
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You can use ToStr() as well; it accepts most every type.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  5. #5
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    You can use ToStr() as well; it accepts most every type.
    that turns it into a string, i was tryin to do the opposite. im just gunna say this is my body telling me that i really need sleep .

  6. #6
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by x[Warrior]x3500 View Post
    that turns it into a string, i was tryin to do the opposite. im just gunna say this is my body telling me that i really need sleep .
    Ah, my bad, didn't read your post correctly .
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  7. #7
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    StrToIntDef is much safer IMO.. That way if it cannot convert it will have a default value.
    I am Ggzz..
    Hackintosher

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •