andyf, What I used to do is make sure the receiving array is all null by clearing it in a sort of loop. Then using the HSERIN options of "STR arrayname/maxumum characters/13" will load the array with no more than the maximum characters and terminate the input or, any number of characters until a carriage return is encountered. Then within some sort of loop look for the last character to be null and that is the last received character. Something simillar to this code:
Counter = 0
While counter <= maxcharacters
in_ctl(counter) = 0
Counter = Counter + 1
wend
HSERIN [WAIT("*TEST"),STR in_ctl\Maxcharacters\13]
Counter = 0
While (in_ctl(Counter) <> 0) and (Counter < Maxcharacters)
Counter = Counter + 1
wend
'At this point Counter has the number of characters in the received array -1

Dave Purola,
N8NTA