20 posts
Posted 14 April 2016 - 08:16 PM
okay so i have been messing around with the parallel api or however its spelt so i expiremted an i came across the issue of not being to use arguements any idea how to??
Edited by
3057 posts
Location
United States of America
Posted 14 April 2016 - 08:26 PM
Wrap the function call in a function.
function() read(*) end
20 posts
Posted 15 April 2016 - 08:47 AM
okay uhhm dont get it..
i tried
parallel.waitForAll(task1(arg here),task2(arg here))
Edited on 15 April 2016 - 06:51 AM
7083 posts
Location
Tasmania (AU)
Posted 15 April 2016 - 09:10 AM
You have to pass the API function pointers. It then executes the functions they point to. What you're doing is calling your functions, and then attempting to pass whatever they return to the API.
Try it like this:
local function wrapper1()
task1(arg here)
end
local function wrapper2()
task2(arg here)
end
parallel.waitForAll(wrapper1, wrapper2) --# Note the lack of brackets after wrapper1 / wrapper2
20 posts
Posted 15 April 2016 - 09:37 AM
okay thanks
2427 posts
Location
UK
Posted 15 April 2016 - 01:22 PM
what KingofGamesYami did was define an anonymous function which you would use like so:
parallel.waitForAll(function() read(*) end, someOtherFunctionPointer)
--# someOtherFunctionPointer could also be another anonymous function
Edited on 15 April 2016 - 11:23 AM