Brutal .prg mode emulations below.
So that once we "set" BYREF, it is inherited by hb_arrayToParams() in
such construct:
Sub( hb_arrayToParams( Ref( arr ) ) )
Best regards, Aleksander
PROC Main
LOCAL arr := { 1, 2, 3 }
Sub( hb_arrayToParams( arr ) )
? ProcName(), arr[ 1 ], arr[ 2 ], arr[ 3 ]
Sub( @arr[ 1 ], @arr[ 2 ], @arr[ 3 ] )
? ProcName(), arr[ 1 ], arr[ 2 ], arr[ 3 ]
Sub( hb_arrayToParams( Ref( arr ) ) )
? ProcName(), arr[ 1 ], arr[ 2 ], arr[ 3 ]
Sub( hb_arrayToParams( Ref2( arr ) ) )
? ProcName(), arr[ 1 ], arr[ 2 ], arr[ 3 ]
Sub( hb_arrayToParams( RefTest( arr ) ) )
? ProcName(), arr[ 1 ], arr[ 2 ], arr[ 3 ]
PROC Sub( a, b, c )
? ProcName(), a, b, c
a++
b++
c++
FUNC Ref( arr )
LOCAL i, c := "{ |a| { "
FOR i := 1 TO Len( arr )
c += "@a[ " + HB_NtoS( i ) + " ]"
IF i < Len( arr )
c += ","
ENDIF
NEXT
c += " } }"
RETURN Eval( &( c ), arr )
FUNC Ref2( arr, nLimit )
STATIC aCB
IF nLimit == NIL
nLimit := Min( Len( arr ), 8 )
ELSE
nLimit := Min( Len( arr ), nLimit )
ENDIF
IF aCB == NIL
aCB := Array( 8 )
aCB[ 1 ] := { |a| { @a[ 1 ] } }
aCB[ 2 ] := { |a| { @a[ 1 ], @a[ 2 ], } }
aCB[ 3 ] := { |a| { @a[ 1 ], @a[ 2 ], @a[ 3 ] } }
aCB[ 4 ] := { |a| { @a[ 1 ], @a[ 2 ], @a[ 3 ], @a[ 4 ] } }
aCB[ 5 ] := { |a| { @a[ 1 ], @a[ 2 ], @a[ 3 ], @a[ 4 ], @a[ 5 ] } }
aCB[ 6 ] := { |a| { @a[ 1 ], @a[ 2 ], @a[ 3 ], @a[ 4 ], @a[ 5 ],
@a[ 6 ] } }
aCB[ 7 ] := { |a| { @a[ 1 ], @a[ 2 ], @a[ 3 ], @a[ 4 ], @a[ 5 ],
@a[ 6 ], @a[ 7 ] } }
aCB[ 8 ] := { |a| { @a[ 1 ], @a[ 2 ], @a[ 3 ], @a[ 4 ], @a[ 5 ],
@a[ 6 ], @a[ 7 ], @a[ 8 ] } }
ENDIF
RETURN Eval( aCB[ nLimit ], arr )
FUNC RefTest( arr )
LOCAL aref, c := "{"
aref := { @arr[ 1 ], @arr[ 2 ], @arr[ 3 ] }
RETURN aref