home *** CD-ROM | disk | FTP | other *** search
- # PARSNAME.SCR
- # passed a string containing "USERNAME is phoning you" in variable @message
- # return USERNAME in @message
- #
- .lup
- #
- strlen @message # get length of string
- set @str2 = @message # save string
- set @len = @status # save length
- #
- strinx @message, " " # find where the next blank is
- if @status = "0" # if no occurance
- set @message = "" # then no name found, null out
- goto .done # return to calling script
- end
- let @trim = @status + 1 # we want the character after the blank
- #
- strtrim @message,@trim,@len # extract from just after the blank to end
- let @trim = @trim - 2 # reset blank pointer to just before the blank
- #
- strtrim @str2,1,@trim # remove the first word found in @str2
- if @str2 = "is" # if the first word is 'is' then previous word was username
- set @message = @savestr # place the username into the message var
- goto .done # return to calling script
- end
- #
- set @savestr = @str2 # save extracted string
- goto .lup # and try again
- #
- .done
- #
- strlen @message # check username for length
- if @status = "0" goto .return # if null return
- set @len = @status # save length
- #
- strinx @message, "\n" # see if there is a carriage return
- if @status = "0" goto .return # no - then return
- let @trim = @status + 1 # yes then
- strtrim @message,@trim,@len # strip off
- #
- .return
- return # return to calling script
-