View Single Post
09-19-12, 12:53 PM   #3
Barjack
A Black Drake
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 89
Basically, SlashPMS needs to know where to "find" PMSEncode, and since you have PMSEncode's local being declared after SlashPMS, it can't find it during the initial parsing of the file.

Your options are basically either:

a) define SlashPMS after PMSEncode instead of before,

b) continue to define it after but add a line like "local PMSEncode" before SlashPMS so that SlashPMS knows a local called PMSEncode exists (the function itself doesn't need to be there until it's actually called), or

c) put the funtions into a table or similar (e.g. MyAddon.PMSEncode, MyAddon.PMSLetterEncoded) which is always defined at the top of your file, rendering the function order irrelevant since those table key lookups won't need to be resolved until runtime.
  Reply With Quote