Return a decimal number from the head of the Rx buffer for the serial port at address pp. Skip any leading spaces. Process leading + or - sign if present. Terminate on anything thereafter that's not a decimal digit or decimal point, or after processing fw characters in total (including spaces, sign and decimal point). Consume the characters used but not the terminating character. Result in W, NaN if nothing there. R register signals outcome. 0 = OK, 1 = no valid decimal number present.
Notes:
fw includes leading spaces, signs and decimal point.fw characters are used, less than fw characters will be removed from the buffer.fw is 1 to 255. fw = 255 disables character counting.fw.Can only exist on boards that have an uncommitted serial port other than the programming port.
See also COMRx_GetHex, COMRx_BufLen, COMRx_FindXInBuf
The following shows the result of the instruction ComRx_fGetNum 8 for various receive buffer contents.
| Receive buffer contents before (Shown as ASCII (printable) characters. | Result returned in W | Receive buffer contents after conversion | Comment |
|
| 23.456 |
| |
|
| 123 |
| Leading spaces are counted in the field width. The decimal point "makes it", |
|
| -123.456 |
| All good, got it all |
|
| -123.45 | The last digit is excluded, because the field width of 8 terminates conversion. Furthermore, a subsequent conversion (with | |
|
| -12.3 |
| The second decimal point terminates conversion. If the same instruction were executed again (with |
Dialect exclusions: Not available in dialects before 29