Results 1 to 2 of 2

Thread: .Split Question*RESOLVED*

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Location
    Perth - Australia
    Posts
    105

    .Split Question*RESOLVED*

    Sorry for the not-very descriptive title... but i was unsure of exactly what to call it. Now, the problem:

    For a login Screen, i am using the following code:

    VB Code:
    1. Dim dataArray() As String
    2.         Dim iValidUser As Boolean
    3.  
    4.         dataArray = userName.Split(Chr(45))
    5.         If UCase(dataArray(0)) = "ADMIN" And LCase(dataArray(1)) = "1234" Then
    6.             iValidUser = True
    7.         ElseIf UCase(dataArray(0)) = "ADMIN" And LCase(dataArray(1)) <> "1234" Then
    8.             iValidUser = False
    9.             'ElseIf UCase(dataArray(0)) <> "ADMIN" And [[[LCase(dataArray(1)) AND THE SPLITTER DO NOT EXIST]]] Then
    10. Else
    11.             iValidUser = True
    12.         End If

    Now, I want the admins to be able to login as "admin-password" and the users to be able to log in as "user"

    As it is now, when i log in as a user, say "bob" it doesnt work, because there is no chr(45)... which is "-". How do i get it to only check for a split char if the start of the name is "admin"?

    I appreciate any help offered

    Shift
    Last edited by nightshift; Nov 22nd, 2002 at 12:11 AM.

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