This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Wilma456's profile picture

Call Coroutine witc string

Started by Wilma456, 15 July 2016 - 01:24 PM
Wilma456 #1
Posted 15 July 2016 - 03:24 PM
How can I call a coroutine with a string? For example:

co = coroutine.create(function()
print("test")
end)
cor = "co"
coroutine.resume(cor)
This is just for example. I need this in a komplexer code.
Lupus590 #2
Posted 15 July 2016 - 05:17 PM
you can with tables


tab.co = coroutine.create(function()
print("test")
end)
cor = tab["co"]
coroutine.resume(cor)