Show/Hide Toolbars

XSharp

Cannot take the address of an aliased expression.

This error occurs in code like the following

 

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

 

To work around this, assign the value of the aliased expression to a temporary variable and then after the function call assign the changed value of the variable back to the aliased expression:

 

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