Hi all,
Trying to write a Lua script for Scite (something like lua-users wiki: Scite Comment Box), and when I write the following piece of code:
fchars = string.sub(line, 1, 3)
if fchars == "//" or fchars == "##"
print "got it"
end
... the compilation fails with "attempt to call a string value
".
I have tried different variants, such as:
assert(ktest = (("//" == fchars) or ("##" == fchars)))
... and it seems to me that compilation fails when I try to make a 'compound' boolean expression using the logical operator "or
".
So, how would I do the above check in Lua? Maybe the C-like syntax as above is not supported at all - and I should use something like match instead?
Thanks in advance for any answers,
Cheers!