Forums WoW Modding Support Archives WoWModding Support Archives [DiscordArchive] This is your script ?

[DiscordArchive] This is your script ?

[DiscordArchive] This is your script ?

Pages (5): Previous 1 2 3 4 5
rektbyfaith
Administrator
0
01-22-2022, 11:18 AM
#41
Archived author: Nix • Posted: 2022-01-22T11:18:17.009000+00:00
Original source

```lua
myTable = {};

local function DoStuff()
myTable:Test();
end

function myTable.Test()
print("Testing Stuff");
end

DoStuff();
```
rektbyfaith
01-22-2022, 11:18 AM #41

Archived author: Nix • Posted: 2022-01-22T11:18:17.009000+00:00
Original source

```lua
myTable = {};

local function DoStuff()
myTable:Test();
end

function myTable.Test()
print("Testing Stuff");
end

DoStuff();
```

rektbyfaith
Administrator
0
01-22-2022, 11:18 AM
#42
Archived author: Nix • Posted: 2022-01-22T11:18:37.597000+00:00
Original source

The actual declaration of the function DoStuff is separate to it's invokation
rektbyfaith
01-22-2022, 11:18 AM #42

Archived author: Nix • Posted: 2022-01-22T11:18:37.597000+00:00
Original source

The actual declaration of the function DoStuff is separate to it's invokation

rektbyfaith
Administrator
0
01-22-2022, 11:19 AM
#43
Archived author: Dep • Posted: 2022-01-22T11:19:45.119000+00:00
Original source


[Image: unknown.png?ex=690c8450&is=690b32d0&hm=7...65ed9791a&]
rektbyfaith
01-22-2022, 11:19 AM #43

Archived author: Dep • Posted: 2022-01-22T11:19:45.119000+00:00
Original source


[Image: unknown.png?ex=690c8450&is=690b32d0&hm=7...65ed9791a&]

rektbyfaith
Administrator
0
01-22-2022, 11:19 AM
#44
Archived author: Intemporel • Posted: 2022-01-22T11:19:47.869000+00:00
Original source

This is what I try to say
If you declare the table before the call, but set the function after, it’s work !
It’s just hard to me to explain my idea
rektbyfaith
01-22-2022, 11:19 AM #44

Archived author: Intemporel • Posted: 2022-01-22T11:19:47.869000+00:00
Original source

This is what I try to say
If you declare the table before the call, but set the function after, it’s work !
It’s just hard to me to explain my idea

rektbyfaith
Administrator
0
01-22-2022, 11:21 AM
#45
Archived author: Nix • Posted: 2022-01-22T11:21:46.946000+00:00
Original source

Yes, however it can be "hidden" better, so to speak, the actual declaration of the table do not have to be above in the file, but as you said instead it simply has to occur before the actual execution of the function.

```lua
local function DoStuff()
local myTable = someGlobalTable["myTable"];
myTable:Test();
end

local myTable = {};
someGlobalTable = { ["myTable"] = myTable };
function myTable.Test()
print("Testing Stuff");
end

DoStuff();
```
rektbyfaith
01-22-2022, 11:21 AM #45

Archived author: Nix • Posted: 2022-01-22T11:21:46.946000+00:00
Original source

Yes, however it can be "hidden" better, so to speak, the actual declaration of the table do not have to be above in the file, but as you said instead it simply has to occur before the actual execution of the function.

```lua
local function DoStuff()
local myTable = someGlobalTable["myTable"];
myTable:Test();
end

local myTable = {};
someGlobalTable = { ["myTable"] = myTable };
function myTable.Test()
print("Testing Stuff");
end

DoStuff();
```

rektbyfaith
Administrator
0
01-22-2022, 11:22 AM
#46
Archived author: Nix • Posted: 2022-01-22T11:22:26.771000+00:00
Original source

In the above example, you could also just not make myTable local, and it would work the same as my first example
rektbyfaith
01-22-2022, 11:22 AM #46

Archived author: Nix • Posted: 2022-01-22T11:22:26.771000+00:00
Original source

In the above example, you could also just not make myTable local, and it would work the same as my first example

rektbyfaith
Administrator
0
01-22-2022, 11:22 AM
#47
Archived author: Nix • Posted: 2022-01-22T11:22:48.992000+00:00
Original source

```lua
local function DoStuff()
myTable:Test();
end

myTable = {};
function myTable.Test()
print("Testing Stuff");
end

DoStuff();
```
rektbyfaith
01-22-2022, 11:22 AM #47

Archived author: Nix • Posted: 2022-01-22T11:22:48.992000+00:00
Original source

```lua
local function DoStuff()
myTable:Test();
end

myTable = {};
function myTable.Test()
print("Testing Stuff");
end

DoStuff();
```

rektbyfaith
Administrator
0
01-22-2022, 11:31 AM
#48
Archived author: Dep • Posted: 2022-01-22T11:31:57.173000+00:00
Original source

yo thanks for the help with the addon. if I forgot to say
rektbyfaith
01-22-2022, 11:31 AM #48

Archived author: Dep • Posted: 2022-01-22T11:31:57.173000+00:00
Original source

yo thanks for the help with the addon. if I forgot to say

Pages (5): Previous 1 2 3 4 5
Recently Browsing
 
Recently Browsing