This function writes a U16 word to a buffer at the specified offset.
Syntax |
set_u16 (buffer, i32 offset, u16 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 |
Range check is NOT 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_u16(). The mirror function is the get_u16() |
Once you have loaded the example program on a control, via a shell you can verify that set_u16 works. To do this, set a value between 0 and 127 - sizeof(my_data) to the offset variable, then set a non-zero value to inp_w 200 and verify that the variable my_data is equal to inp_w 200.
|