Hitachi

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


$GETKEYFROMARRAY (get key information from array)

$GETKEYFROMARRAY acquires the key of a specified array number from keyed information stored in an array.

Organization of this page

Syntax

return-value=$GETKEYFROMARRAY(array-name,array-number)

Values

Status

The following table lists and describes the possible statuses:

Status

Description

NORMAL

Normal end

NODATA

No information exists for the specified array number.

ERROR

—

Script execution interrupted

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

Legend:

—: Not applicable

Example

The following example acquires the key information and value of the fifth element of the array variable ARY:

[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]
 
  KEY = $GETKEYFROMARRAY(ARY,5)
  VAL = $GETARRAY(ARY, 5)
  MSG = 'ARY[5]: KEY=' + KEY + ' VAL=' + VAL
  $ECHO(MSG)
Execution result:

ARY[5]: KEY=MEM VAL=128