We've discovered a bug when using byref's. Trivially reproduced in Order Entry, sample code below.

We call a procedure Proc1 taking a normal integer parameter, passing a value from the record buffer. The value is 101.

Proc1 calls Proc2 which takes an integer byref parameter, passing the value on. The value is 101 as expected.

In Proc2, the value is now 0!

This is using DF 19.0, I've not tested other versions.

Find GE OrderHea by Index.1
Showln OrderHea.Order_Number // Shows 101
Send Proc1 OrderHea.Order_Number

Procedure Proc1 Global Integer iOrderNumber
    Showln iOrderNumber // Shows 101
    Send Proc2 (&iOrderNumber)
End_Procedure // Proc1

Procedure Proc2 Global Integer ByRef iOrderNumber 
    Showln iOrderNumber // Shows 0!
End_Procedure // Proc2