ERROR: attempt to call 'integer'

Sometimes I got this error tryng to format a blob into a string but not always.
I specially have issues with blobs returned by spi class readwrite function.

It’s enough if i do something like this: local str = format("%02X ", blobresult[1]);
The line local str = "Something: "+blobresult[1]; does not produces error, it displays the decimal value of the blob on index 1. What is strange enough I don’t have this problem in every circumstance using the spi.readwrite() …

Can anyone tell me what this Squirrel error means? Or where I can find a list of Squirrel error codes?

The error means that, somehow, Squirrel is trying to use an integer as a function. It’s the same error as created by, for instance,
local f = 3; server.log(f("hello"));
However, while that code is clearly just wrong, similar errors can be caused by bugs in the implementation, where it’s lost track of types somehow.

When you say you “sometimes” get the error, do you mean you have a bit of code that sometimes works or sometimes doesn’t? or do you mean that sometimes you write a piece of code that fails every time? Either way, could you post the whole program? Or message me with it, if you’d rather not post it?


Got the reason - I defined a “local format = 0x00” somewhere in my code and this overwrote the format() function. After that any attempt to call format results in the error which is correct. Phew … Ty.