Loading...
 

Access printout

Access printout

Expressions that describe the access to data and methods of the objects and allow navigation through the objects play an important role:

  1. If the data field (name1) is an object, its data field (name2) is accessed with name1.name2
  2. If the data field is a pointer to an object, its data field (name2) can also be reached with name1.name2
    i.e. InstantView® does not distinguish between a pointer to an object and the object itself (like Java).
  3. From a data field of type CX_CONDITIONED_BAG you can navigate with ->.
    -> requires here the selection of an object, CX_CONDITIONED_BAG is interpreted as a variable pointer controlled by the variable assignment in the PlugSpace.
  4. The nth element of a collection (name1) is referred to as
    name1[n]

    Example:
    father.children[3]
  5. and to a data field (name2) of this element with
    name1[n].name2
    where n is an integer (constant) or an InstantView® variable.
    Example:
    father.childeren[3].firstName

  6. Calls to a member function can be placed anywhere (with return value object or collection); constants - a character string or an integer - or an InstantView® variable can be specified as parameters. The identifier of the member function must always be followed by an opening parenthesis and the parameters by a closing parenthesis. Constant parameters can be omitted, provided they follow all specified parameters. They are then assumed to be an empty string "" or 0 or NULL (for object parameters).
    An object can only be transferred using an InstantView® variable.
    Example: owner.StateMonitor("REQUEST").mlShortName
  7. If a term for a function call is preceded by the specifier weak, ClassiX® exceptions are suppressed. There is no abort with error message, but the result of the evaluation of the whole access expression is INVALID.
    Example: item.weak.ProductAllocation(resolveType,0)
    weak' must immediately precede the function call. weak' may also be specified for calling an MA function or the pseudo function call(...).
  8. At the end of the printout you can click on
    name[n]
    to the nth bit of an element of type CX_BIT_PATTERN, INTEGER, SHORT, CHAR, ENUMSHORT or ENUMCHAR can be accessed. For an element of type MULTIPLE_STRING, the nth substring (the nth language) is accessed.
    n can be an integer constant or an InstantView® variable.
  9. The pseudo function var(x) can be placed at the beginning of an access expression. It returns the value of the InstantView® variable x as object.
    This construction changes the meaning of the access expression: the object from which the navigation starts becomes meaningless. This is especially useful within formulas (see CX_FORMULA).
  10. The pseudo function call(Procedure) is used to call the InstantView® instruction specified as an operand. The procedure (agreed with Define ) must be
    - either known in the current module or
    - be imported via a provider tag. In addition
    - InstantView code directly within an anonymous procedure.
    The object reached by the previous evaluation appears as input parameter on the stack. The called instruction must leave a result on the stack (the return value of the function).
    If the access expression is to be continued after call(...), an object must be returned.
  11. If the value of the expression is required as a character string, the pseudo-function string(flag1, flag2, ...) can be placed at the end, whereby the conversion is controlled by flags to be specified optionally.
  12. Pseudo-function core() returns the referenced object (the "wrapped" object) for objects of the classes CX_DESCRIPTIVE_REF and CX_OVERWRITIG_REF - also over several levels. For all other objects core() has no effect, i.e. you get the object itself.
    Example: salesItem.core().mlWordDoc
  13. With the reserved word this you can refer to the object itself. This is used to check the access rights to the object and the validity of the object. If one of the checks fails, INVALID is returned. The reserved word this corresponds to the dot operator "." within an access expression: here too, during navigation from partial expression to partial expression, this check for access rights and validity is performed in each case.
  14. The reserved word hard suppresses the check for (temporal) validity of the object. This means that regardless of the current validity of the object, the (previously) referenced object is returned. The word must be appended to the identifier of the object.
    Example where the check for partners is suppressed:
    partner.hard.name
    Analogous to hard, soft can also be used: In this case a validity check is carried out first. If it does not find a currently valid object, soft behaves like hard and returns the current object. soft thus always prevents the return of INVALID (analogous to hard, in that at least the originally referenced object is returned), but if another (newer) object is currently valid, it is returned (analogous to this).

Note: 'Data field' can be either a data member provided in the class definition or a dynamic data field.
When evaluating the access expressions, the access rights and also the validity are checked - if corresponding security objects are activated.

Names of the data fields must be entered in the Data Dictionary and function names in the Method Dictionary.