Show/Hide Toolbars

XSharp

 

无法获取别名表达式的地址。

 

这种错误出现在以下代码中

FUNCTION Start as VOID
  USE Customer
  DoSomething(@Customer->LastName)
  USE
  WAIT
  RETURN
 
  FUNCTION Dosomething (uValue REF USUAL) AS LOGIC
  uValue := uValue + uValue
  RETURN TRUE

要解决这个问题,可将别名表达式的值赋值给一个临时变量,然后在函数调用后将该临时变量更改后的值赋值回别名表达式:

FUNCTION Start as VOID
  LOCAL uTemp as USUAL
  USE Customer
  uTemp := Customer->LastName
  DoSomething(@uTemp)
  Customer->LastName := uTemp
  USE
  WAIT
  RETURN
 
  FUNCTION Dosomething (uValue REF USUAL) AS LOGIC
  uValue := uValue + uValue
  RETURN TRUE