beautypg.com

Objset, Jset, Bjset – Visara Master Console Center Scripting Guide User Manual

Page 158: Jset, ob, Set, objs

background image

Chapter 5 Script Commands

Scripting Guide

158

OBJSET

Syntax:

OBJSET( %ObjID, $ObjFieldName, $NewValue) ==> %ErrCode

Description:

Sets the current value in an object’s field.

Action:

The field specified by ObjFieldName for the object specified by ObjID is

set to the value specified by the NewValue parameter.

Parameters:

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

which to set the value. Refer to the description of 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.
$NewValue. String expression. The value to set the specified field to.
A target of an integer field will have its value automatically converted

from the string value to a numeric value in the same manner as the

VAL() command.

Returns:

A numeric value indicating the status of the operation, as follows:
Manifest Constant

Description

ERR_NONE

No

error

ERROR Error
If an error occurred, the ERRORNUM() function returns one of the
following values:
Manifest Constant

Description

Err_None

No error has occurred. The correct

value for the object’s field is the empty

string.

Err_BadArgs

%Class

is

not a supported class type.

Err_Obj_InvalidId

%ObjIDParent does not contain a valid

object id.

Notes:

1. Refer to the description of the STR() command for string to

numeric conversions.

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

OBJSETARRAY() is more efficient than OBJSET().

Example:

//This example sets the desired status of the Cron
// task ( running on the Solaris OS, running on the
// Webserv CPU ) to down.
$CronExpr := “WEBSERV:SOLARIS:CRON”
%CronID := OBJID( SW, $CronExpr)
$Desired_fieldname := “Desired_status”
$New_Desired_value := “down”
%ErrCode := OBJSET( %CronID, $Desired_fieldname,
$New_Desired_value)

See Also:

OBJEXEC, OBJGET, OBJGETARRAY, OBJID, OBJIDARRAY,
OBJSETARRAY