20

X++ でコードを記述する場合、参照が必要な場合もあればthis.functionYouWant()element.FunctionYouWant(). 両方が対象となる場合もあります。私はよく 1 つを試して、必要な機能がない場合は別の機能を試します。thisいつ使用するか、いつ使用するかを説明するルールはありますelementか?

4

2 に答える 2

40

this can be used in any objects to reference the current object and member methods.

MorphX forms and reports are composite objects.

In forms the collection of objects is contained within a FormRun object. You can reference members in the outer FormRun object by using the element reference.

If your code is placed at the top level there are no functional difference between this and element.

If your code is placed in a FormDataSource this will reference the datasource but element will reference the FormRun.

于 2010-11-23T21:35:04.810 に答える
0

"This" can be used only refers to the same class objects but "element" is access the form methods into any form level(like datasouce level,design level)if the functionality of method is same we can use

于 2016-06-22T09:23:33.303 に答える