August 11, 2022, 06:26:34 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Bug maybe, or maybe not? Defaults

Started by J B Wood (Zumwalt), November 30, 2007, 06:45:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

J B Wood (Zumwalt)

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?

Ionic Wind Support Team

Is it a method or a sub?   If it's a method then what does the class declare look like? ;)
Ionic Wind Support Team

Ionic Wind Support Team

Oh...and you forgot the OPT keyword.

sub methodA(OPT int valA=0){}

Ionic Wind Support Team

J B Wood (Zumwalt)

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!

J B Wood (Zumwalt)

Its working like a champ now Paul, your the greatest!

Barney

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

J B Wood (Zumwalt)

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.