Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-29-24, 09:52 AM   #1
Codger
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 30
What does this code do?

I've seen this in a couple addons but haven't been able to find any info on what it does:

Lua Code:
  1. local frame1 = {}
  2. myAddon.frame1 = frame1

I'm guessing it's another way of setting up a namespace?
What I am doing in an addon is:

Lua Code:
  1. local addonName, addonTable = ...
  2. function addonTable:doSomething()

which requires me to preface everywhere I use doSomething() with addonTable.
Curious if this is a better way?
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » What does this code do?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off