home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS 1
/
BBS#1.iso
/
communic
/
rbcom400.ha
/
EXAMPLES.MAC
< prev
next >
Wrap
Text File
|
1991-04-05
|
4KB
|
124 lines
; RBcomm macro examples
;
; by Ralf Brown
;---------------------------------------------------------------
; beep every half hour
; continues until another macro file is loaded or some other binding
; issues a CANCEL_DELAYED ALL
;
F2 DELAYED 1800
CALL #199 ; 200-255 are reserved
#199 MULTI
BEEP
DELAYED 1800
CALL #199
END
; I have been asked "why CALL instead of PUSHKEY?" and "why doesn't the second
; CALL cause some kind of infinite loop?"
;
; The difference between PUSHKEY and CALL is that PUSHKEY #199 will not cause
; the #199 macro to execute until the next time RBcomm reads the keyboard at
; the terminal emulation level (it would be discarded by the line-input
; function, for example). The CALL executes immediately and then continues
; execution with the next line of the macro (if any). As written, the 'beep
; every half hour' macro will cause a beep even if currently executing another
; macro; with PUSHKEY, the beep would not occur until the current macro
; completes--unless the macro is/will execute a command which takes input, in
; which case the #199 will be lost, ending the repetition. You don't get an
; infinite nesting because the DELAYED command simply stores a pointer and the
; desired time, then exits. Thus, the macro works something like this:
;
; create an event for CALL #199
; exit F2
; ...
; time to wake up and execute the CALL #199
; BEEP
; create an event for CALL #199
; exit #199
; exit CALL #199
; ...
; time to wake up again and execute the CALL #199
; BEEP
; create an event for CALL #199
; exit #199
; exit CALL #199
; ...
; time to wake up again and execute the CALL #199
; etc.
;
; As you can see, at any given time, there is at most one pending event and one
; invocation of #199.
;---------------------------------------------------------------
; display a running clock in the DESQview notification window
; continues until another macro file is loaded or some other binding
; issues a CANCEL_DELAYED ALL
;
F3 MULTI
MESSAGEBOX "%t on %d" ; var expansion is new capability added in v3.33
DELAYED 1
CALL F3
END
;---------------------------------------------------------------
; display a time-limited message without DESQview message-box
; note: should be on top-most row to avoid a mess if screen scrolls during
; wait interval
;
F4 MULTI
MESSAGE 0 50 "^ATimed test message (%t)"
DELAYED 3
MESSAGE 0 50 " " ; same length as orig message
END
;---------------------------------------------------------------
; repeatedly try to elicit a response from the remote system
; abort after ten minutes of no response
;
F5 MULTI
DELAYED 600
ABORT_UNTIL ; give up after ten minutes
UNTIL SUCCESS
{
TEXT "\r"
WAITFOR 2 "login:"
}
CANCEL_DELAYED LAST ; no more need for the timed abort
END
;---------------------------------------------------------------
; Set up a fancy alarm for announcing the completion of a file
; transfer (or TYPE) or successful connection with a remote system.
;
; If the "Alarm" pseudokey is not bound, it is equivalent to
; Alarm BEEP
;
Alarm REPEAT 2
{
SOUND 500 1 ; quickly rising tone
SOUND 600 1
SOUND 700 1
SOUND 800 1
SOUND 900 1
SOUND 1000 1
SOUND 0 3 ; pause briefly between repetitions
}
;---------------------------------------------------------------
; allow sample fancy alarm to be invoked at will
;
F6 ALARM
;---------------------------------------------------------------
; notify user of any incoming calls (only for DESQview and Hayes-comp modems)
;
OnLoad WHEN 0 "RING^M"
NOTIFY "Phone is ringing"
;---------------------------------------------------------------
; add the standard bindings which have not been overridden
#include "rbcomm"