Focus
TheFocusmethod focuses this storage unit on the specified focus context.
ODStorageUnit Focus (in ODPropertyName propertyName, in ODPositionCode propertyPosCode, in ODValueType valueType, in ODValueIndex valueIndex, in ODPositionCode valuePosCode);
propertyName- The name of the property in the desired focus context, or
kODNULLto ignore this parameter.propertyPosCode- The position code, relative to the current focus context, of the property in the desired focus context, or
kODPosUndefinedto ignore this parameter.valueType- The value type of the value in the desired focus context, or
kODNULLto ignore this parameter.valueIndex- The value index of the value in the desired focus context, or 0 to ignore this parameter.
valuePosCode- The position code, relative to the current focus context, of the value in the desired focus context, or
kODPosUndefinedto ignore this parameter.- return value
- A reference to this storage unit, focused on the specified focus context.
DISCUSSION
Your part calls this method; its parameters specify the desired focus context.
After this method executes successfully, this storage unit's offset is 0.
- To focus on the entire storage unit, pass
kODNULLas the property name parameter,kODPosAllas the property position code parameter,kODTypeAllas the value type parameter, 0 as the value index parameter, andkODPosUndefinedas the value position code parameter.- To focus on a property, either pass its name as the property name parameter or pass
kODNULLas the property name parameter and the appropriate code as the property position code parameter. PasskODTypeAllas the value type parameter, 0 as the value index parameter, andkODPosUndefinedas the value position code parameter.- To focus on a value, specify the property containing the value using either the property name parameter or the property position code parameter, as described in the previous item. You can specify the value by its type, its index, or its position.
- To use type, pass the type of the desired value as the value type parameter, 0 as the value index parameter, and
kODPosUndefinedas the value position code parameter.- To use index, pass
kODNULLas the value type parameter, the index of the desired value as the value index parameter, andkODPosUndefinedas the value position code parameter.- To use the position code, pass
kODNULLas the value type parameter, 0 as the value index parameter, and the appropriate code as the value position code parameter.
Before calling this method, you can call the
Existsmethod to check whether the specified focus context exists.EXCEPTIONS
kODErrIllegalPropertyName- The specified property name is improperly formed or illegal.
kODErrPropertyDoesNotExist- This storage unit does not contain the specified property.
kODErrSUValueDoesNotExist- This storage unit does not contain the specified value.
kODErrUnsupportedPosCode- One of the specified position codes is not supported.
kODErrValueIndexOutOfRange- The specified property has no value at the specified index.
kODErrZeroRefCount- This storage unit has a reference count of 0.
SEE ALSO
TheODPositionCodetype (page 915).
TheODPropertyNametype (page 904).
TheODValueIndextype (page 904).
TheODValueTypetype (page 904).
TheODStorageUnit::Existsmethod (page 681).
TheODStorageUnit::FocusWithCursormethod (page 686).
Listing 2-41 on page 100 in OpenDoc Cookbook.
Listing 2-45 on page 106 in OpenDoc Cookbook.
Listing 2-46 on page 108 in OpenDoc Cookbook.
"Focusing a Storage Unit" on page 274 in OpenDoc Programmer's Guide.