Probably we speak about different things. Here is a simple example of the "indicator" which can be executed under debugger to check nil comparison for lua tables:
- Code: Select all
function Init()
end
function Prepare()
end
function Update(period, mode)
local pt = {};
pt[1] = 1;
if pt[1] == nil then
core.host:trace("pt1 is nil");
end
if pt[1] ~= nil then
core.host:trace("pt1 is not nil");
end
pt[1] = nil;
if pt[1] == nil then
core.host:trace("pt1 is nil");
end
if pt[1] ~= nil then
core.host:trace("pt1 is not nil");
end
end
The output is:
pt1 is not nil
pt1 is nil
However, if pt is input or output indicator stream or integer array (see core.array), the comparison with nil will not work since all these things are numeric vectors. In that case, for streams you have to use stream:hasData(period) to check whether stream is filled for the particular period.