Null default float parameters?

BlitzMax Forums/BlitzMax Programming/Null default float parameters?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Perturbatio, Null is Just zero for ints/float ect.

AFAIK its not possible as things stand ATM, this is the best I can come up with to fake it....

SuperStrict 

Local Vec:TVec3 = TVec3.Create(4.0)
Print Vec.ToString()

Type TVec3

	Const Nill# = %01111111111111111111111111111111

	Field x:Float, y:Float, z:Float

	Function Create:TVec3(x#=0.0,y#=nill,z#=nill)
		Local t:TVec3=New TVec3
		t.x=x
		t.y=y
		t.z=z
		If y=nill
			t.y=x
			t.z=x
		EndIf
		Return t
	EndFunction

	Method ToString$()
		Return x+", "+y+", "+z
	EndMethod

EndType


It defines Nill as the largest possible float, which is far from ideal.