I wanted to have multi passwords with different actions. When I add the 3rd password, nothing happens it does not check the nAttempt. No error.. here is the code, any help would be great. Thanks
sPassword = Dialog.PasswordInput("My App", "Please Enter Your Password:", MB_ICONQUESTION);
if sPassword ~="".. sPassword and sPassword ~="CANCEL" then
if sPassword == "pwd1" then
Button.SetVisible("Button1", true);
Button.SetVisible("Button2", true);
Button.SetVisible("Button3", true);
Button.SetVisible("Button4", true);
Button.SetVisible("Button5", true);
Button.SetVisible("Button6", true);
Button.SetVisible("Button7", true);
Image.SetVisible("Image2", true);
Image.SetVisible("Image3", true);
Image.SetVisible("Image4", true);
Image.SetVisible("Image10", true);
elseif sPassword == "pwd2" then
Button.SetVisible("Button1", false);
Button.SetVisible("Button2", false);
Button.SetVisible("Button3", true);
Button.SetVisible("Button4", false);
Button.SetVisible("Button5", false);
Button.SetVisible("Button6", false);
Button.SetVisible("Button7", false);
Image.SetVisible("Image2", false);
Image.SetVisible("Image3", false);
Image.SetVisible("Image4", false);
Image.SetVisible("Image10", false);
elseif sPassword == "pwd3" then
Button.SetVisible("Button1", false);
Button.SetVisible("Button2", true);
Button.SetVisible("Button3", true);
Button.SetVisible("Button4", true);
Button.SetVisible("Button5", false);
Button.SetVisible("Button6", true);
Button.SetVisible("Button7", false);
Image.SetVisible("Image2", false);
Image.SetVisible("Image3", false);
Image.SetVisible("Image4", false);
Image.SetVisible("Image10", false);
elseif sPassword ~= "pwd1".. sPassword ~= "pwd2" and sPassword ~= "pwd3" then
nAttempt = nAttempt+1;
Dialog.Message("Error", "Number of Attempts : "..""..nAttempt.." of 5 allowed", MB_OK, MB_ICONEXCLAMATION);
if nAttempt == 5 then
Application.Exit();
else
Page.Jump("Agree");
end
end
sPassword = Dialog.PasswordInput("My App", "Please Enter Your Password:", MB_ICONQUESTION);
if sPassword ~="".. sPassword and sPassword ~="CANCEL" then
if sPassword == "pwd1" then
Button.SetVisible("Button1", true);
Button.SetVisible("Button2", true);
Button.SetVisible("Button3", true);
Button.SetVisible("Button4", true);
Button.SetVisible("Button5", true);
Button.SetVisible("Button6", true);
Button.SetVisible("Button7", true);
Image.SetVisible("Image2", true);
Image.SetVisible("Image3", true);
Image.SetVisible("Image4", true);
Image.SetVisible("Image10", true);
elseif sPassword == "pwd2" then
Button.SetVisible("Button1", false);
Button.SetVisible("Button2", false);
Button.SetVisible("Button3", true);
Button.SetVisible("Button4", false);
Button.SetVisible("Button5", false);
Button.SetVisible("Button6", false);
Button.SetVisible("Button7", false);
Image.SetVisible("Image2", false);
Image.SetVisible("Image3", false);
Image.SetVisible("Image4", false);
Image.SetVisible("Image10", false);
elseif sPassword == "pwd3" then
Button.SetVisible("Button1", false);
Button.SetVisible("Button2", true);
Button.SetVisible("Button3", true);
Button.SetVisible("Button4", true);
Button.SetVisible("Button5", false);
Button.SetVisible("Button6", true);
Button.SetVisible("Button7", false);
Image.SetVisible("Image2", false);
Image.SetVisible("Image3", false);
Image.SetVisible("Image4", false);
Image.SetVisible("Image10", false);
elseif sPassword ~= "pwd1".. sPassword ~= "pwd2" and sPassword ~= "pwd3" then
nAttempt = nAttempt+1;
Dialog.Message("Error", "Number of Attempts : "..""..nAttempt.." of 5 allowed", MB_OK, MB_ICONEXCLAMATION);
if nAttempt == 5 then
Application.Exit();
else
Page.Jump("Agree");
end
end
Comment