;------------------------------------------------------------------------------------------------------------------------------------------ #DefineFunction udfAskPassword (strAP_Title, strAP_Prompt) Return AskPassword (strAP_Title, strAP_Prompt) :CANCEL Return "" ; Return empty string if dialog has been cancelled resp. closed by escape key. #EndFunction ;------------------------------------------------------------------------------------------------------------------------------------------ strAP_Title = "" ; Title of the dialog box. strAP_Prompt = "" ; Question to be put to the user. strAP_Result = udfAskPassword (strAP_Title, strAP_Prompt)
;------------------------------------------------------------------------------------------------------------------------------------------ #DefineFunction udfAskPassword (strAP_Title, strAP_Prompt) Return AskPassword (strAP_Title, strAP_Prompt) :CANCEL Return "" ; Return empty string if dialog has been cancelled resp. closed by escape key. #EndFunction ;------------------------------------------------------------------------------------------------------------------------------------------ intTrials = 3 While intTrials strAP_Title = "Password Required" ; Title of the dialog box. strAP_Prompt = "Please enter your password" ; Question to be put to the user. strAP_Result1 = udfAskPassword (strAP_Title, strAP_Prompt) strAP_Title = "Password Validation" ; Title of the dialog box. strAP_Prompt = "Please re-enter your password" ; Question to be put to the user. strAP_Result2 = udfAskPassword (strAP_Title, strAP_Prompt) intIsValid = strAP_Result1 == strAP_Result2 ; Empty password is not allowed, so try again without counting. If intIsValid && strAP_Result1 == "" Then Continue If intIsValid Then Break ; If password is valid, then leave the loop. intTrials = intTrials - 1 EndWhile Terminate (!intTrials, "Terminated.", "Too much trials.") ; Password has been validated, so do other stuff here. ; ... Exit