lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hello Tim,

> I would expect this as the chunk contains information for debugging,
> including source code locations. I don't think relying on chunk
> identity is a good approach to solving your problem. Can you explain
> what the underlying problem is in a little more detail?

I just want to know if a certain function block was modified by the user
(in an internal protocol editor).
We use Lua for protocol templates whereas every templates consist of a
part which has to split the incoming data in single telegrams. Another
part in the Lua template script is responsible to format the telegrams.

The splitting for instance creates a single telegram when there is a
specified start byte or a given time between the last byte (like in
Modbus or Profibus).

In the displaying part the user can format the split telegrams according
his own specifications. He can mark the start byte, a device address,
calculate and validate checksums and so on.

Therefore it's important that only a change in a comment or
inserting/deleting comments doesn't force a new 'recalculation or new
splitting' of the available data. As mentioned before this may be a time
consumption process, depending on the size of the record (sometimes
several GByte).

Instead of removing all comments and not necessary white-spaces by hand
I like to use Lua to do the job and 'compile' the given function block
into byte code because I assumed that the byte code only depends on the
functional code.

Best regards