ScriptName "MemorySearchString" ScriptAuthor "GS" ScriptVersion "V 1.00" // Search a sub-buffer into a buffer // Data Manipulation - MemorySearchString // MemorySearchString ( w_Length1 , a_Source1 , w_Length2 , a_Source2 ) ; // with optional parameter // MemorySearchString ( w_Length1 , a_Source1 , w_Length2 , a_Source2 , w_X1 , w_X2) ; // buffer var w_length1: word; moveconst (w_length1, 10); var a_source1: buffer[20]; moveconst (a_source1[0], "1234567890"); // sub-buffer var w_length2: word; moveconst (w_length2, 3); var a_source2: buffer[20]; moveconst (a_source2[0], "456"); // optinal parameter var w_X1: word; var w_X2: word; :start; MemorySearchString ( w_Length1 , a_Source1[0] , w_Length2 , a_Source2[0] ) ; // w_Length1 = 3 moveconst (w_length1, 10); moveconst (w_length2, 2); moveconst (a_source1[0], "1234567890"); moveconst (a_source2[0], "5678"); MemorySearchString ( w_Length1 , a_Source1[0] , w_Length2 , a_Source2[0] ) ; // w_Length1 = 4 moveconst (w_length1, 10); moveconst (w_length2, 2); moveconst (a_source1[0], "123 "); moveconst (a_source2[0], "5678"); MemorySearchString ( w_Length1 , a_Source1[0] , w_Length2 , a_Source2[0] ) ; // w_Length1 = 0xFFFF not found moveconst (w_length1, 10); moveconst (w_length2, 2); moveconst (w_X1, 2); moveconst (w_X2, 0); moveconst (a_source1[0], "1254567890"); moveconst (a_source2[0], "5678"); MemorySearchString ( w_Length1 , a_Source1[0] , w_Length2 , a_Source2[0] , w_X1 , w_X2 ) ; // w_Length1 = 4 jump :start;