When can scope operator ("::") be used by complex

jemmyjemmy Member Posts: 247
Dear Folks,

Sorry, I just rewrite the same question in Navision Solution Development chapter-1. :?
When can scope operator ("::") be used by complex datatypes?
I want to ensure that it is used when we call object property (for example: field of table) not using complex variable.
Example:
Form.Run(Form::"Company Information",CompanyRec)
Do I have a correct idea on this? :?:

Thanks in advance.

Jemmy

Comments

  • kinekine Member Posts: 12,562
    :: is used, when you want to get Option value for some Option variable...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jemmyjemmy Member Posts: 247
    kine wrote:
    :: is used, when you want to get Option value for some Option variable...

    Option variable? Does it mean that there're several values possible for the variable?
    I saw page 1-6, there's a syntax
    Action::LookUp
    Well, how can we know LookUp is tied to Action.

    In VB, I usually type ClassName. then its properties/methods will be shown in list box, then I can choose correctly. But C/Al should be different from it.

    Hope you could explain briefly please.. :? Anyway thanks for the reply... :wink:
    that's all about it.


    Jemmy
  • kinekine Member Posts: 12,562
    it means that Action is variable of type Option and have some possible value and one of them is LookUp. If You write Action::aaa and try to compile, you can see, which values are possible to enter. :: have not same meaning as in C++ for example...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jemmyjemmy Member Posts: 247
    kine wrote:
    it means that Action is variable of type Option and have some possible value and one of them is LookUp.

    Hi Kine,
    Thanks again for the reply. :)

    But how can we know its type, for example page 1-5.

    FORM.RUN (FORM::"Customer Card", CustRec);
    FORM is an object (complex data types), isn't it? Then it is also called a variable type option?

    A little bit fun, when I typed FORM::"aaa", then compiled it. It would show error message: You cannot enter 'aaa' in FormNo. The cursor is in front of the invalid character.

    Then what is the FormNo? I know it is tied to FormID, but how can we know the relationship...

    Hope you could explain more briefly with above case.. :?
    Sometimes a new term make me confused.

    That's all bout it. Thanks again.

    Jemmy
  • kinekine Member Posts: 12,562
    Ok, FORM:: CODEUNIT:: TABLE:: etc. is for me special case of this operator. I think, that C/AL is not consistent in using this operator.

    :: is Scope operator, but I know only three possible application:

    1) Option value <option field>::<option value> (value from scope of the option field)

    2) <Object>::<Object name> for identify of object - result is same as if object ID is entered (TABLE::Item = 27) (ID of object from given scope)

    3) <atuomation variable>::<automation event name> for identify triggers connected to automation events (events from automation variable scope)

    But because C/AL is not fully object oriented language, there is no usage of this operator for other possibility (as static methods etc.).

    FORM.RUN (FORM::"Customer Card", CustRec);
    FORM is an object (complex data types), isn't it? Then it is also called a variable type option?

    A little bit fun, when I typed FORM::"aaa", then compiled it. It would show error message: You cannot enter 'aaa' in FormNo. The cursor is in front of the invalid character.

    Then what is the FormNo? I know it is tied to FormID, but how can we know the relationship...

    FormNo is first parameter of FORM.RUN and it is "Number" of the form. Cite from C/SIDE help:
    FORM.RUN(Number [, Record] [, Field])
    Number

    Data type: integer

    A number which identifies a form object. If you enter zero (0), the system displays the default lookup window for the current form. You can use the Symbols option on the View menu to choose from a list.

    If the form you specify does not exist, a run-time error occurs.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jemmyjemmy Member Posts: 247
    Hello Kine,
    1) Option value <option field>::<option value> (value from scope of the option field)

    2) <Object>::<Object name> for identify of object - result is same as if object ID is entered (TABLE::Item = 27) (ID of object from given scope)

    3) <atuomation variable>::<automation event name> for identify triggers connected to automation events (events from automation variable scope)

    Well, thanks for the brief explanations.

    Now with these, I should be more confident to continue my chapter readings... :wink:

    Jemmy
Sign In or Register to comment.