It is intended to be used as a HELPER, during developement only.
Most helpfull on WIN-console larger than 80, to check console output posi-
tion and whether it fits into a standard console window.
The License given, just specifies that and, that all other rights remain mine.
Code: Select all
/' --------------------------------------------------------------------
| ConsRuler_Sub.bas -- (c) 2019-05-31, MrSwiss (All rights reserved!) |
| EXCLUSION: you may use it, during the development stage, of any |
| software project, commercial or otherwise but, you |
| are obliged to remove it, from your release version! |
| PROHIBITED: redistribution in any form (source, binary e.t.c.)! |
| removal and/or change of this notice! |
|---------------------------------------------------------------------|
| console ruler (size: only 79 chars wide) helps by layouting, _ |
| especially on WIN, when default console is set larger than default |
-------------------------------------------------------------------- '/
'
' compile: -s console
'
Declare Sub ConsRuler(ByVal row As UByte = 1, ByVal fc As UByte = 10, _
ByVal bc As UByte = 0)
ConsRuler() ' default: first row/br_green/black
' <==== any code of your choice, from here ...
Locate CsrLin + 2 : Print "press a key, to EXIT ! ";
Sleep
Sub ConsRuler( _ ' display ruler to console
ByVal row As UByte = 1, _ ' starting row (two rows!)
ByVal fc As UByte = 10, _ ' foreground color
ByVal bc As UByte = 0 _ ' background color
) ' first: prevent user ERRORS
If row < 1 Then row = 1 ' limit min. row
if row > 22 Then row = 22 ' limit max. row
If fc > 15 Then fc = 15 ' limit fc color range
If bc > 15 Then bc = 15 ' limit bc color range
If fc = bc Then Exit Sub ' invisible, aka: ERROR
'
Const As String crst = "1234567890", crst1 = "123456789"
/' --------------------------------------------------------------------
| ConsRuler_Sub.bas -- (c) 2019-05-31, MrSwiss (All rights reserved!) |
| EXCLUSION: you may use it, during the development stage, of any |
| software project, commercial or otherwise but, you |
| are obliged to remove it, from your release version! |
| PROHIBITED: redistribution in any form (source, binary e.t.c.)! |
| removal and/or change of this notice! |
|---------------------------------------------------------------------|
| console ruler (size: only 79 chars wide) helps by layouting, _ |
| especially on WIN, when default console is set larger than default |
-------------------------------------------------------------------- '/
Color(fc, bc) : Locate row, 1 ' always: left justified
Print "0"; Tab(10); "1"; Tab(20); "2"; Tab(30); "3"; _
Tab(40); "4"; Tab(50); "5"; Tab(60); "6"; Tab(70); "7"
Print crst; crst; crst; crst; crst; crst; crst; crst1
Color(7, 0)
End Sub
' ----- EOF -----