Skip to main content

(19) _CMPWK

Effect

Compares the value of a work to the value of another work.

When passing a work, it will check its value and use that as the work to use. When passing a float, it will use that value as the work to use.

caution

Broken and always considers work1 as greater.

Syntax

_CMPWK(work1, work2)
ArgumentDescriptionTypesRequired
work1The work to compareWork, FloatRequired
work2The work to compare toWork, FloatRequired

Example

_LDVAL(@LOCALWORK4, 9)
_LDVAL(@LOCALWORK8, 13)
_LDVAL(@LOCALWORK1, 4)
_CMPWK(@LOCALWORK1, 8)
_IF_JUMP('EQ', 'ev_dummy')

The above script will set:

  • Work variable @LOCALWORK4 to 9;
  • Work variable @LOCALWORK8 to 13;
  • Work variable @LOCALWORK1 to 4.

Then, the values of work 4 (@LOCALWORK4) and work 8 (@LOCALWORK8) are compared. Due to a bug, no matter their values, @LOCALWORK4 is determined to be greater.

Next, the result of the comparison is checked. Since the result is "greater" and not "equal", ev_dummy is not jumped to and script execution continues on the next line.