• Bug in PValue() function?

    From Enrico Maria Giordano@21:1/5 to All on Sat Mar 23 11:05:46 2024
    This is a sample (kindly provided by Rao). Ron can you look at it?


    function Main()

    local a := 20
    local b := 0

    Add500( a, @b )
    ? Version(), b // 520 Harbour
    // 0 xHarbour

    Inkey( 0 )

    return nil

    function add500(...)

    PValue( 2, PValue( 1 ) + 500 )

    return nil


    // This is from pvalue.c


    #pragma BEGINDUMP

    #include "hbvmopt.h"
    #include "hbapi.h"
    #include "hbapiitm.h"
    #include "hbstack.h"

    HB_FUNC( PVALUE )
    {
    USHORT uiParam = ( USHORT ) hb_parni( 1 ), uiParams;
    PHB_ITEM * pBase = HB_VM_STACK.pItems + ( hb_stackBaseItem() )->item.asSymbol.pCargo->stackbase; /* Skip function + self */

    uiParams = ( *pBase )->item.asSymbol.pCargo->arguments;

    if( uiParam && uiParam <= uiParams ) /* Valid number */
    {
    USHORT uiOffset;
    PHB_ITEM pItem;

    if( ( *pBase )->item.asSymbol.pCargo->params == HB_VAR_PARAM_FLAG )
    uiOffset = ( *pBase )->item.asSymbol.pCargo->locals;
    else
    uiOffset = 0;

    pItem = *( pBase + 1 + uiParam + uiOffset );

    hb_itemReturn( pItem );

    if( hb_pcount() > 1 && HB_IS_BYREF( pItem ) )
    hb_itemCopy( pItem, hb_param( 2, HB_IT_ANY ) );
    }
    else
    hb_ret(); /* return NIL */
    }

    #pragma ENDDUMP



    // This is from Harbour pvalue.c


    /*
    #include "hbvmint.h"
    #include "hbapi.h"
    #include "hbapiitm.h"
    #include "hbstack.h"

    HB_FUNC( HB_PVALUE )
    {
    HB_ISIZ nOffset =
    hb_stackBaseItem()->item.asSymbol.stackstate->nBaseItem;
    HB_USHORT uiParam = ( HB_USHORT ) hb_parni( 1 );

    if( uiParam && uiParam <= hb_stackItem( nOffset
    item.asSymbol.paramcnt )
    {
    PHB_ITEM pItem = hb_stackItem( nOffset + 1 + uiParam );
    if( hb_pcount() > 1 )
    hb_itemCopyToRef( pItem, hb_param( 2, HB_IT_ANY ) );
    hb_itemReturn( HB_IS_BYREF( pItem ) ? hb_itemUnRef( pItem ) :
    pItem );
    }
    }
    */

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Reynaldo Henrique@21:1/5 to All on Sat Mar 23 23:09:54 2024
    This error appears:

    Turbo Incremental Link 6.97 Copyright (c) 1997-2022 Embarcadero
    Technologies, Inc.
    Error: Unresolved external '_hb_stackST' referenced from C:\XHARBOUR\TESTS\OBJ\PVALUE.OBJ
    Error: Unable to perform link


    Thanks,


    Reynaldo Henrique


    --
    O software antivírus AVG realizou uma checagem de vírus neste e-mail. www.avg.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Sun Mar 24 09:40:14 2024
    Il 24/03/2024 03:09, Reynaldo Henrique ha scritto:

    This error appears:

    Turbo Incremental Link 6.97 Copyright (c) 1997-2022 Embarcadero
    Technologies, Inc.
    Error: Unresolved external '_hb_stackST' referenced from C:\XHARBOUR\TESTS\OBJ\PVALUE.OBJ
    Error: Unable to perform link

    I don't get any errors. Please show the batch you are using to compile.

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Reynaldo Henrique@21:1/5 to All on Sun Mar 24 20:30:20 2024
    Em 24/03/2024 05:40, Enrico Maria Giordano escreveu:


    Il 24/03/2024 03:09, Reynaldo Henrique ha scritto:

    This error appears:

    Turbo Incremental Link 6.97 Copyright (c) 1997-2022 Embarcadero
    Technologies, Inc.
    Error: Unresolved external '_hb_stackST' referenced from
    C:\XHARBOUR\TESTS\OBJ\PVALUE.OBJ
    Error: Unable to perform link

    I don't get any errors. Please show the batch you are using to compile.


    I used bld_b32.bat from xharbour.

    Thnaks,

    Reynaldo Henrique

    --
    O software antivírus AVG realizou uma checagem de vírus neste e-mail. www.avg.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Mon Mar 25 10:01:55 2024
    Il 25/03/2024 09:48, Enrico Maria Giordano ha scritto:

    I used bld_b32.bat from xharbour.

    What is bld_b32.bat? I can't find it in the xHarbour repository. In
    order to help you, I need a little PRG and the compile batch to
    replicate the problem here.

    Found! Do you mean this?

    bld_bc.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

    I don't think it is working. What do you want to do exactly?

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Mon Mar 25 09:48:48 2024
    Il 25/03/2024 00:30, Reynaldo Henrique ha scritto:

    I don't get any errors. Please show the batch you are using to compile.

    I used bld_b32.bat from xharbour.

    What is bld_b32.bat? I can't find it in the xHarbour repository. In
    order to help you, I need a little PRG and the compile batch to
    replicate the problem here.

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Mon Mar 25 10:03:32 2024
    Il 25/03/2024 10:01, Enrico Maria Giordano ha scritto:

    Found! Do you mean this?

    bld_bc.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

    I don't think it is working. What do you want to do exactly?

    If you just want to compile and run a single PRG then I can show you a
    simple batch to do that. Let me know.

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)