GenValue: 3.1 GenValue Basics: The Value

Up: GEOS SDK TechDocs | Up | Prev: 3 GenValue Basics | Next: 3.2 The Minimum and Maximum
GVLI_value, MSG_GEN_VALUE_SET_VALUE, MSG_GEN_VALUE_SET_INTEGER_VALUE, MSG_GEN_VALUE_GET_VALUE

The GVLI_ value instance field stores the current numerical value of the GenValue. You may set an initial value for the GenValue to appear with by setting this instance field in your Goc file. This value is a fixed point number; use MakeWWFixed to create this fixed point number in your instance data.

Any user changes on the value within the text field will not affect GVLI_ value until MSG_GEN_APPLY applies that value. If the GenValue operates in delayed mode, it will be marked modified in its GVLI_ stateFlags whenever a user change occurs; those changes will be applied when the GenValue receives a MSG_GEN_APPLY . In most cases, however, a GenValue operates in immediate mode, which will result in an immediate change in GVLI_ value .

Code Display 8-4 Setting an Initial Value

/* This GenValue will appear with the initial integer value of two. MakeWWFixed
 * creates a fixed point value. */
@object GenValueClass MyValue = {
    GI_visMoniker = "My Value";
    GVLI_value = MakeWWFixed(2.0);
}

GenValueClass provides several messages to change the value without user control. MSG_GEN_VALUE_SET_VALUE sets this numeric value to a passed fixed point value; this fixed point value may be any integer or decimal value. MSG_GEN_VALUE_SET_INTEGER_VALUE is a simpler message which sets GVLI_ value to an integer value passed. Neither of these messages mark the GenValue modified; you can do this with MSG_GEN_VALUE_SET_MODIFIED_STATE .

MSG_GEN_VALUE_SET_VALUE

void	MSG_GEN_VALUE_SET_VALUE(
        WWFixedAsDWord		value,
        Boolean		indeterminate);

This message sets the GVLI_value field of the GenValue to the passed value . This message clears a GenValue's modified state in its GVLI_ stateFlags . To mark the GenValue modified send MSG_GEN_VALUE_SET_MODIFIED_STATE after sending this message.

Source: Unrestricted. This message is also used internally when responding to user actions.

Destination: Any GenValue object.

Parameters: value The fixed point value to set GVLI_ value to. If you only need an integral value, consider using MSG_GEN_VALUE_SET_INTEGER_VALUE instead.

indeterminate
TRUE to mark the GenValue indeterminate, FALSE to mark it non indeterminate.

Return: Nothing.

Interception: Generally not intercepted.

MSG_GEN_VALUE_SET_INTEGER_VALUE

void	MSG_GEN_VALUE_SET_INTEGER_VALUE(
        word		value,
        Boolean		indeterminate);

This message sets the GVLI_ value to the passed integer (word-sized) value. GVLI_ value will then contain this value in its high (integral) word and zero in its low (fractional) word. The modified state of the GenValue will be cleared.

Source: Unrestricted. This message is also used internally when responding to user actions.

Destination: Any GenValue object.

Parameters: value The signed integer value to set GVLI_ value to.

indeterminate
TRUE to mark the GenValue indeterminate, FALSE to mark it non indeterminate.

Return: Nothing.

Interception: Generally not intercepted.

MSG_GEN_VALUE_GET_VALUE

WWFixedAsDWord MSG_GEN_VALUE_GET_VALUE();

This message returns the value stored in the GenValue's GVLI_value instance field. This returned value will be a fixed point number.

Source: Unrestricted.

Destination: Any GenValue object.

Parameters: None.

Return: The fixed point numerical value of the GVLI_ value instance field.

Interception: Generally not intercepted.

MSG_GEN_VALUE_GET_INTEGER_VALUE

@alias (MSG_GEN_VALUE_GET_VALUE) 
word MSG_GEN_VALUE_GET_INTEGER_VALUE();

This message returns the integral portion of the GenValue's value.

Source: Unrestricted.

Destination: Any GenValue object.

Parameters: None.

Return: The integral value of the GVLI_ value instance field.

Interception: Generally not intercepted.


Up: GEOS SDK TechDocs | Up | Prev: 3 GenValue Basics | Next: 3.2 The Minimum and Maximum