passing variables into functions in type
BlitzMax Forums/BlitzMax Beginners Area/passing variables into functions in type
| ||
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 |
| ||
I guess you're using superstrict so need...Function create(i:int,x:int,y:Int) |
| ||
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 |
| ||
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') |
| ||
well spotted ! thanks for your replies |
| ||
ok then , can you please advise as to why I get 'identifier ship not found' error? |
| ||
Ship is a variable that needs to be initalized as local or global. |
| ||
Because you forgot to declare it. Use for local Ship:TShip = eachin List |