break from WHILE..WEND

Results 1 to 2 of 2

Thread: break from WHILE..WEND

  1. #1
    long legs Guest

    Default break from WHILE..WEND

    Hi<BR><BR>My problem is not being able to break out of a VBScript WHILE..WEND loop. With one username/password in the text file, loginfile, the acceptance works fine, but if loginfile holds another set of usernames/passwords, the system accepts, then continues and rejects!<BR><BR>&#060;%&#039verifies user status through username and password check<BR>If Request.Form("LOGIN") = "Login" Then<BR> Dim filesys, loginfile<BR> Set filesys = CreateObject("Scripting.FileSystemObject")<BR> Set loginfile = filesys.OpenTextFile<BR> "C:InetpubwwwrootMasterMCpasswords.txt",1)<BR> While Not loginfile.AtEndOfStream<BR> If loginfile.ReadLine = Request.Form("username") & " "_<BR> & Request.Form("password") Then<BR> AdminAccess ...calls sub which gives user other options<BR> Else<BR> %&#062;<BR> &#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR> history.go(-1); ...sends user back to last page<BR> &#060;/SCRIPT&#062;<BR> &#060;%<BR> End If<BR> WEnd<BR>Else<BR> GetPass ...displays username/password entry form<BR>End If <BR>%&#062;<BR><BR>Any help much appreciated - Thanks<BR>

  2. #2
    sm549 Guest

    Default RE: break from WHILE..WEND

    Do While Not loginfile.AtEndOfStream<BR>&nbsp&nbspIf [some condition] Then<BR>&nbsp&nbsp&nbsp&nbspExit Do<BR>&nbsp&nbspEnd If<BR>Loop<BR><BR>HIH

Posting Permissions

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