Announcement

Collapse
No announcement yet.

PBDLL: Geting strange results in a sub

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Michael Mattias
    replied
    Instead of changing the declaration, you can set up a local variable and it works:

    Code:
      LOCAL A AS CUR, B AS CUR, C AS CUR
      A=1: B=2: C= A + B
      TEST C
    MCM


    ------------------
    Michael Mattias
    Racine WI USA
    [email protected]

    Leave a comment:


  • Borje Hagsten
    replied
    CUR and CUX. Yes, you are right, Gafny. Interesting observation -
    seems like a job for the PB dev. team there..


    ------------------

    Leave a comment:


  • Gafny Jacob
    replied
    Since the sub is not external sub, the compiler should determine
    the parameters passing convention.

    And Indeed if you change the vars type from CUR to LONG or DOUBLE
    the sub will work fine, it's only happening with the CUR vars.


    ------------------


    [This message has been edited by Gafny Jacob (edited July 11, 2000).]

    Leave a comment:


  • Borje Hagsten
    replied
    If you add BYVAL to the sub, like: SUB Test(BYVAL c AS CUR)
    if works fine.


    ------------------

    Leave a comment:


  • Chuck de Young
    replied
    I got 180330300776.12.

    ------------------

    Leave a comment:


  • Gafny Jacob
    started a topic PBDLL: Geting strange results in a sub

    PBDLL: Geting strange results in a sub

    Hi All

    When testing this code, the msgbox display an astronomical no.
    Can sombody verify it.

    SUB Test(c AS CUR)
    MSGBOX STR$(c)
    END SUB

    FUNCTION PBMAIN() AS LONG
    LOCAL a AS CUR
    LOCAL b AS CUR

    a = 1
    b = 2
    Test a + b
    END FUNCTION

    With my PbDll compiler, The MsgBox Display 1803464498531.54



    ------------------
Working...
X