| Код |
|---|
local run = true function OnStop() run = nil message(tostring(ds:Close())) end function main() ds = assert(CreateDataSource(class, sec, INTERVAL_M5)) while run do sleep(500) end end |
| Код |
|---|
local run = true function OnStop() run = nil end function main() ds = assert(CreateDataSource(class, sec, INTERVAL_M5)) while run do sleep(500) end message(tostring(ds:Close())) end |
Что в первом, что во втором случае, при нажатии на кнопку "Остановить" скрипт падает с ошибкой "bad argument #1 to 'tostring' (value expected)"