Results 1 to 6 of 6

Thread: Making my game universal

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2003
    Posts
    601

    Making my game universal

    My game will only work with USA config settings. how can I set it to work with other country configs as well. It has something to do with the numbering system.

  2. #2
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: Making my game universal

    Have a quick look at this

  3. #3
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Making my game universal

    what kind of error are non-us users getting
    ?
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2003
    Posts
    601

    Re: Making my game universal

    subscript out of range. i dim 2d array 500x500 for maps, but they think 25.60 is rreally 2560

  5. #5
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: Making my game universal

    Internally VB will see 25.6 as you do... 25.6, but as soon as you start coercing strings into numbers and numbers into strings, locale steps in. Any number strings displayed to, or entered by, the end user should be in the end users locale. Likewise, any displayed number strings that need to be converted to internal numbers must be converted from the end users locale.

    To show the end user a number you can use...
    LocalisedNumberString = Formatnumber(1234.56)
    LocalisedNumberString = CStr(1234.56)



    To convert a localised number string back into a number to use internally, use the appropriate data conversion...
    InternalSingle = CSng(LocalisedNumberString)
    InternalLong = CLng(LocalisedNumberString)

    etc...
    Note, that these are less forgiving than the Val function, you have to ensure that the string to be converted is a true number.

    If you want to convert numbers to strings disregarding locale, i.e. won't always make sense to the end user use...
    NonLocalisedNumberString = Str$(1234.56)
    and vice versa
    Number = Val(NonLocalisedNumberString)

    See the link above for more information.
    Last edited by Milk; Sep 9th, 2007 at 07:29 PM. Reason: more stuff to add...

  6. #6
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Making my game universal

    basically a lot of countries use a comma instead of a decimal
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

Posting Permissions

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



Click Here to Expand Forum to Full Width