The text of a manual · part 5 of 10
TT Advantage Programmer's Guide, pages 41 to 50
Pages 41 to 50 of 92
The original document is the PDF (976 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the HHP TT3100 and Welch Allyn TT3100
Page 41
Script.DoNothing Script.DoNothing is a placeholder. This command is mainly used with “If” statements when the developer wants the “Else” clause to do nothing. Parameters
Description
Values
None
RETURN VALUES None SEE ALSO Script.IfTrue, Script.IfFalse EXAMPLE Tool.Script.IfTrue Tool.Object.IsEmpty(padScreen.SigArea1), _ Tool.Sound.Bell(Alarm), Tool.Script.DoNothing() This sample code checks SigArea1 to find out if the customer has signed in. If the user has not signed, the TT3100 Series terminal sounds an alarm, otherwise it does nothing.
Script.GotoRoutine(RoutineName) as Boolean Script.GotoRoutine executes RoutineName. Note: This command is not a subroutine. It will not continue processing after the line that called it. Execution stops at the end of RoutineName unless the last line is a Script.Goto command. In the TT Advantage Assistant, clicking on the “View Labels” button causes TT Advantage to list available routine names. Parameters
Description
Values
RoutineName
Name of user defined routine.
Must be in the format of module or form routine. (case sensitive)
RETURN VALUES Boolean - True if successful SEE ALSO Script.GotoScreen EXAMPLE Tool.Script.GotoRoutine CheckIdFormat This command transfers script control to the CheckIdFormat routine in a module of the project. Note: This command completely transfers execution of the script. Execution does not return automatically to the calling code.
3-21
Page 42
Script.GotoScreen(ScreenName) Script.GotoScreen displays ScreenName. On the TT Advantage Assistant panel, click the “View Labels” button to get a list of available screen names to use. Parameters
Description
Values
ScreenName
A name of a form.
case sensitive
RETURN VALUES None SEE ALSO Script.GotoRoutine EXAMPLE Tool.Script.GotoScreen padGetMSR Note: This command displays the padGetMSR form on the device.
Script.GoToVar(VarName) Script.GotoVar is a typical goto statement. This command executes the routine VarName. Note: This is not a subroutine; in other words, this will not continue processing after the line that called it. Program routines stop processing at routine end unless the routines are ended with Script.Goto commands. In TT Advantage Assistant, clicking on the “View Labels” buttons produces a list of valid routine names. Note: Insert routine and form names as the parameters. Parameters
Description
Values
VarName
Variant: variable that contains the name
Must be in the format of module of user defined subroutine.
or form subroutine or form name (case sensitive).
RETURN VALUES Boolean - True if successful SEE ALSO Script.GotoScreen, Script.GotoRoutine EXAMPLE Tool.Var.Str.SetVar “NextScreenName”, “padGetSig” ... Tool.Script.GotoVar “NextScreenName” Note: This example will display the padGetSig form on the device.
3-22
Page 43
Script.IfFalse(Expression, ThenClause, ElseClause) Script.IfFalse is an If Not True statement. If the expression is false, the ThenClause executes, otherwise the ElseClause executes. Note: Every sub-command must be enclosed in parenthesis in function syntax fashion. Parameters
Description
Values
Expression
A script command that returns a Boolean
Must be a script command in value.
function syntax.
The command executed if the expression
Must be a script command in returns False.
function syntax.
The command executed if the expression
Must be a script command in returns True.
function syntax.
ThenClause
ElseClause
RETURN VALUES None SEE ALSO Script.IfTrue EXAMPLE Tool.Script.IfFalse Tool.Object.IsEmpty(padScreen.SigArea1), Tool.Sound.Bell(Alarm), Tool.Script.DoNothing() If the Signature Area (SigArea1) on padScreen has not been signed, then an alarm sounds.
Script.IfTrue(Expression, ThenClause, ElseClause) Script.IfTrue evaluates the Boolean Expression. If Expression is true, the ThenClause executes. If Expression is false, ElseClause executes. Note: Every command used as a parameter must be enclosed in parenthesis in function syntax fashion. Parameters
Description
Values
Expression
A Script command that returns a Boolean
Must be a script command in value.
function syntax.
The command executed if the expression
Must be a script command in returns True.
function.
The command executed if the expression
Must be a script command in returns False.
function syntax.
ThenClause
ElseClause
RETURN VALUES None SEE ALSO Script.IfFalse
3-23
Page 44
EXAMPLE Tool.Script.IfTrue Tool.Object.IsEmpty(padScreen.SigArea), Tool.Sound.Bell(Alarm), Tool.Script.DoNothing()
Script.Pause(Seconds) Script.Pause halts script execution for the indicated number of seconds. Note: When a script is halted with Script.Pause, the command allows most actions to occur and events to be handled such as button clicks. Use for displaying messages and splash screens. Parameters
Description
Values
Seconds
Integer, the number of seconds for delay.
1- 600
RETURN VALUES None SEE ALSO Script.StopScript EXAMPLE Tool.Script.Pause 30
Script.StopScript Script.StopScript completely halts script execution. Parameters
Description
Values
None
RETURN VALUES None SEE ALSO Script.Pause EXAMPLE Tool.Script.StopScript
Sig
Sig The SIG commands are commands that work with signature data. In conjunction with these commands, use the Sig.Save command to save signatures into a binary variable.
3-24
Page 45
Sig.Clear(ControlName) Sig.Clear clears the signature area. Parameters
Description
ControlName
The name of SigControl to be cleared.
Values
RETURN VALUES None SEE ALSO TxtBox.Clear EXAMPLE Tool.Sig.Clear padStart.SigControl1
Sig.Convert(VarName1, Format) as VarName Sig.Convert changes signatures from one format to another. Parameters
Description
Values
VarName1
String variable containing signature
Signature variable information for conversion to another format. Format
Integer format for saving signature
Points = 1 Packet = 5 COTF = 7
RETURN VALUES Variable containing string data for signature in new format. EXAMPLE Tool.Var.SetVar “SIGNATURE2” , Tool.Sig.Convert (“SIGNATURE1”, CONF)
Sig.GetCount(VarName) as Integer Sig.GetCount returns the number of points for a signature stored in VarName. Parameters
Description
Values
VarName
String variable contains signature.
Signature variable
RETURN VALUES Integer EXAMPLE Tool.Var.SetVar “Num” , Tool.Sig.GetCount(“Sig”)
3-25
Page 46
Sig.Height(VarName) as Integer Sig.Height returns the signature height in pixels for a signature that is stored in the VarName. Parameters VarName
Description
Values
String, variable name that contains
Signature variable signature
RETURN VALUES Integer SEE ALSO Script.Inches, Script.Width EXAMPLE Tool.Var.SetVar “Height” , Tool.Sig.Height(“Sig”)
Sig.InchesHigh(VarName) as Integer Sig.InchesHigh returns the signature height in inches x 100 for signature that is stored in the VarName. Note: This does not return fractions, so 2.32 inches returns as 232. Parameters VarName
Description
Values
String variable name that contains
Signature variable signature
RETURN VALUES Integer SEE ALSO Sig.InchesWide, Sig.Width, Sig.Height EXAMPLE Tool.Var.SetVar “InchesHigh” , Tool.Sig.InchesHigh(“Sig”)
Sig.InchesWide(VarName) as Integer Sig.InchesWide returns the signature width in inches x 100 for signature that is stored in the VarName. Parameters
Description
Values
VarName
String variable name that contains
Signature variable signature
RETURN VALUES Integer SEE ALSO Sig.InchesHigh, Sig.Height, Sig.Width
3-26
Page 47
EXAMPLE Tool.Var.SetVar “InchesWide” , Tool.Sig.InchesWide(“Sig”)
Sig.IsEmpty(ControlName) as Boolean Sig.IsEmpty.determines if ControlName holds a signature. Parameters
Description
ControlName
Name of SigControl
Values Control name in Visual Basic format
RETURN VALUES Boolean - True if SigControl has no signature in it. EXAMPLE Tool.SCRIPT.IfTrue Tool.Sig.IsEmpty(SigControl1), Tool.SOUND.Bell(Success), Tool.SOUND.Bell(Fail)
Sig.Save (ControlName, VarName) as Boolean Sig.Save moves signature data in a control to a binary variable. Parameters
Description
Values
ControlName
Name of SigControl
Control name in Visual Basic format
VarName
String variable stores signature
Signature variable
RETURN VALUES Boolean - True if successful EXAMPLE Tool.Sig.Save padStart.SigControl1, “Sig1”
Sig.Width(VarName) as Integer Sig.Width returns the width of a signature in pixels for a signature stored in VarName. Parameters
Description
Values
VarName
String, variable contains signature
Signature variable
RETURN VALUES Integer SEE ALSO Sig.Height, Sig.InchesWide, InchesHigh EXAMPLE Tool.Var.SetVar “Width” , Tool.Sig.Width(“SIG”)
3-27
Page 48
Sound The SOUND commands control all audio output for the TT3100 Series terminals.
Sound.Bell(BellType) Sound.Bell causes a TT3100 Series terminal to make the bell sound specified by BellType. Parameters
Description
Values
BellType
BellTypes
Alarm Fail Normal_Bell Success
RETURN VALUES None SEE ALSO Sound.Tone EXAMPLE Tool.Sound.Bell Alarm
Sound.Tone(FreqHZ, TempoBeats) Sound.Tone causes a TT3100 Series terminal to make the tone specified by the FreqHZ and TempoBeats. Parameters FreqHZ
Description
Values
Integer specifying the frequency of the tone generated.
TempoBeats
Integer specifying the duration of the tone generated
RETURN VALUES None SEE ALSO Sound.Bell EXAMPLE Tool.Sound.Tone 220, 100
Stopwatch The STOPWATCH commands control the timer. Use Start, Stop, Continue and GetTimer commands to manipulate the timer and use Var.Num commands to program decisions based on timer information.
3-28
Page 49
Stopwatch.Continue Stopwatch.Continue re-activates the internal interactive point of sale timer from the last Pause command. Parameters
Description
Values
None
RETURN VALUES None SEE ALSO Stopwatch.Pause EXAMPLE Tool.Stopwatch.Continue
Stopwatch.GetTime as Integer Stopwatch.GetTime returns the number of seconds in the elapsed since timer activation. Execute this command before pausing the timer. Parameters
Description
Values
None
RETURN VALUES Integer SEE ALSO Stopwatch.Start EXAMPLE Tool.Var.SetVar “Seconds” , Tool.Stopwatch.GetTime
Stopwatch.Pause Stopwatch.Pause halts the internal timer of a TT3100 Series terminal. Parameters
Description
Values
None
RETURN VALUES None SEE ALSO Stopwatch.Continue, Stopwatch.GetTime EXAMPLE Tool.Stopwatch.Pause
3-29
Page 50
Stopwatch.Start Stopwatch.Start initializes and starts the internal timer of a TT3100 Series terminal. Use GetTime to get the number of seconds since the Stopwatch.Start command was executed. Important: Read the value of the timer before pausing. Parameters
Description
Values
None
RETURN VALUES None SEE ALSO Stopwatch.Continue, Stopwatch.Time EXAMPLE Tool.Stopwatch.Start
TxtBox The TXTBOX commands provide the ability to manipulate text boxes.
TxtBox.IsEmpty(ControlName) as Boolean TxtBox.IsEmpty determines if TextBox control contains data. Not the Text property of the TextBox control. Because of Text property acts as a variable, this method checks whether any values assign to the variable (i.e., TextBox). By default TextBox controls contain “VAR not defined” as their values, so initially it is not empty. Parameters
Description
Values
ControlName
Name of TextBox control
Must be a screen control name in the format of Form.Control
RETURN VALUES Boolean - True if successful SEE ALSO Sig.IsEmpty EXAMPLE Tool.TxtBox.IsEmpty(padScreen1.txtResult)
3-30