Ascii Chars

Nice small code lists all ASCII chars on screen in beautifull order.

'Graphic screen ascii chart for low and high ascii chars'
'Richard D. Clark'
'Public Domain
'*****************************************************************'
Const fbWhite = Rgb (255, 255, 255)
Const fbYellow = Rgb (255, 255, 000)
Const fbGrey = Rgb (192, 192, 192)
Const fbBlack = Rgb (0, 0, 0)
Const fbGreen = Rgb (000, 255, 000)
Const fbEmeraldGreen = Rgb (000, 201, 087)
Const fbGreenPale = Rgb (152, 251, 152)
Const fbYellowGreen = Rgb (154, 205, 050)
Const fbOrange = Rgb (255, 128, 000)
Const fbSalmon = Rgb (250, 128, 114)
Const fbCarrot = Rgb (237, 145, 033)
Const fbMarsYellow = Rgb (227, 112, 026)
Const fbGold = Rgb (255, 215, 000)
Const fbMelon = Rgb (227, 168, 105)

Windowtitle "Ascii Code Table"
Screen 18, 32

Sub PrintAscii
    Dim As Integer i, ccol, col, row
    Dim As String cout

    Color fbWhite, fbBlack
    Cls
    col = 1
    row = 1
    Color fbOrange, fbBlack
    Locate row, col
    Print "Low Ascii"
    For i = 0 To 127
        row += 1
        ccol = col
        cout = Trim(Str(i))
        If Len(cout) < 3 Then 
            cout = String(3 - Len(cout), "0") + cout
        End If
        Color fbWhite, fbBlack
        Locate row, ccol
        Print cout
        ccol += 3
        Color fbGrey, fbBlack
        Locate row, ccol
        Print ":"
        ccol += 1
        If i >= 65 And i <= 90 Then 
            Color fbGreen, fbBlack
        Elseif i >= 97 And i <= 122 Then 
            Color fbEmeraldGreen, fbBlack
        Elseif i >= 48 And i <= 57 Then
            Color fbGreenPale, fbBlack
        Elseif i >= 3 And i <= 6 Then
            Color fbYellowGreen, fbBlack
        Else
            Color fbYellow, fbBlack
        End If
        Draw String ((ccol-1)*8,(row-1)*16),Chr(i)
        ccol += 1
        Locate row, ccol
        Print " "
        If row = 14 Then 
            row = 1
            col = ccol + 2
        End If
    Next
    row = 15
    Color fbOrange, fbBlack
    col = 1
    Locate row, col
    Print "High Ascii"
    For i = 128 To 255
        row += 1
        ccol = col
        cout = Trim(Str(i))
        If Len(cout) < 3 Then 
            cout = String(3 - Len(cout), "0") + cout
        End If
        Color fbWhite, fbBlack
        Locate row, ccol
        Print cout
        ccol += 3
        Color fbGrey, fbBlack
        Locate row, ccol
        Print ":"
        ccol += 1
        If i >= 176 And i <= 178 Then
            Color fbGold, fbBlack
        Elseif i >= 219 And i <= 223 Then
            Color fbSalmon, fbBlack
        Elseif i = 201 Or i = 205 Or i = 203 Or i = 187 Or _
               i = 186 Or i = 204 Or i = 206 Or i = 185 Or _
               i = 200 Or i = 202 Or i = 188 Then
            Color fbCarrot, fbBlack
        Elseif  i = 218 Or i = 196 Or i = 194 Or i = 191 Or _
                i = 179 Or i = 195 Or i = 197 Or i = 180 Or _
                i = 192 Or i = 193 Or i = 217 Then
            Color fbMarsYellow, fbBlack
        Elseif i = 213 Or i = 209 Or i = 184 Or i = 198 Or _
               i = 198 Or i = 216 Or i = 181 Or i = 212 Or _
               i = 207 Or i = 190 Then
            Color fbMelon, fbBlack  
        Else
            Color fbYellow, fbBlack
        End If
        Draw String ((ccol-1)*8,(row-1)*16),Chr(i)
        ccol += 1
        Locate row, ccol
        Print " "
        If row = 28 Then 
            row = 15
            col = ccol + 2
        End If
    Next
End Sub

PrintAscii
Sleep
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.