home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Copyright (c) 1987, Digital Communications Associates, Inc.
- All rights reserved.
-
- This library is for emulation of the IRMA Basica subroutines
- in CASL.
-
- Procedure:
-
- WaitXclock Wait on the X-clock to go away for good
-
- Note that the TimerValue variable may be increased
- or decreased if this routine does not wait enough
- or waits too long.
-
- WaitString Wait for a string to appear on the screen
-
- parameters: wait_str - string to wait for
- wait_timer - how long to wait
-
- Returns FOUND_STR as string if found, else null if
- not found.
- */
-
- global string FOUND_STR
-
- proc WaitXclock
-
- TimerValue = 50 /* Increase to wait longer
- Decrease to shorten wait time */
- if device = "MODEM" then {
- case terminal of
- "FTTERM": TermString = "X" : TermColumn = 10
- "TYMNET78": TermString = "L" : TermColumn = 59
- default: TermString = "X" : TermColumn = 8
- endcase
- }
- else TermString = "X" : TermColumn = 8
-
- Xclock = WinString(0FEh, TermColumn, 1, 16)
-
- label WaitX
- while Xclock = TermString
- wait 1 tick
- Xclock = WinString(0FEh, TermColumn, 1, 16)
- wend
-
- stime = Systime + TimerValue
- repeat
- wait 1 tick
- Xclock = WinString(0FEh, TermColumn, 1, 16)
- if Xclock = TermString then jump WaitX
- until stime = Systime
-
- endproc
-
-
- proc WaitString takes wait_str, wait_timer
-
- FOUND_STR = wait_str /* assume we'll find it */
-
- maxtime = (intval (wait_timer)) * 10 /* convert to ticks */
- timecnt = 0
-
- while maxtime > timecnt
- for x = 0 to 23
- if (instr(winstring((x),0,80,16),wait_str)) <> 0 then goto WaitStrEnd
- next x
- wait 1 tick
- timecnt = timecnt + 1
- wend
-
- FOUND_STR = "" /* didn't find it, return null */
-
- label WaitStrEnd
-
- endproc
-
-
-