passing variables into functions in type

BlitzMax Forums/BlitzMax Beginners Area/passing variables into functions in type

767pilot(Posted 2006) [#1]
I have data stored in a file regarding object placement eg player start position

When I want to create that player I have a function within a type which I will then pass the variables into the player that I am creating like so (obviously nowhere near complete yet!):



With the variables in the brackets for the create function I get a 'missing type specifier' error. What am I doing wrong please?

Thanks
Graham


tonyg(Posted 2006) [#2]
I guess you're using superstrict so need...
Function create(i:int,x:int,y:Int)



767pilot(Posted 2006) [#3]
thanks,Ive added that as you suggest (am using superstrict)

now the error says 'Overriding method differs by type'

what does this mean please?

here is my code




tonyg(Posted 2006) [#4]
Your TPlayerShip Create() function takes parms while your SpaceObject Create() does not.
You might also want to check the forum codes for posting code (e.g. look for 'code' and 'codebox')


767pilot(Posted 2006) [#5]
well spotted ! thanks for your replies


767pilot(Posted 2006) [#6]
ok then , can you please advise as to why I get 'identifier ship not found' error?




Jesse(Posted 2006) [#7]
Ship is a variable that needs to be initalized as local or global.


Dreamora(Posted 2006) [#8]
Because you forgot to declare it.

Use for local Ship:TShip = eachin List