Compile Error: Function can not return a value

BlitzMax Forums/BlitzMax Beginners Area/Compile Error: Function can not return a value

Barbapapa(Posted 2007) [#1]
And I don't understand what's missing.
If I omit SuperStrict it compiles.

This is my Method

SuperStrict

Type TClient

	Global list:TList = New TList

	Method New() 
		list.AddLast(Self) 
	End Method

	Method clientsCount() 
		Return list.Count() 
	End Method
End Type



grable(Posted 2007) [#2]
When using SuperStrict ALL variables must have a type, even function results ;)

Method clientsCount:Int() 
....



Perturbatio(Posted 2007) [#3]
When using SuperStrict ALL variable must have a type, even function results ;)


Yep, you need to specify the return type in the method

SuperStrict

Type TClient

	Global list:TList = New TList

	Method New() 
		list.AddLast(Self) 
	End Method

	Method clientsCount:Int() 
		Return list.Count() 
	End Method
End Type



Barbapapa(Posted 2007) [#4]
oh yes, I thought I had tried this, funny, I guess I don't know anymore what I tried everything, must have been too late ;)
or a maybe a reboot this morning helped, don't know, but it works now, thank you very much.


tonyg(Posted 2007) [#5]
I strongly suspect the suggested changes made the difference rather than a reboot.


Barbapapa(Posted 2007) [#6]
me too :) but sure I am not, sometimes the forces do go strange ways...


Czar Flavius(Posted 2007) [#7]
Mysticism of the strange forces are fine for Windows, but not for programming ;)


Barbapapa(Posted 2007) [#8]
don't underestimate the dark force 8=