Hitachi

JP1 Version 12 JP1/IT Desktop Management 2 - Asset Console Creating an Access Definition File Guide


$STRCMP (compare strings)

$STRCMP compares two character strings.

Organization of this page

Syntax

return-value=$STRCMP(character-string-1,character-string-2)

Values

Status

The following table lists and describes the possible statuses:

Status

Description

NORMAL

Normal end

NODATA

ERROR

Script execution interrupted

An invalid argument was specified, or an error other than the above occurred.

Legend:

—: Not applicable

Example

The following example compares the characters strings of DATA1 and DATA2, and outputs STRCMP IDENTICAL if the strings are identical, and STRCMP DIFFERENT ($STRCMP-return-value) if they are not identical:

[SET_VALUE]
  DATA1 = 'Asset Console1'
  DATA2 = 'Asset Console2'
  VAL = $STRCMP(DATA1,DATA2)
[IF]
  VAL = 1
  [THEN]
    [SET_VALUE]
      MSG  = 'STRCMP IDENTICAL'
      $ECHO(MSG)
  [ELSE]
    [SET_VALUE]
      MSG  = 'STRCMP DIFFERENT ('+VAL+')'
      $ECHO(MSG)
[IF_END]
Execution result:

STRCMP DIFFERENT (0)