beautypg.com

Objget, Objget, ob – Visara Master Console Center Scripting Guide User Manual

Page 152

background image

Chapter 5 Script Commands

Scripting Guide

152

OBJGET

Syntax:

OBJGET( %ObjID, $ObjFieldName) ==> $CurrentValue

Description:

Returns the current value in an object’s field.

Action:

The current value in the field specified by ObjFieldName for the object

specified by ObjID is returned.

Parameters:

%ObjID. Numeric expression. The ID assigned to the object from

which to get the value. Refer to Object ID on page 26 for more
information.
$ObjFieldName. String expression. The field name in the object to

get the value from. Refer to Object Field on page 26 for more
information.

Returns:

String value. The current value in the field. Integer values are

converted and returned as strings.
If $CurrentValue is the empty string, “”, the ERRORNUM() function

will return a value according to the following table:
Manifest Constant

Description

Err_None

No error has occurred. The correct

value for the object’s field is the empty

string.

Err_BadArgs

$ObjFieldName is not a member of the

object.

Err_Obj_InvalidId

%ObjID

does not contain a valid object

id.

Notes:

1. Refer to the description of the VAL() command for information on

string to numeric conversions.

2. When retrieving more than 25% of the fields of an object,

OBJGETARRAY() is more efficient than OBJGET().

Example:

//This example gets the current status of the Cron
// task, running on the Solaris OS, running on the
// Webserv CPU.
$CronExpr := “WEBSERV:SOLARIS:CRON”
%CronID := OBJID( SW, $CronExpr)
$Current_fieldname := “Current_status”
$Cron_Current_Status := OBJGET (%CronID, $Current_fieldname)

See Also:

OBJEXEC, OBJGETARRAY, OBJID, OBJIDARRAY, OBJSET,

OBJSETARRAY