Last change
on this file since 7657 was
7656,
checked in by bensch, 18 years ago
|
lua-scripts added (this is temporary)
|
File size:
867 bytes
|
Line | |
---|
1 | |
---|
2 | -- Tests the parameter passing, using and returning |
---|
3 | function this.divideMe (this, count) |
---|
4 | trace ("In divideMe..."); |
---|
5 | return count / 30 |
---|
6 | end |
---|
7 | |
---|
8 | -- Tests lua calling lua functions |
---|
9 | function this.luaCallMe () |
---|
10 | trace( "luaCallMe" ) |
---|
11 | end |
---|
12 | |
---|
13 | -- Tests lua calling lua functions |
---|
14 | function object.luaCallMe () |
---|
15 | trace( "luaCallMe" ) |
---|
16 | end |
---|
17 | |
---|
18 | function this.luaCallMeToo (this) |
---|
19 | this:hello1 () |
---|
20 | end |
---|
21 | |
---|
22 | -- Main test routing |
---|
23 | function this.CountAndCall (this, i) |
---|
24 | --this:luaCallMe () |
---|
25 | --this:luaCallMeToo () |
---|
26 | object:printNameTwo () |
---|
27 | object:printHello () |
---|
28 | |
---|
29 | --trace ("CountAndCall") |
---|
30 | |
---|
31 | while (i <= 4) do |
---|
32 | -- this:hello1 () |
---|
33 | --this:hello2 (i,i*2) |
---|
34 | i = i+1 |
---|
35 | end |
---|
36 | |
---|
37 | -- trace ("Hello, debug world!") |
---|
38 | end |
---|
39 | |
---|
40 | -- Tests the C-Api returning values to lua |
---|
41 | function this.returnToMe (this, i) |
---|
42 | trace ("returnToMe") |
---|
43 | x = this:hello3 (i) |
---|
44 | io.write ("returnToMe ", x) |
---|
45 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.