%include "CONSTS" %include "FORMS" %include "SEG7" %include "PROCS" %external %string(127) %function CLI PARAM ! Returns the parameter string passed into this task ! by the Command Interpreter, after suitable conversion. %integer l, ad, s %owninteger called = 0 %if called = 0 %start ad = addr(S7_param str) ad = ad + 1 %while byteinteger(ad) = ' '; ! skip leading spaces s = ad; ! mark start ad = ad + 1 %while byteinteger (ad) # nl; ! find end l = ad - s; ! find length %while ad # s %cycle byteinteger (ad) = byteinteger (ad-1); ! shuffle up 1 place ad = ad - 1 %repeat length(S7_param str) = l; ! set length byte called = \called; ! conversion done flag %finish %result = S7_param str %end %end %of %file