Memory.Compare

number Memory.Compare ( 

number  Memory1,

number  Memory2,

number  Length )

Description

Compare two memory areas.

Parameters

Memory1

(number) Address of Memory1.

Memory2

(number) Address of Memory2.

Length

(number) Number of Byte that you want compared in both memory block.

Returns

(number) Returns 1 if its equal or 0 if it doesn't match.

ResultVariable

When adding an action with the script editor, you can use this field to specify a variable that the return value will be stored in.

Example

mem = Memory.Allocate(1024); mem2 = Memory.Allocate(1024); Memory.PutString(mem, "AMSWaves", -1, "Ascii"); Memory.PutString(mem2, "AMSWaveS", -1, "Ascii"); result = Memory.Compare(mem, mem2, 8); -- Set Length to 7 and see Result if result == 1 then Dialog.Message("Compare Memory Result", "Mem1 and Mem2 are Equal"); else Dialog.Message("Compare Memory Result", "Mem1 and Mem2 are not Equal"); end Memory.Free(mem) Memory.Free(mem2)

See also:  Related Actions

Сайт управляется системой uCoz