Repeat / EndRepeat

Item Description

Use with:

All

SecureLogin Version:

All

Type:

Action

Usage:

Repeat [Loop#]
EndRepeat

Arguments:

[Loop#]

The number of times the repeat script block is repeated. If you don't specify a number, the repeat continues indefinitely unless you use other commands to break the loop.

Description:

The Repeat command establishes a script block similar to the If command. The EndRepeat command terminates the repeat block. To break out of a repeat block, use the Break or EndScript command.

Syntax Examples:

Repeat
Repeat 3

Example:
Terminal Script
The Repeat command watches the screen for messages and responds accordingly. The Break command jumps to the next repeat loop in the script.

# Initial System Login 
WaitForText "ogin:"
Type $Username
Type @E
WaitForText "assword:"
Type $Password
Type @E
Delay 500
# Repeat loop for error handling 
Repeat
#Check to see if the password has expired 
If -Text "EMS: The password has expired."
ChangePassword #Password
Type $Password
Type @E
Type $Password
Type @E
EndIf
#User has an invalid username or password (or both) stored. 
If -Text "Login Failed"
DisplayVariables "The username or password (or both) stored by SecureLogin is invalid. Verify your credentials and try again. IT x453."
Type $Username
Type @E
Delay 500
WaitForText "assword:"
Type $Password
Type @E
Delay 500
EndIf
# Account is locked for some reason, possibly inactive. 
If -Text "Account Locked"
MessageBox "Your account has been locked, possibly because of inactivity for 40 days. Contact the administrator at x453."
EndIf
# Main Menu, user has logged in successfully. 
If -Text "Application Selection"
Break
EndIf
Delay 100 
EndRepeat