Category : Pascal Source Code
Archive   : MEMCMP.ZIP
Filename : TMEMCOMP.PAS
program CompTest;
uses MemComp;
type
Tipe = array[1..128] of byte;
var
Var1,Var2 : Tipe;
I,CompRes : Word;
begin
FillChar(var2,SizeOf(Tipe),0); { init Var2 to all zeros }
for I := 1 to 128 do { set var1 = 1 2 3 4 5 ... 128 }
Var1[I] := I;
CompRes := CompMem(Var1,Var2,128); { compare, should return first }
{ byte as non match }
WriteLn('While not equal, CompMem = ',CompRes); { show results }
Var2 := Var1; { make them equal }
CompRes := CompMem(Var1,Var2,128); { test again, should return 0 }
WriteLn('While equal, CompMem = ',CompRes);
Var2[128] := 0; { make all equal except last byte }
CompRes := CompMem(Var1,Var2,128); { test again, should return 128 }
WriteLn('While not equal, CompMem = ',CompRes);
end.
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/