The following example shows the same script in the TAS script language described in TAS Script Instructions.
/* TSM script application dipscript */
#include "dipscript.h"
tfile ("std_speech.pl" "dipscript.pl")
event (0,L__quit)
event (1,L__quit)
L_start:
trace (im.1)
tic ('a')
trace (im.2)
talk ("Hello, this is the DIP test script" )
L_entry_loop:
load (int.F_acct_balance, im.0)
trace (im.3, int.F_acct_balance)
/* get caller input */
ttdelim (-1, -1, -1, -1)
load (int.F__CI_TRIES_USED, im.0)
L_4: /* prompt */
talk ("Please enter your SSN" )
L_5: /* try again */
tttime (5, 5)
incr (int.F__CI_TRIES_USED, im.1)
getdig (0, ch.F_ssn, im.09)
load (int.F__CI_NO_DIGS_GOT, r.0) /* save for user */
trace (im.4, ch.F_ssn)
jmp (r.0 == im.0, L_2)
jmp (int.F__CI_NO_DIGS_GOT < im.09, L_3)
goto (L_1)
L_2: /* Initial timeout */
jmp (int.F__CI_TRIES_USED == im.3, L__quit)
goto (L_4)
L_3: /* too few digits */
jmp (int.F__CI_TRIES_USED == im.3, L__quit)
goto (L_4)
L_1:
/* get caller input */
ttdelim (-1, -1, -1, -1)
load (int.F__CI_TRIES_USED, im.0)
L_9: /* prompt */
talk ("Please enter your account number" )
L_10: /* try again */
tttime (5, 5)
incr (int.F__CI_TRIES_USED, im.1)
getdig (0, ch.F_acct_num, im.06)
load (int.F__CI_NO_DIGS_GOT, r.0) /* save for
user */
trace (im.5, ch.F_acct_num)
jmp (r.0 == im.0, L_7)
jmp (int.F__CI_NO_DIGS_GOT < im.06, L_8)
goto (L_6)
L_7: /* Initial timeout */
jmp (int.F__CI_TRIES_USED == im.3, L__quit)
goto (L_9)
L_8: /* too few digits */
jmp (int.F__CI_TRIES_USED == im.3, L__quit)
goto (L_9)
L_6:
trace (im.6,ch.F_ssn)
trace (im.6,ch.F_acct_num)
L__diptest (im.F_ssn, im.F_acct_num)
load (int.F_acct_balance, r.0)
trace (im.6, r.0)
trace (im.7)
jmp (int.F_acct_balance >= im.0, L_11)
trace (im.8)
talk ("This is an error situation, the return
value is" )
tnum (int.F_acct_balance, 't')
trace (im.9)
goto (L__quit)
L_11:
load (int.F_acct_balance, int.F_acct_balance)
trace (im.10, int.F_acct_balance)
trace (im.11)
talk ("Your account balance is" )
L__sp_dol (int.F_acct_balance)
/* get caller input */
ttdelim (-1, -1, -1, -1)
load (int.F__CI_TRIES_USED, im.0)
L_15: /* prompt */
talk ("Enter 1 to enter ssn again, 2 to quit" )
L_16: /* try again */
tttime (5, 5)
incr (int.F__CI_TRIES_USED, im.1)
getdig (0, ch.F_prompt, im.01)
load (int.F__CI_NO_DIGS_GOT, r.0) /* save for
user */
trace (im.12, ch.F_prompt)
jmp (r.0 == im.0, L_13)
jmp (ch.F_prompt == im.'1', L_entry_loop)
jmp (ch.F_prompt == im.'2', L_12)
goto (L_12)
L_13: /* Initial timeout */
jmp (int.F__CI_TRIES_USED == im.3, L__quit)
goto (L_15)
L_12:
trace (im.13)
talk ("Thank you for calling the Dip Test
Script" )
trace (im.14)
tic ('h')
trace (im.15)
goto (L__quit)
L__quit:
quit ()
L__save_events:
rts ()
L__seasonal_greetings: /* play seasons greetings messages,
if any */
rts ()
#include "/vs/bin/ag/lib/_sp_dol.t"
#include "diptest.t"