Posted 30 December 2012 - 02:55 AM
Hi forum,
I am new to LUA and CC but got some programing experience, but i don't know how to start a specific function from a program without running the rest.
Example program doStuffA2C:
First i wonder if its possible to call the programm like this
The second question is, if it is possible to create a string from an argument and let this string be the function to call in this programm.
I know, i cloud work around this, creating 3 programs, and call them one by one, thus not to have to call the functions. But i just wonder how to make this within one program. Why? More difficult :D/>
Thx
I am new to LUA and CC but got some programing experience, but i don't know how to start a specific function from a program without running the rest.
Example program doStuffA2C:
Spoiler
tArgs = {...}
sArgs1 = tArgs[1]
sArgs2 = tArgs[2]
function.a()
do a
end
function.b()
do b
end
function.c()
do c
end
if tArgs == nil then
a()
b()
c()
else
for i=1,2 do
// this won't work but i write this so you may see how i want it to work
sFunction = sArgs..i.."()"
// so now i want the argument to be the name of the function to call and
// this part to actually turn it into the calling parameter - thus if sArgs1 = b
// call function b - see below
First i wonder if its possible to call the programm like this
doStuffA2C b
to just call function b.The second question is, if it is possible to create a string from an argument and let this string be the function to call in this programm.
I know, i cloud work around this, creating 3 programs, and call them one by one, thus not to have to call the functions. But i just wonder how to make this within one program. Why? More difficult :D/>
Thx