1
2
|
PACKETtextalsrowDEFINESins,del,CAT,ipos,dump,replaceiac,VSUB,VISUB:LETnil13byte="�������������",nil4byte="����",nilbyte="�";TEXT VARg1,code2:="��";PROCins(TEXT VARrow,INT CONSTwo,was):replace(code2,1,was);g1:=subtext(row,2*wo-1);row:=subtext(row,1,2*wo-2);rowCATcode2;rowCATg1END PROCins;PROCdel(TEXT VARrow,INT CONSTwo):g1:=subtext(row,2*wo+1);row:=subtext(row,1,2*wo-2);rowCATg1END PROCdel;OP CAT(TEXT VARrow,INT CONSTwas):replace(code2,1,was);rowCATcode2END OP CAT;INT PROCipos(TEXT CONSTrow,INT CONSTwas):INT VARstart:=0;replace(code2,1,was);REPstart:=pos(row,code2,start+1)UNTILstartMOD2=1ORstart=0PER;(start+1)DIV2END PROCipos;PROCdump(TEXT VARrow):INT VARi;FORiFROM1UPTOlength(row)DIV2REPput(rowISUBi)PER END PROCdump;PROCreplaceiac(TEXT VARstring,INT CONSTwo,TEXT CONSTwas):IF LENGTHstring<=LENGTHwas+wo-1THENstretch(string,LENGTHwas+wo-1)FI;replace(string,wo,was)END PROCreplaceiac;PROCstretch(TEXT VARt,INT CONSTwo):WHILE LENGTHt<=wo-13REPtCATnil13bytePER;WHILE LENGTHt<=wo-4REPtCATnil4bytePER;WHILE LENGTHt<woREPtCATnilbytePER END PROCstretch;PROCreplaceiac(TEXT VARstring,INT CONSTwo,INT CONSTwas):IF LENGTHstring<=2*(wo+1)THENstretch(string,2*(wo+1))FI;replace(string,wo,was)END PROCreplaceiac;INT OP VSUB(TEXT CONSTstring,INT CONSTpos):code(stringSUBpos)END OP VSUB;INT OP VISUB(TEXT CONSTstring,INT CONSTpos):IFpos*2<=LENGTHstringTHENstringISUBposELSE0FI END OP VISUB;END PACKETtextalsrow;
|