Yes. Today i tried again to convert some PowerBasic Functions into PureBasic.
Really missing the BYREF. If you have it you don't know how you feel if you fo not have it. If somebody is going to add new features, think of a "BYCOPY" also, as the third Option PowerBasic has (BYVAL ... BYREF ... BYCOPY).
BYVAL will do essentially a new (hidden) local variable of that type and assign it that value of the given Pointer. For this reason the original value is SAFE.
BYREF would be good because actually its not easy to get multiple results from structures out of a Procedure, without using an Array. The actual system with Procedure-Parameters "ARRAY","MAP" and "LIST" looks like some sort of "Help construct".
How about this Syntax for BYREF (IN/OUT):
Code: Select all
Procedure Test(BYREF.Point PA,BYREF.Rect RA)
which would be easier to parse for the compiler then
Code: Select all
Procedure Test(BYREF PA.Point,BYREF RA.Rect)
which would be like the actual syntax and do just the same.
and of course BYVAL (IN):
Procedure Test(BYVAL.Point PA,BYVAL.Rect RA)
The compiler will internally/transparent define an new, internal
"Protected PA.Point"
and just copy the Memory from the original structure inside it
Anytime PA is used inside the the Procedure, this one is used.
At the end of the Procedure the thing is deleted like all local Vars.
Using this system, you can transfer structures of all type in an out of a Procedure.
This will make several things a bit more easy then its currently. And it will help people to convert PowerBasic x32 to PureBasic x64.
If i can specify BYREF and BYVAL explicitly, like in PowerBasic, then i know exactly what goes where.
PS: Thanks for the Hint with the @ - thats just what i need now to get forward.
About RealBasic, i do not think its what i need, it looks to bloated for me.
The only much more expensive Alternative would be possibly WinDev.
PowerBasic is Ok for me just it is not able to compile x64 DLL's and EXE's.
Thats what i use PureBasic for.