Fill

Syntax:

    stringvar =  Fill ( byte_value_of_the_new_length , pad_character )

Command Availability:

Available on all microcontrollers

Explanation:

The Fill function is used to create string to a specific length that is of a specific character.

The length of the string is specified by the first parameter. The character used to pad the string is specified by the second parameter, this parameter is optional as the " "(space) character is assumed.

A typical use is to fill a string to be displayed on an LCD or serial terminal.

Example:

    'Set chip model
    #chip 16F886


    'Set up hardware serial connection
    #define USART_BAUD_RATE 9600
   #define USART_TX_BLOCKING



    HserPrint Fill ( 16, "*" )          ' <<< the Fill instruction
    HSerPrintCRLF

Key line: HserPrint Fill ( 16, "*" ) — builds a 16-character string made entirely of the pad character (*) and prints it, useful for drawing a separator line on an LCD or terminal.

See Also: