Syntax:
HSerPrintList value1, value2 [, value3 ... ]
Command Availability:
Available anywhere HSerPrint is available.
Enabling Constants:
The same enabling constants as HSerPrint apply.
'USART settings for USART1
#define USART_BAUD_RATE 9600
#define USART_TX_BLOCKING
#define USART_DELAY OFFExplanation:
HSerPrintList sends two or more values in a single statement, instead of
writing one HSerPrint call per value. Each value can be a string,
integer, long, word or byte, and each is sent using the matching typed
HSerPrint call, in the order given, to the default comport. Because the
compiler expands the list into ordinary HSerPrint calls, mixing types in
one statement — a string, then a byte, then a word, and so on — works
exactly as if each value had been sent with its own HSerPrint statement.
HSerPrintList does not send any new line characters. As with HSerPrint,
follow the statement with HSerPrint 13 and HSerPrint 10 if the receiving
terminal needs a new line.
There is no comport argument; a value that must go to a specific comport
should still be sent with HSerPrint(user_value, comport).
Example:
#chip 16F877A, 20
#define USART_BAUD_RATE 9600
#define USART_TX_BLOCKING
#define USART_DELAY OFF
Dim Txt_Heading As String * 12 = "K9AY North"
Dim SignalLevel As Byte = 87
Dim SampleCount As Word = 4213
Do
HSerPrintList "{STAT,", Txt_Heading, ",", SignalLevel, ",", SampleCount, "}", 13, 10 ' <<< the HSerPrintList instruction
Wait 1 s
LoopKey line: the single HSerPrintList call above sends a string literal, a
string variable, another string literal, a byte, another string literal, a
word, a closing brace and a CR/LF pair — nine values in total — as nine
typed HSerPrint calls, without writing any of them out by hand.
See Also:
- HSerPrint — sending a single value, or a value to a specific comport
- HSerSendBytes — sending 2 to 16 raw bytes in one call, rather than typed values
- Ser1PrintList, Ser2PrintList, Ser3PrintList — the same mixed-type list, on a software-serial channel

