Make Import work with String return values

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

Make Import work with String return values

Post by mback2k »

At the moment you have to do the following:

Code: Select all

Import "mylibrary.lib"
  MyMethodWhichReturnsAStringW(Param)
EndImport

Macro MyMethodWhichReturnsAString(Param)
  PeekS(MyMethodWhichReturnsAStringW(Param))
EndMacro
Please just allow us to specify the string as return value:

Code: Select all

Import "mylibrary.lib"
  MyMethodWhichReturnsAStringW.s(Param)
EndImport
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Make Import work with String return values

Post by luis »

Yes!

I would like this limitation removed too, considering using PeekS() you can go around it the compiler should be able to do the same for us.

See also: http://www.purebasic.fr/english/viewtop ... 49&start=0
"Have you tried turning it off and on again ?"
A little PureBasic review
User_Russian
Addict
Addict
Posts: 1520
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Make Import work with String return values

Post by User_Russian »

In my opinion is an artificial limitation and should be allowed to string return.
Post Reply