This function returns a float read from a buffer at the specified offset.
Syntax |
float get_float (buff, i32 offset) |
---|---|
buff |
Can be an array, a structure, or a register |
offset |
Offset in number of bytes you want to read at |
Result |
Returns the value read |
Validity |
Rule, Task |
Notes |
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 |
NOTE: If the user wishes to extract a float from the buffer of a structure of type bbc_msguser then he must use the function bcc_get_float().
Example usage: Once you have loaded the example program on a control, via a shell you can verify the functioning of get_float(). To do this, set a value ((0-:-127) - sizeof(my_data)) to the offset variable, then set a non-zero value to the set_val variable and verify that the my_data variable is equal to set_val. |