From 76f441f46d53d5cc23508d4df6cf57e752ec0d06 Mon Sep 17 00:00:00 2001 From: Eddie Runia Date: Wed, 26 May 1999 15:25:07 +0000 Subject: [PATCH] see changelog --- harbour/ChangeLog | 6 ++++++ harbour/source/rtl/extend.c | 23 ++++++++++++++++++++++- harbour/source/rtl/files.c | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ea6bc54cc7..551773a5c0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,9 @@ +19990526-16:10 Eddie Runia + * source/rtl/files.c + Pass reference error removed. + * source/rtl/extend.c + par* commands now work correctly with reference variables. + 19990525-23:25 Les Griffith * source/rtl/files.c added logic to readstr for lasterror diff --git a/harbour/source/rtl/extend.c b/harbour/source/rtl/extend.c index 6be8e63201..60f11807fb 100644 --- a/harbour/source/rtl/extend.c +++ b/harbour/source/rtl/extend.c @@ -17,13 +17,20 @@ ULONG ulMemoryConsumed = 0; PITEM _param( WORD wParam, WORD wMask ) { WORD wType; + PITEM pLocal; if( wParam <= _pcount() ) { wType = ( stack.pBase + 1 + wParam )->wType; if( ( wType & wMask ) || ( wType == IT_NIL && wMask == IT_ANY ) ) - return stack.pBase + 1 + wParam; + { + pLocal = stack.pBase + 1 + wParam; + if( wType & IT_BYREF ) + return stack.pItems + pLocal->value.wItem; + else + return pLocal; + } else return 0; } @@ -43,6 +50,8 @@ char * _parc( WORD wParam, ... ) if( wParam <= _pcount() ) { pItem = stack.pBase + 1 + wParam; + if( pItem->wType & IT_BYREF ) + pItem = stack.pItems + pItem->value.wItem; if( IS_ARRAY( pItem ) ) { @@ -73,6 +82,8 @@ ULONG _parclen( WORD wParam, ... ) if( wParam <= _pcount() ) { pItem = stack.pBase + 1 + wParam; + if( pItem->wType & IT_BYREF ) + pItem = stack.pItems + pItem->value.wItem; if( IS_ARRAY( pItem ) ) { @@ -104,6 +115,8 @@ char * _pards( WORD wParam, ... ) if( wParam <= _pcount() ) { pItem = stack.pBase + 1 + wParam; + if( pItem->wType & IT_BYREF ) + pItem = stack.pItems + pItem->value.wItem; if( IS_ARRAY( pItem ) && wArrayIndex ) /* TODO: implement wArrayIndex use when retrieving an array element */ @@ -146,6 +159,8 @@ int _parl( WORD wParam, ... ) if( wParam <= _pcount() ) { pItem = stack.pBase + 1 + wParam; + if( pItem->wType & IT_BYREF ) + pItem = stack.pItems + pItem->value.wItem; if( IS_ARRAY( pItem ) && wArrayIndex ) /* TODO: implement wArrayIndex use when retrieving an array element */ @@ -173,6 +188,8 @@ double _parnd( WORD wParam, ... ) if( wParam <= _pcount() ) { pItem = stack.pBase + 1 + wParam; + if( pItem->wType & IT_BYREF ) + pItem = stack.pItems + pItem->value.wItem; if( IS_ARRAY( pItem ) && wArrayIndex ) /* TODO: implement wArrayIndex use when retrieving an array element */ @@ -206,6 +223,8 @@ int _parni( WORD wParam, ... ) if( wParam <= _pcount() ) { pItem = stack.pBase + 1 + wParam; + if( pItem->wType & IT_BYREF ) + pItem = stack.pItems + pItem->value.wItem; if( IS_ARRAY( pItem ) && wArrayIndex ) /* TODO: implement wArrayIndex use when retrieving an array element */ @@ -239,6 +258,8 @@ long _parnl( WORD wParam, ... ) if( wParam <= _pcount() ) { pItem = stack.pBase + 1 + wParam; + if( pItem->wType & IT_BYREF ) + pItem = stack.pItems + pItem->value.wItem; if( IS_ARRAY( pItem ) && wArrayIndex ) /* TODO: implement wArrayIndex use when retrieving an array element */ diff --git a/harbour/source/rtl/files.c b/harbour/source/rtl/files.c index 56e841032a..3fcb063c03 100644 --- a/harbour/source/rtl/files.c +++ b/harbour/source/rtl/files.c @@ -450,7 +450,7 @@ HARBOUR FREAD() if( arg1_it && arg2_it && arg3_it ) { last_error = 0; - bytes = _fsRead(_parni(1),_parc(2),_parnl(3)); + bytes = _fsRead(_parni(1),arg2_it->value.szText,_parnl(3)); last_error = errno; }