Did you see this?
Code:
CommandParser:
; Fast searcher! Case sensitive.  Closely based on info provided by Darrel Taylor.
; Searches through Str1. If it finds the strings listed in the quotes, it returns which one it found.
; the max length of STR1 that will be searched is in MaxSearchLen
   
    Cmd = 255  ; In case of no match
    MaxSearchLen = 20            
 
    Parse01: Cmd=01 : ARRAYREAD Str1,MaxSearchLen,Parse02,[WAIT("LedOn")] : GOTO Foundit
    Parse02: Cmd=02 : ARRAYREAD Str1,MaxSearchLen,Foundit,[WAIT("LedOff")] : GOTO Foundit
Foundit:
    return
Use STR modifier to receive string from modem into array Str1. Then call parser and check Cmd, if Cmd=1 then led on, if Cmd=2 then led off.