Why functions need a parameter list to compile?

BlitzMax Forums/BlitzMax Programming/Why functions need a parameter list to compile?

JoJo(Posted 2008) [#1]
Is this just the way it is in Max?

If I don't put a parameter list it throws a
Expecting function type error.


No parameter list:
Function bmpZeroToNine:Int
	Return 22
End Function


Local num:Int
num = bmpZeroToNine
Print num


Parameter list:
Function bmpZeroToNine:Int (x:Int) 
	Return x
End Function


Local num:Int
num = bmpZeroToNine(22) 
Print num



This shouldn't be should it?


GW(Posted 2008) [#2]
needs ()


Brucey(Posted 2008) [#3]
you can have this, if you like :
Function bmpZeroToNine:Int()

But the () are required syntax.


JoJo(Posted 2008) [#4]
okee dokee.