/* * REMOVE@.REX * * The REMOVE@.REX external function converts electronic mail addresses * from the form 'person@place!place' or 'place!person@place' to the form * 'place!place!person'. * * The syntax of REMOVE@.REX is * remove@(address) * * where (address) is the mail address to be converted. * * REMOVE@.REX finds the @ component of the embedded address and * relocates it to the end, after another ! * * For example: * remove@(uunet!abc@this.that.edu)=uunet!this.that.edu!abc * */ parse arg address x = pos("@",address) if x > 0 & pos("!",address)>0 then do y = lastpos("!",address,x) head = "" if y > 0 then do if y > 1 then head = left(address,y-1) address = right(address,length(address)-y) end tail = "" if x > y+1 then tail = left(address,x-y-1) address = right(address,length(address)-(x-y)) bat = "!" if head = "" then bat = "" address = head||bat||address||"!"||tail end return address