Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005
    Posts
    103

    Huh? password problems...aahhhhh....

    I want to passowrd protect one of my options, but it doesn't seen to work.

    Here is the code I used:
    Code:
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_03) then
    	passy = Dialog.PasswordInput("Enter Password", "Password Version Password", MB_ICONQUESTION);
    	pass = "pass";
    	password_checked = String.Compare("passy", "pass");
    if (password_checked == true) then
    	rest = Dialog.Message("Notice", "Message.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    	Screen.Jump("next screen");
    elseif (password_checked ~= true) then
    	Screen.Jump("error");
    	end
    end
    I don't know what the error is....but even if I enter the correct password, it sends me to the "error" page.....AAAAAAAAHHHHHHHH.

    Please help me....
    Thanks.

  2. #2
    Join Date
    Mar 2005
    Posts
    103

    Huh?

    Forget it, I figured it out.

    I also made a way to keep track of how many times the user have tried, and limit it to three:

    On Preload:
    Code:
    if not areacheck then areacheck = {}; end
    
    areacheck.MaxAttempts = 3;
    
    if(areacheckgm.AttemptCount == nil) then
    	areacheck.AttemptCount = 0;
    end
    On Next:
    Code:
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_03) then
    real_password = "pass";
    user_password = Dialog.PasswordInput("Password", "Please enter the password: ", MB_ICONQUESTION);
    if real_password ~= user_password then
    	areacheck.AttemptCount = areacheckgm.AttemptCount + 1;
    	passno = Dialog.Message("ERROR", "Incorrect Password.", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
    if(passno == IDOK) then	
    	Screen.Jump("sorry");
    		-- if the user is out of retries, exit the application
    	if(areacheck.AttemptCount >= areacheck.MaxAttempts) then
    		Application.Exit(0);
    		end
    	end
    end
    if real_password == user_password then
    	rest = Dialog.Message("NOTE", "Your Message here.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    	if(rest == IDOK) then
    	Screen.Jump("whatever screen");
    		end
    	end
    end

    Hehehe.
    No more errors there.....
    On to the next problem....

  3. #3
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Try this. I have not personally tested it.

    Edit: Woops... too late.

    Code:
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_03) then
    	passy = Dialog.PasswordInput("Enter Password", "Password Version Password", MB_ICONQUESTION);
    	pass = "pass";
    	password_checked = String.Compare("passy", "pass");
    if (password_checked) then
    	rest = Dialog.Message("Notice", "Message.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    	Screen.Jump("next screen");
    else
    	Screen.Jump("error");
    	end
    end

Similar Threads

  1. Adding Password Protection
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-03-2003, 03:25 PM
  2. Reoccurring password
    By Bruce in forum AutoPlay Media Studio 4.0
    Replies: 6
    Last Post: 06-04-2003, 04:09 PM
  3. Password
    By Bruce in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 05-31-2003, 05:52 PM
  4. HOWTO: Add Password Protection to Your Application
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 03:39 PM

Posting Permissions

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