The For loop can be used completely, as long as there is enough time delay between two bytes, which depends on the baud rate. Usually the baud rate multiplied by the reciprocal of 10 is the time for serial hardware to send a byte, and the delay is longer than this.
About supplement:
That's the problem of programming algorithm. For example, the ASCII codes you receive are "1", "7" and "8". If you subtract the ASCII code of "0" respectively, it becomes three numbers: 1, 7 and 8, and then1*100+7 */kloc-. Generally, the following programming algorithms can be used to "synthesize" the numbers represented by each bit into corresponding values:
Unit number+10* (ten digits+10* (hundred digits+10* (thousand digits+...)). ....