Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] hmm, but in your examples there the classname is nowhere as string, would that matter?

[DiscordArchive] hmm, but in your examples there the classname is nowhere as string, would that matter?

[DiscordArchive] hmm, but in your examples there the classname is nowhere as string, would that matter?

Pages (10): Previous 1 3 4 5 6 7 10 Next  
rektbyfaith
Administrator
0
05-16-2022, 05:47 PM
#41
Archived author: Grandold • Posted: 2022-05-16T17:47:43.250000+00:00
Original source

but hmm, why () after v as its just a class name?
rektbyfaith
05-16-2022, 05:47 PM #41

Archived author: Grandold • Posted: 2022-05-16T17:47:43.250000+00:00
Original source

but hmm, why () after v as its just a class name?

rektbyfaith
Administrator
0
05-16-2022, 05:48 PM
#42
Archived author: Grandold • Posted: 2022-05-16T17:48:48.932000+00:00
Original source

assuming the class was just a collection of functions and would not return itself upon creation, would that work the same way?
rektbyfaith
05-16-2022, 05:48 PM #42

Archived author: Grandold • Posted: 2022-05-16T17:48:48.932000+00:00
Original source

assuming the class was just a collection of functions and would not return itself upon creation, would that work the same way?

rektbyfaith
Administrator
0
05-16-2022, 05:49 PM
#43
Archived author: Grandold • Posted: 2022-05-16T17:49:26.561000+00:00
Original source

like, if the classes A and B got, and got only the function :get()
rektbyfaith
05-16-2022, 05:49 PM #43

Archived author: Grandold • Posted: 2022-05-16T17:49:26.561000+00:00
Original source

like, if the classes A and B got, and got only the function :get()

rektbyfaith
Administrator
0
05-16-2022, 05:49 PM
#44
Archived author: Grandold • Posted: 2022-05-16T17:49:56.190000+00:00
Original source

im pretty sure I tried that just like calling v:get() and it just didnt work at all
rektbyfaith
05-16-2022, 05:49 PM #44

Archived author: Grandold • Posted: 2022-05-16T17:49:56.190000+00:00
Original source

im pretty sure I tried that just like calling v:get() and it just didnt work at all

rektbyfaith
Administrator
0
05-16-2022, 05:50 PM
#45
Archived author: Grandold • Posted: 2022-05-16T17:50:40.246000+00:00
Original source

I mean, I hope I'm wrong x)
rektbyfaith
05-16-2022, 05:50 PM #45

Archived author: Grandold • Posted: 2022-05-16T17:50:40.246000+00:00
Original source

I mean, I hope I'm wrong x)

rektbyfaith
Administrator
0
05-16-2022, 05:54 PM
#46
Archived author: Grandold • Posted: 2022-05-16T17:54:32.048000+00:00
Original source

```
local classes = { 'A', 'B' }

A = {}
function A:get ()
return '123'
end

B = {}
function B:get ()
return 'xyz'
end

for k, v in pairs(classes) do
v():get()
end
```
tested this in lua.org demo emulator and it gives same errors I was getting I think
rektbyfaith
05-16-2022, 05:54 PM #46

Archived author: Grandold • Posted: 2022-05-16T17:54:32.048000+00:00
Original source

```
local classes = { 'A', 'B' }

A = {}
function A:get ()
return '123'
end

B = {}
function B:get ()
return 'xyz'
end

for k, v in pairs(classes) do
v():get()
end
```
tested this in lua.org demo emulator and it gives same errors I was getting I think

rektbyfaith
Administrator
0
05-16-2022, 05:55 PM
#47
Archived author: Foe • Posted: 2022-05-16T17:55:16.548000+00:00
Original source


[Image: unknown.png?ex=690c3844&is=690ae6c4&hm=1...d842be54b&]
rektbyfaith
05-16-2022, 05:55 PM #47

Archived author: Foe • Posted: 2022-05-16T17:55:16.548000+00:00
Original source


[Image: unknown.png?ex=690c3844&is=690ae6c4&hm=1...d842be54b&]

rektbyfaith
Administrator
0
05-16-2022, 05:55 PM
#48
Archived author: Grandold • Posted: 2022-05-16T17:55:48.875000+00:00
Original source

cool, didnt realize k and v are automatically in global scope
rektbyfaith
05-16-2022, 05:55 PM #48

Archived author: Grandold • Posted: 2022-05-16T17:55:48.875000+00:00
Original source

cool, didnt realize k and v are automatically in global scope

rektbyfaith
Administrator
0
05-16-2022, 05:56 PM
#49
Archived author: Foe • Posted: 2022-05-16T17:56:02.946000+00:00
Original source

They're not, that's what _G defines
rektbyfaith
05-16-2022, 05:56 PM #49

Archived author: Foe • Posted: 2022-05-16T17:56:02.946000+00:00
Original source

They're not, that's what _G defines

rektbyfaith
Administrator
0
05-16-2022, 05:56 PM
#50
Archived author: Foe • Posted: 2022-05-16T17:56:14.584000+00:00
Original source

that's the variable to access the global namespace, k and v are local values
rektbyfaith
05-16-2022, 05:56 PM #50

Archived author: Foe • Posted: 2022-05-16T17:56:14.584000+00:00
Original source

that's the variable to access the global namespace, k and v are local values

Pages (10): Previous 1 3 4 5 6 7 10 Next  
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)