Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 unique username
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
unoho




PostPosted: Sat Dec 20, 2008 8:07 pm   Post subject: unique username

hi guys, im trying to make a unique username login page in vb6 using random access file method.

this is what i have

this is a basic concept of chequing a unique name.

code:

Private Sub Command1_Click()
    strI = "i am a cow"
    lngID = 1
    For i = 1 To Len(strI)
        lngID = Asc(Mid(strI, i, 1)) * lngID
    Next i
   
    strI = "woc a ma i"
    lngID2 = 1
    For i = 1 To Len(strI)
        lngID2 = Asc(Mid(strI, i, 1)) * lngID2
    Next i
   
    If lngID = lngID2 Then
        strmsg = "unavailable"
    Else
        strmsg = "available"
    End If
   
    MsgBox lngID & vbNewLine & lngID2 & vbNewLine & strmsg
    End
   
End Sub



and it outputs "unavailable" because when they are multiplied, it outputs the same result for both the lngID and lndID2. anyone got any idea how to make it unique?
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: