print bar
Console Library
This function prints a sequence of characters, for example a horizontal line, across the full width of the screen.
Under normal conditions, the 'Console Library' is loaded automatically, so no 'include(...)' call is needed.
0 - 3
No. | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Opt. 1 input |
string | Pattern The supplied pattern will be applied repeatedly until the screen or specified boundaries have been reached. If a blank string is provided, then it will be replaced by the default pattern, namely the underscore character '_'. The patterns will be stopped when the final position has been reached, even if the last used pattern as supplied is incomplete. Default value: '_' (underscore character) | ||||||||
Opt. 2. input |
numeral | Count The count can be specified with following three approaches
Default value: -1 (full screen width) | ||||||||
Opt. 3. input |
numeral | Offset The offset provides a specified number of spaces and will then reduce the number of characters as specified in the 2nd function parameter.
Default value: 0 |
echo( "Width of console is: ", console(width) );
print bar( '.*.' );
print bar( '+', 0.5, 10);
print bar( '_', -60 );
Width of console is: 80
.*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..*..
++++++++++++++++++++++++++++++
____________________