Visara Master Console Center Scripting Guide Manual do Utilizador Página 156

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 262
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 155
Chapter 5 Script Commands
Scripting Guide 156
OBJIDARRAY
Syntax:
OBJIDARRAY( %Class, %ObjIDParent, %AssocArray) ==> %Children
Description:
Populates an associative numeric array with object ids from the
children of a parent object.
Action:
Populates the child object ids in the class specified by the Class
parameter for the parent object specified by the ObjIDParent
parameter into an associative array. The associative array index
values are the object names (names only, not the fully qualified object
key— refer to the descriptions of Object Name on page 25 and Object
Key on page 25 for more information. The associative array data
values are the object ids.
Parameters:
%Class. Numeric expression. The icon class of the child objects for
which to get the object ids. Valid classes are CPU, OS, and SW. Refer
to Icon Class/Icon Name on page 29 for more information.
%ObjIDParent. Numeric expression. The object id of the parent
object. This object is the parent of the objects for which to get the
object ids. Refer to the description of Object ID for more information.
%AssocArray. Associative numeric array. The array to populate with
the child object ids.
%Children. Numeric value. The number of children of the parent
object.
Returns:
Integer. The number of children of the parent object. If %Children is
0, the ERRORNUM() function returns one of the following values:
Manifest Constant Description
Err_None No error occurred. The correct value for
the object’s field is the empty string.
1001 %Class is not CPU, OS, or SW.
Err_BadArgs %ObjIDParent does not contain any
objects of the requested %Class.
Err_Obj_InvalidId %ObjIDParent does not contain a valid
object id.
Notes:
1. This command is intended to get names from the SW level.
Conversely, the OBJIDARRAY() command does not get
commands from the SW level.
2. In the following example, the ‘/’ character means that the code line
continues on the next line. Do not interpret it literally.
Example:
// The following example assumes a CPU named ‘MyCPU’, an
// OS named ‘MyOS’, and three tasks listed on the swlist
// for ‘MyOS’.
$MyObject := “MyCPU:MyOS”
%MyID := OBJID( OS, $MyObject )
%ReturnCode := OBJIDARRAY( SW, %MyID, %aaKidIDs )
ASSOCKEYS( %aaKidIDs, $aKidIDs )
%Length := ALEN( $aKidIDs )
%Count := 1
WHILE %Count <= %Length
LOG(LOG_EXEC, “Index [“ + %Count + “] is: “ + /
$aKidIDs[%Count], 1)
Vista de página 155
1 2 ... 151 152 153 154 155 156 157 158 159 160 161 ... 261 262

Comentários a estes Manuais

Sem comentários