proc main when $CARRIER call closedown ;Call procedure when value of $CARRIER system value changes while 1 ;Loop forever yield endwhile endproc proc closedown if $CARRIER == 0 ;If $CARRIER value has changed from 1 to 0 pwexit ;Close Procomm Plus endif endproc