“这个”与“元素”相对X++ 中的关键字

发布于 2024-10-04 01:05:07 字数 206 浏览 0 评论 0原文

在 X++ 中编写代码时,有时需要引用 this.functionYouWant(),有时需要引用 element.FunctionYouWant()。有时两者都在范围内。我经常尝试其中一种,如果没有我想要的功能,我会尝试另一种。是否有规则解释何时使用 this 以及何时使用 element

When writing code in X++ you sometimes need to reference this.functionYouWant() and sometimes it is element.FunctionYouWant(). Sometimes both are in scope. I often try one and if the function I want isn't there I try the other. Is there a rule that explains when to use this and when to use element?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我为君王 2024-10-11 01:05:07

this 可以在任何对象中使用来引用当前对象和成员方法。

MorphX 表单和报告是复合对象。

在表单中,对象集合包含在 FormRun 对象中。您可以使用 element 引用来引用外部 FormRun 对象中的成员。

如果您的代码放置在顶层,则 thiselement 之间没有功能差异。

如果您的代码放置在 FormDataSource 中,this 将引用数据源,但 element 将引用 FormRun

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.

几味少女 2024-10-11 01:05:07

“this”只能用于指代相同的类对象,但“element”可以访问任何表单级别(如数据源级别、设计级别)的表单方法,如果方法的功能相同,我们可以使用

"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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文