Problem with Forward Declaration of The functions

Hi 

I am trying to make a game and I have written a few functions. But I’m having a problem with the forward declaration. I need to call a function before I write the function itself but it always gives me an error. 

I searched the internet and tried this method of forward declaration.

[lua] local function_name [/lua]

but this method is also not working. I’ve tried to move the function above the chunk of code that calls it but then the other functions start giving the same error. because the code is calling the functions that haven’t been defined yet. Any help in this regard will be greatly appreciated. 

Thank you.

When forward declaring functions you have to use an alternate way of defining the function later:

local myFunction -- -- somehwere later -- myFunction = function( parameters )      -- function code end

Rob

Is this the same person who filed this question: https://forums.coronalabs.com/topic/65038-function-call/#entry335934

If not, are you taking a course or class?  I ask because this is basically the same question, which is really weird … kinda cool actually. :slight_smile:

If you are the same person, please don’t double post (especially w/ different accounts).

Sorry we are actually in the same class and  on the same project. Not on the same person.

When forward declaring functions you have to use an alternate way of defining the function later:

local myFunction -- -- somehwere later -- myFunction = function( parameters )      -- function code end

Rob

Is this the same person who filed this question: https://forums.coronalabs.com/topic/65038-function-call/#entry335934

If not, are you taking a course or class?  I ask because this is basically the same question, which is really weird … kinda cool actually. :slight_smile:

If you are the same person, please don’t double post (especially w/ different accounts).

Sorry we are actually in the same class and  on the same project. Not on the same person.