Results 1 to 4 of 4

Thread: Why do I get a Type Mismatch error on this?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 1999
    Location
    Lindenwold, NJ, USA
    Posts
    67
    Why do I get a Type Mismatch error on this?

    Code:
    Private Sub cmdNext_Click()
    
    Randomize
    a1 = Int((9 * Rnd) + 0)
    a2 = Int((9 * Rnd) + 0)
    a3 = Int((9 * Rnd) + 0)
    a4 = Int((9 * Rnd) + 0)
    pin = a1 & a2 & a3 & a4
    money = 1000
    Moneyy = Hex(money)
    Pinn = Hex(pin)
    nameo = Replace(txtname.Text, " ", "")
    ddd = WritePrivateProfileString("gdpslot", "Name", txtname.Text, App.Path & "\Accounts\" & nameo & ".gdp")
    ddd = WritePrivateProfileString("gdpslot", "Money", Moneyy, App.Path & "\Accounts\" & nameo & ".gdp")
    ddd = WritePrivateProfileString("gdpslot", "Pin", Pinn, App.Path & "\Accounts\" & nameo & ".gdp")
    tt = MsgBox("Your PIN Number is: " + pin + " Write it down! You Will Need it!", vbInformation, "PIN Number")
    tt = MsgBox("$1000 has been added to your account!", vbInformation, "The GDP Slot Machine")
    Unload NewA
    End Sub
    Frankie Weindel
    VB 6 Learning Edtion SP3

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Posts
    94

    Question

    Where do you get it? Which Line?

  3. #3
    Lively Member
    Join Date
    Jul 2000
    Posts
    94
    Try This:
    Code:
    ddd = WritePrivateProfileString("gdpslot", "Money", CSTR(Moneyy), App.Path & "\Accounts\" & nameo & ".gdp")
    ddd = WritePrivateProfileString("gdpslot", "Pin", CSTR(Pinn), App.Path & "\Accounts\" & nameo & ".gdp")

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 1999
    Location
    Lindenwold, NJ, USA
    Posts
    67

    Smile

    thanks! that works!
    Frankie Weindel
    VB 6 Learning Edtion SP3

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