Hitachi

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


$SETARRAYBYKEY (set value to array with key)

$SETARRAYBYKEY adds keyed information to an array.

Organization of this page

Syntax

$SETARRAYBYKEY(array-name,key-value,character-string)

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 updates the value of array number 1 in the key MEM from 128 to 1024, and acquires the updated value by specifying its key:

[SET_VALUE]
  $CLEARARRAY(ARY)
 
  $SETARRAYBYKEY(ARY,'CPU','100')    # ARY[1] CPU[1]
  $SETARRAYBYKEY(ARY,'CPU','200')    # ARY[2] CPU[2]
  $SETARRAYBYKEY(ARY,'HD' ,'40')     # ARY[3] HD[1]
  $SETARRAYBYKEY(ARY,'HD' ,'20')     # ARY[4] HD[2]
  $SETARRAYBYKEY(ARY,'MEM','128')    # ARY[5] MEM[1]
  $SETARRAYBYKEY(ARY,'MEM','256')    # ARY[6] MEM[2]
 
  $UPDARRAYBYKEY(ARY,'MEM',1,'1024')
 
  VAL = $GETARRAYBYKEY(ARY,'MEM',1)
  MSG = 'ARY MEM[1] = '+VAL
  $ECHO(MSG)
Execution result:

ARY MEM[1] = 1024