Results 1 to 18 of 18

Thread: code is reading ini as text not number

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2007
    Location
    indiana
    Posts
    341

    code is reading ini as text not number

    the code i have reads ini information as text and not a number like i want it to. the problem ocurres on frmsplash. the varriables are defined in module1. let me know if you need any more inforemation. any help would be nice


    frmsplash
    vb Code:
    1. Private Sub Command1_Click()
    2. Form1.Show
    3. frmSplash.Hide
    4. charname = "Gregor"
    5. race = ReadIniValue(App.Path & "\default.ini", "Default", "race")
    6. maxhp = ReadIniValue(App.Path & "\default.ini", "Default", "maxhp")
    7. hp = ReadIniValue(App.Path & "\default.ini", "Default", "hp")
    8. pmp = ReadIniValue(App.Path & "\default.ini", "Default", "pmp")
    9. maxpmp = ReadIniValue(App.Path & "\default.ini", "Default", "maxpmp")
    10. atk = ReadIniValue(App.Path & "\default.ini", "Default", "atk")
    11. pac = ReadIniValue(App.Path & "\default.ini", "Default", "pac")
    12. gold = ReadIniValue(App.Path & "\default.ini", "Default", "gold")
    13. plvl = ReadIniValue(App.Path & "\default.ini", "Default", "plvl")
    14. str = ReadIniValue(App.Path & "\default.ini", "Default", "str")
    15. dex = ReadIniValue(App.Path & "\default.ini", "Default", "dex")
    16. con = ReadIniValue(App.Path & "\default.ini", "Default", "con")
    17. intelect = ReadIniValue(App.Path & "\default.ini", "Default", "intelect")
    18. wis = ReadIniValue(App.Path & "\default.ini", "Default", "wis")
    19. cha = ReadIniValue(App.Path & "\default.ini", "Default", "cha")
    20. xp = ReadIniValue(App.Path & "\default.ini", "Default", "xp")
    21. End Sub
    22.  
    23. Private Sub Command2_Click()
    24. Form1.Show
    25. frmSplash.Hide
    26. charname = "Lidda"
    27. race = ReadIniValue(App.Path & "\default.ini", "Default", "race")
    28. maxhp = ReadIniValue(App.Path & "\default.ini", "Default", "maxhp")
    29. hp = ReadIniValue(App.Path & "\default.ini", "Default", "hp")
    30. pmp = ReadIniValue(App.Path & "\default.ini", "Default", "pmp")
    31. maxpmp = ReadIniValue(App.Path & "\default.ini", "Default", "maxpmp")
    32. atk = ReadIniValue(App.Path & "\default.ini", "Default", "atk")
    33. pac = ReadIniValue(App.Path & "\default.ini", "Default", "pac")
    34. gold = ReadIniValue(App.Path & "\default.ini", "Default", "gold")
    35. plvl = ReadIniValue(App.Path & "\default.ini", "Default", "plvl")
    36. str = ReadIniValue(App.Path & "\default.ini", "Default", "str")
    37. dex = ReadIniValue(App.Path & "\default.ini", "Default", "dex")
    38. con = ReadIniValue(App.Path & "\default.ini", "Default", "con")
    39. intelect = ReadIniValue(App.Path & "\default.ini", "Default", "intelect")
    40. wis = ReadIniValue(App.Path & "\default.ini", "Default", "wis")
    41. cha = ReadIniValue(App.Path & "\default.ini", "Default", "cha")
    42. xp = ReadIniValue(App.Path & "\default.ini", "Default", "xp")
    43. End Sub
    44.  
    45. Private Sub Form_Resize()
    46. If Form1.Height < 4335 Then
    47. Form1.Height = 4335
    48. End If
    49. If Form1.Width < 8490 Then
    50. Form1.Width = 8490
    51. End If
    52. If Form1.Height > 4335 Then
    53. Form1.Height = 4335
    54. End If
    55. If Form1.Width > 8490 Then
    56. Form1.Width = 8490
    57. End If
    58. End Sub
    that is all the code on frmsplash




    module1
    vb Code:
    1. Global gold As Integer
    2. Global str As Integer
    3. Global dex As Integer
    4. Global con As Integer
    5. Global intelect As Integer
    6. Global wis As Integer
    7. Global cha As Integer
    8. Global charname
    9. Global hp As Integer
    10. Global atk As Integer
    11. Global exp As Integer
    12. Global mobname
    13. Global mobhp As Integer
    14. Global mobatk As Integer
    15. Global maxhp As Integer
    16. Global mobgold As Integer
    17. Global pac As Integer
    18. Global mobac As Integer
    19. Global maxmobhp As Integer
    20. Global minmobhp As Integer
    21. Global plvl As Integer
    22. Global boat As Boolean
    23. Global race
    24. Global pmp As Integer
    please help me

    EDIT: i uploaded the ini i was referencing
    Attached Files Attached Files
    Last edited by bagstoper; Mar 28th, 2007 at 07:23 PM. Reason: wrong code

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