ScriptName " String " ScriptAuthor "St" ScriptVersion " 20 " //Beschreibung: String compare SetErrorHandler ( :ErrorAddress ) ; var len: word; // Anzahl Byte´s zu testen, Returnwert ist das Vergleichsresult // 0 : B1=B2 ; 1: B1>B2 ; 2 : B1 B1 > B2 Fill ( b1[0] , vb_const0 , vw_const20 ) ; Fill ( b2[0] , vb_const0 , vw_const20 ) ; moveconst(fromB1Index,0); moveconst(fromB2Index,0); Moveconst(b1[5],#1); Moveconst(len,5); // mit optionalem Parameter MemoryCompare ( len , b1[0] , b2[0] , fromB1Index , fromB2Index) ; // len = 0 => B1 == B2 , da nur die ersten 4 Byte verglichen werden Fill ( b1[0] , vb_const0 , vw_const20 ) ; Fill ( b2[0] , vb_const0 , vw_const20 ) ; moveconst(fromB1Index,0); moveconst(fromB2Index,0); Moveconst(b1[5],#1); Moveconst(len,6); MemoryCompare ( len , b1[0] , b2[0] , fromB1Index , fromB2Index) ; // len = 1 => B1 > B2 , B1 ist größer da im letzten also 6 Byte ein grösserer Wert enthalten ist Fill ( b1[0] , vb_const0 , vw_const20 ) ; Fill ( b2[0] , vb_const0 , vw_const20 ) ; moveconst(fromB1Index,5); moveconst(fromB2Index,5); Moveconst(b1[5],#1); Moveconst(len,6); MemoryCompare ( len , b1[0] , b2[0] , fromB1Index , fromB2Index) ; // len = 1 => B1 > B2 , B1 ist größer da im ersten vergleichs Index ein grösserer Wert enthalten ist Fill ( b1[0] , vb_const0 , vw_const20 ) ; Fill ( b2[0] , vb_const0 , vw_const20 ) ; moveconst(fromB1Index,6); moveconst(fromB2Index,5); Moveconst(b1[5],#1); Moveconst(len,6); MemoryCompare ( len , b1[0] , b2[0] , fromB1Index , fromB2Index) ; // len = 0 => B1 == B2 Fill ( b1[0] , vb_const0 , vw_const20 ) ; Fill ( b2[0] , vb_const0 , vw_const20 ) ; moveconst(fromB1Index,0); moveconst(fromB2Index,0); Moveconst(b2[3],#1); Moveconst(len,6); MemoryCompare ( len , b1[0] , b2[0] , fromB1Index , fromB2Index) ; // len = 2 => B1 < B2 Fill ( b1[0] , vb_const255 , vw_const20 ) ; Fill ( b2[0] , vb_const255 , vw_const20 ) ; moveconst(fromB1Index,0); moveconst(fromB2Index,0); Moveconst(len,20); MemoryCompare ( len , b1[0] , b2[0] , fromB1Index , fromB2Index) ; // len = 0 => B1 == B2 jump:start; :ErrorAddress; stop; return;