IonicWind Software

Aurora Compiler => General Discussion => Topic started by: J B Wood (Zumwalt) on November 30, 2007, 06:45:36 PM

Title: Bug maybe, or maybe not? Defaults
Post by: J B Wood (Zumwalt) on November 30, 2007, 06:45:36 PM
On my methods, I have default values, but they are ignored.
sub methodA(int valA=0){}

If I call methodA, like

global sub main()
{
methodA();
}

This tells me that I have wrong number of parameters.
Can I use defaults?
Title: Re: Bug maybe, or maybe not? Defaults
Post by: Ionic Wind Support Team on November 30, 2007, 06:49:01 PM
Is it a method or a sub?   If it's a method then what does the class declare look like? ;)
Title: Re: Bug maybe, or maybe not? Defaults
Post by: Ionic Wind Support Team on November 30, 2007, 06:50:36 PM
Oh...and you forgot the OPT keyword.

sub methodA(OPT int valA=0){}

Title: Re: Bug maybe, or maybe not? Defaults
Post by: J B Wood (Zumwalt) on November 30, 2007, 06:53:12 PM
DECLARE CDECL import,bbLoadTerrain(char *file,OPT BBEntity p=0 ),BBTerrain;

Just tried it with OPT, I didn't have that in any of my methods in my wrapper, but still same error.
BBEntity is defined early on as an integer.

EDIT:
Forgot to nuke all of my .o and .asm files then rebuild.
Now it seems to be working :)
Knock on wood.. Thanks Paul!
Title: Re: Bug maybe, or maybe not? Defaults
Post by: J B Wood (Zumwalt) on November 30, 2007, 07:13:38 PM
Its working like a champ now Paul, your the greatest!
Title: Re: Bug maybe, or maybe not? Defaults
Post by: Barney on November 30, 2007, 07:21:50 PM
Jonathan, be careful with optional default values. If you have Blitz3D package take a look at the help file and use the optional defaults shown there. When I initially made Aurora and EBasic translation of the B3DSDK include I was following original SDK docs, which are showing wrong values in some places.

Barney
Title: Re: Bug maybe, or maybe not? Defaults
Post by: J B Wood (Zumwalt) on November 30, 2007, 07:23:42 PM
I used the C++ header file include optionals.
They seem to be working thus far, I've updated my code to reflect this, take a look in the Aurora thread on the subject.
Thats where the latest update is including conversion of not just the cube code, but the terrain code, the teapot code and the dragon/reflection code.