Hitachi

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


$TOKEN (get token)

$TOKEN extracts a token from a specified character string as defined by the position of the token to be extracted and a separator character.

Organization of this page

Syntax

return-value=$TOKEN(base-character-string,extraction-token-position,separator-character)

Values

Status

The following table lists and describes the possible statuses:

Status

Description

NORMAL

Normal end

NODATA

The value specified by base-character-string was not found at the position specified by extraction-token-position.

ERROR

Script execution interrupted

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

Legend:

—: Not applicable

Example

The following example sets the character string ABC/DEF/GHI into NAME, and then extracts DEF from NAME and sets it into VALUE:

[SET_VALUE]
  DATA = 'ABC/DEF/GHI'
  VAL = $TOKEN(DATA,1,'/')
  MSG = 'TOKEN = ' + VAL
  $ECHO(MSG)
Execution result:

TOKEN = DEF