Overview
Compares two string at the specified memory address.
(number) Address of Memory1.
(number) Address of Memory2.
(boolean) String comparison is case insensitive (a ~= A). By default the comparison is case sensitive.
(number) Number of Char that want compared if you want all char in both memory block compared set it -1.
(number) Returns 0 if Memory1 equals to Memory2, returns 1 if Memory1 greater than Memory2 , returns -1 if Memory1 is lower than Memory2.
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.
mem = Memory.Allocate(1024) mem2 = Memory.Allocate(1024) Memory.PutString(mem, "AMSWaves", -1, "Ascii") Memory.PutString(mem2, "AMSWAVES", -1, "Ascii") result = Memory.CompareString(mem, mem2, false, -1); if result == 1 then Dialog.Message("Compare Memory String Result", "Mem1 greater than Mem2") elseif result == 0 then Dialog.Message("Compare Memory String Result", "Mem1 equals to Mem2") else Dialog.Message("Compare Memory String Result", "Mem1 is lower than Mem2") end Memory.Free(mem) Memory.Free(mem2)
See also: Related Actions