C* Make sure we don't overflow the string: c eval retlen = (nextpos + datalen) - 1 c if retlen > %size(retdata) c eval datalen=datalen-(retlen-%size(retdata)) c endif
C* If there is nothing to write, return THAT... c if datalen < 1 c return 0 c endif
C* Here we add any data sent to the end of our 'retdata' string: c eval %subst(retdata: nextpos) = c %subst(data:1:datalen) c eval nextpos = nextpos + datalen
P Incoming B D Incoming PI 10I 0 D Descriptor 10I 0 D Data 8192 Options(*VarSize) D DataLen 10I 0 Value c return datalen P Incoming E