; Afax:s/SetLastFax
; Script sets local variable lastfax to name of last fax received
;
if exists FAXREC:.next
set num `type FAXREC:.next`
set num `eval $num - 1`
set lastfax FAXREC:FAX$num
if not exists $lastfax
set lastfax FAXREC:FAX0$num
if not exists $lastfax
set lastfax FAXREC:FAX00$num
if not exists $lastfax
set lastfax FAXREC:FAX000$num
if not exists $lastfax
unset lastfax
endif
endif
endif
endif
endif