April 2006
Beginner
1114 pages
98h 16m
English
Finally, Visual Basic includes a couple of simple functions that create strings of repeated characters
. The Space function returns a string containing spaces, and the String function returns a string containing a repeated character. Those functions are sometimes used in combination with Chr when creating reports or drawing text borders as shown here:
' Draws a little box in the Immediate window.
Sub DrawBox( )
Debug.Print Chr(1) & String(20, Chr(6)) & Chr(2)
Debug.Print Chr(5) & Space(20) & Chr(5)
Debug.Print Chr(5) & Space(20) & Chr(5)
Debug.Print Chr(5) & Space(20) & Chr(5)
Debug.Print Chr(3) & String(20, Chr(6)) & Chr(4)
End SubRead now
Unlock full access