这里的代码是 X++。尽管我熟悉 C#,但我对此知之甚少。MS 说它在语法上类似于 C++ 和 C#。
无论如何,我假设下面的代码是一种方法。它有“Construct”作为关键字。
什么是构造/构造方法?构造关键字在应用于函数时会发生什么变化?另外,假设代码会创建某种无限循环,我错了吗?
我的假设是它的返回类型为“InventMovement”的方法。
static InventMovement construct(Common buffer, InventMovSubType subType = InventMovSubType::None, Common childBuffer = null)
{
InventMovement movement = InventMovement::constructNoThrow(buffer,subType,childBuffer);
if (!movement)
throw error("@SYS20765");
return movement;
}
谢谢!凯文