Axapta 操作数类型与运算符不兼容
我收到了错误 操作数类型与运算符不兼容 在标题中,当尝试比较两个“真实”数据类型时 有人能帮我解决什么问题吗Axapta 操作数类型与运算符不兼容,axapta,dynamics-ax-2009,Axapta,Dynamics Ax 2009,我收到了错误 操作数类型与运算符不兼容 在标题中,当尝试比较两个“真实”数据类型时 有人能帮我解决什么问题吗 public void clicked() { real localAnnualUsage = itemSetup_DS.AnnualUsage(); real localSalesPrice = itemSetup.StockPrice; real localCost = itemSetup.StockCost
public void clicked()
{
real localAnnualUsage = itemSetup_DS.AnnualUsage();
real localSalesPrice = itemSetup.StockPrice;
real localCost = itemSetup.StockCost;
real localstockInventAvg = itemSetup.StockInventAvg;
real localTurnAndEarn;
real localAnnualGP;
real localAvgInvCost;
;
localAvgInvCost = itemSetup.StockInventAvg;
if (localStockInventAvg != itemSetup_StockInventAvg)
{
localAvgInvCost = itemSetup_StockInventAvg;
}
//...
}
错误发生在条件的行上。很可能您的
itemSetup\u StockInventAvg
变量是实数控件,而不是实数
尝试使用:
if (localStockInventAvg != itemSetup_StockInventAvg.realValue())
或者更好(因为控件将结果存储在itemSetup.StockInventAvg
中):
更新:这没有意义,因为
localStockInventAvg
被设置为itemSetup.StockInventAvg
前一行。您的itemSetup\u StockInventAvg
变量很可能是实控件,而不是实控件
尝试使用:
if (localStockInventAvg != itemSetup_StockInventAvg.realValue())
或者更好(因为控件将结果存储在itemSetup.StockInventAvg
中):
更新:这没有意义,因为localStockInventAvg
被设置为itemSetup.StockInventAvg
前一行