Oxygen Basic
Programming => Bugs & Feature Requests => Topic started by: jcfuller on February 03, 2018, 10:03:26 AM
-
Charles,
The file: examples\Parameters\overloding.o2bas will not run as a 64 bit app.
No errors on compile using exo2 -c examples\Parameters\Overloding.o2bas.
I added this to the top of the code
$ filename "overloding.exe"
#include "RTL64.inc"
James
-
Hi James,
The problem is a little obscure, but seems to occur in minimalist functions without local variables, such as these. It is fixed by creating a local variable in the function (any will do), or use an explicit str(..) in the return expression. I will investigate further to pinpoint the cause.
% filename "t.exe"
uses rtl64
'FUNCTION OVERLOADING
'====================
function foo (long v) as string
return "long " str(v)
end function
function foo (double v) as string
return "double " str(v)
end function
function foo (string v) as string
return "string " str(v)
end function
long l=42
double d=42.5
string s="43"
print foo l
print foo d
print foo s
-
Charles,
Ok, and even more shorthand with no & or + for the concatenation of the return :).
I was also thrown off a bit with byref as the default passing parameter while FreeBasic is byval and I'm used to byval with bc9Basic (c/c++).
I was probably aware of that at one time but ......
And yes I do know of #byval / #byref .
James
-
Hi James,
I have added stack frames for implicit str and val conversions, and all seems well. I have been working on key demo programs to ensure they will work as 64bit binaries, but this is a gradual process, with over 1200 demos to consider.
https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenProgress.zip
-
Thanks, Charles.
I can not even imagine the work that must be accommodating so many things
I lose myself even with simple things I try to do