Oxygen Basic
Programming => Bugs & Feature Requests => Topic started by: kryton9 on May 07, 2011, 01:24:02 PM
-
I was pulling my hair out and finally did this test and saw that there is a problem with floats in classes.
I will make one for all variable types to test next. But wanted to report this for now.
I commented out the floats code so it would compile and run.
So run first then uncomment out the float parts to see the error, thanks.
'Error when using floats
class v3
private
' x as float
y as double
z as long
public
'Setters
' method setx(v as float)
' this.x = v
' end method
method sety(v as double)
this.y = v
end method
method setz(v as long)
this.z = v
end method
'Getters
' method getx() as float
' method = this.x
' end method
method gety() as double
method = this.y
end method
method getz() as long
method = this.z
end method
end class
'Program Code
dim v as v3
'v.setx 42.24
v.sety 89.5
v.setz 7
'print `x: ` str v.getx
print `y: ` str v.gety
print `z: ` str v.getz
.
-
Charles, I made a test class for testing all the variables in a class.
Here is the version that is mostly commented out.
This compiles fine but goes to la la land when run. Everything is in place for you to use this to test for further bugs.
.
-
Hi Kent,
"float" was not recognised in the basic syntax. "Single" is okay.
I have now added "float" to the Basic primitives list so this will work in future releases.
Charles
-
Kent,
Thanks for your testVars.
I'm going to dump all the underscory C types from keywords list. They can be soft coded whenever needed using Typedef.
I can then merge the remaining C types with the Basic types to ensure internal consistency.
Charles
-
Thanks Charles, it will be nice to know what we can and can't use and to not worry about the internal underscory things.
-
Hi,
I see that we become more and more C! The naming shouldn't be OXYGENBASIC rather OXYGENBC. :D
-
I'm trying to leave out most of the C uglys and adopt the more elegant parts. I think the Basic language in general could benefit from some beauty treatment :)
Charles