cannonssk
|
  |
| Joined: 02 Mar 2010 |
| Total Posts: 278 |
|
|
| 06 Aug 2012 07:40 PM |
In this script here,
tab = {} function tab.func( arg ) print "I'm in a table" end tab.func(1)
How would you define a tab.func(2)? would you just do like
tab = {} function tab.func( arg ) print "I'm in a table" end function tab.func( arg ) print "Table 2" end tab.func(1) tab.func(2)
does the table automatically assign the variable ? |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2012 07:48 PM |
tab = {"data1","data2"} function printfunc() print(rawget(tab,1)) print(rawget(tab,2)) end printfunc() |
|
|
| Report Abuse |
|
|
cannonssk
|
  |
| Joined: 02 Mar 2010 |
| Total Posts: 278 |
|
|
| 06 Aug 2012 07:49 PM |
Is the "Rawget" part of this script just a variable?
|
|
|
| Report Abuse |
|
|
|
| 06 Aug 2012 08:03 PM |
| rawget is a function to get raw data out of tables |
|
|
| Report Abuse |
|
|
cannonssk
|
  |
| Joined: 02 Mar 2010 |
| Total Posts: 278 |
|
| |
|
|
| 06 Aug 2012 08:06 PM |
the output for the script i wrote would be
data1 data2
just prints what i got with the rawget |
|
|
| Report Abuse |
|
|
cannonssk
|
  |
| Joined: 02 Mar 2010 |
| Total Posts: 278 |
|
| |
|
GearKoo2
|
  |
| Joined: 18 Jul 2012 |
| Total Posts: 64 |
|
| |
|
GearKoo2
|
  |
| Joined: 18 Jul 2012 |
| Total Posts: 64 |
|
|
| 06 Aug 2012 08:08 PM |
| ^ IF DIS GETS DELETED EVERYONE ON DIS THREAD IS A NOOB BESIDES ME! HHHAHAHHAHAHAHHAH! |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2012 08:10 PM |
LOL. TROLLLLLOLOLOL.
------------------------- ~thedestroyer115, some of the most kind and helpful posts possible!~ |
|
|
| Report Abuse |
|
|