Announcement

Collapse
No announcement yet.

W98 and W2K subtlety

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

  • W98 and W2K subtlety

    How is this for subtlety:


    Code:
    '.........................................................................................
    'The EXE code
    '
    GLOBAL pxbor
    
    DECLARE FUNCTION x2d LIB "Plotengn.dll" (x AS DOUBLE) AS LONG
    '         OR
    DECLARE FUNCTION x2d LIB "Plotengn.dll "(x AS DOUBLE) AS LONG
    .
    .
    
    '..........................................................................................
    'The DLL code
    '
    '
    GLOBAL pxbor
    '
    '
    
    FUNCTION x2d(x AS DOUBLE) EXPORT AS LONG
    
    x2d=x+pxbor
    
    END FUNCTION
    Either declaration works perfectly in Win98.

    In Win2K the first declaration statement works properly but the second one, although there is no error diagnostic, causes incorrect values to be returned by the function. The value of the global variable pxbor is ignored and taken as zero so the function simply returns the value of x.

    This one was very difficult to find. Hope it saves someone else some time.


    Regards,


    Bern

    ------------------
    Bern

    www.insighttrading.com.au
    Bern


    http://www.insighttrader.com.au

  • #2
    Interesting observation Bern... I've passed this to R&D to see if the compiler can strip unnecessary whitespace from the LIB clause.

    Thanks!

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment

    Working...
    X