Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Variables declared outside the main function are initialized once when the component is started.

  • Variables declared within the main function are initialized every time a message is processed by the running component.

Tip

Best Practice: Keep main.lua short and sweet! main.lua should be a treated like a table of contents, all the major activities or functions should live in local modules or libraries and be called by the main() function.

...