float = callfunction()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

float = callfunction()

Post by Dr. Dri »

i have to do that :

Code: Select all

OpenLibrary(0, "VantagePro.dll")

f.f
CallCFunction(0, "GetDllVersion_V")
!FSTP dword [v_f]

Debug f
PureBasic should add the FSTP depending on the return variable type

Dri
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

I second that, I really don't understand why we cannot get the floats out of a dll function, other programming languages manage to do it, and I think it's needed everytime when working with dll !
FloHimself
Enthusiast
Enthusiast
Posts: 229
Joined: Wed May 14, 2003 3:38 pm
Location: Lüneburg - Germany

Re: float = callfunction()

Post by FloHimself »

Dr. Dri wrote:PureBasic should add the FSTP depending on the return variable type
How should the CallFunction() / CallCFunction() know that the
DLL Function returns a float?
Only way i see is Fred giving us a way to declare external Functions like
in VB.
My favorite numbers: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Re: float = callfunction()

Post by Dr. Dri »

FloHimself wrote:How should the CallFunction() / CallCFunction() know that the
DLL Function returns a float?
Only way i see is Fred giving us a way to declare external Functions like
in VB.
I mean, if you use CallFunction in a purebasic local float variable, it should be automatic

Code: Select all

myFloat.f = CallFunction(lib, "function", parameters)
Dri
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

Post by Froggerprogger »

I mean, if you use CallFunction in a purebasic local float variable, it should be automatic
That would totally confuse! I suppose that many people use
bla.f = CallFunction(...) at the moment.
These lines would'nt work any longer, because the result would be read from the st0-register, not eax any longer.

I would prefer a simple:
CallFunctionF(...)

That has already been on the wishlist some time ago.
%1>>1+1*1/1-1!1|1&1<<$1=1
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Froggerprogger wrote: I would prefer a simple:
CallFunctionF(...)

That has already been on the wishlist some time ago.
What about
CallFunction.f(...) , CallFunction.b(...) , etc.
?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Post Reply