Jump to content
  • 0

RevealedSoulEven

Question

3 answers to this question

Recommended Posts

A function has to be defined before it is called.

Consider the following examples.

Example 1. Incorrect order of function definition and the call to it.

f() -- won't work because the function is not defined here

function f()
  print('f')
end

Example 2. Correct order of function definition and the call to it.

function f()
  print('f')
end

f() -- will work properly
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.