I've written the following method as part of my class:
You will see that I'm trying to return the created 'layer' object, but BlitzMax keeps telling me 'Function can not return value' - however, layers definately an object and works with everything else. Does anyone know why this is?
Method addLayer(id:String) Local layer: mapLayer = New mapLayer.Create(id,Self.width,Self.height); layer.id = id; 'For Local rep:Int = 1 To 20 ' layer.map[Rnd(Self.width),Rnd(Self.height)] = Rnd(1,3); 'Next ListAddLast Self.layers,layer; Return layer '-- allow layer object to be manipulated after creation End Method
You will see that I'm trying to return the created 'layer' object, but BlitzMax keeps telling me 'Function can not return value' - however, layers definately an object and works with everything else. Does anyone know why this is?