doc:lua_make-your-own-scripts
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
doc:lua_make-your-own-scripts [2014/10/13 18:20] – [The IO Commands] admin | doc:lua_make-your-own-scripts [2014/10/13 18:22] – admin | ||
---|---|---|---|
Line 227: | Line 227: | ||
- | \\ | + | |
+ | ==== loadbuffer ==== | ||
+ | loadbuffer(start: | ||
+ | |||
+ | Reads the file " | ||
+ | |||
+ | The number of bytes read will be returned in " | ||
+ | |||
+ | The following conditions apply: | ||
+ | * If the filename is "" | ||
+ | * If len is 0, the whole file will be read. If the length exceeds the telegram length, an error will be raised. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== savebuffer ==== | ||
+ | savebuffer(start: | ||
+ | |||
+ | Writes the telegram buffer starting at position " | ||
+ | |||
+ | The number of bytes written will be returned in " | ||
+ | |||
+ | The following conditions apply: | ||
+ | * If the filename is "" | ||
+ | * If len is 0, the whole telegram buffer will be written. | ||
+ | |||
+ | ==== setbuffer ==== | ||
+ | setBuffer(bufferNr : byte; newSize: longint) | ||
+ | |||
+ | Changes the actual buffer used to buffer number " | ||
+ | |||
+ | If newsize is <> 0, the old buffer is deleted and new memory with size newmem is allocated. The maximal memsize is 2^31 = 2147483648 bytes | ||
+ | |||
+ | |||
+ | ==== copyBuffer ==== | ||
+ | copyBuffer(bufferNr : byte) | ||
+ | |||
+ | Copies the content of buffer nr. " | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== BlitBuffer ==== | ||
+ | BlitBuffer(frombuffer: | ||
+ | |||
+ | Copies a memory block from the buffer " | ||
+ | |||
+ | In case the buffer len needs to be bigger, the buffer len is increased accourdingly. | ||
+ | |||
+ | ==== SetBufferLen ==== | ||
+ | |||
+ | |||
+ | SetBufferLen(VAR newSize: longint) | ||
+ | |||
+ | All other buffer commands can increase the ' | ||
+ | |||
+ | SetBufferLen sets the ' | ||
+ | |||
+ | The success of the SetBufferLen - operation is returned in the variable newSize itself as follows: | ||
+ | |||
+ | ^ input value of newSize | ||
+ | | < = 0 | available size of the buffer in bytes. This can be used to read the real allocated memory size of that buffer | ||
+ | | 1.. available size | new available size (= requested size) | | ||
+ | | > available size | available size of the buffer as **negative value ** . This is a fault condition | | ||
+ | |||
+ | As seen, a negative value given back indicates a fault condition, all other returned values are positive. | ||
==== Miscellaneous | ==== Miscellaneous |
doc/lua_make-your-own-scripts.txt · Last modified: 2019/04/08 18:43 by admin