This function writes a word I16 into a buffer at the specified offset.
Syntax |
set_i16 (buffer, i32 offset, i16 set_val) |
---|---|
buffer |
Can be an array, structure, or register |
offset |
Offset in bytes |
set_val |
The word to be written |
Validity |
Task, Rule |
Note |
NO range check is performed, it is up to the user to check that adding the offset and the data size does not exceed the maximum buffer size. See example. If the user wishes to write a word into the 'data' buffer of a structure of type bbc_msguser then he must use the function bcc_set_i16(). The mirror function is the get_i16() |
Once the example program is loaded on a control, via a shell it is possible to verify the operation of set_i16. To do this, set a value between 0 and 127 - sizeof(my_data) to the variable offset, then set a non-zero value to the variable set_val and verify that the variable my_data is equal to set_val.
|