How does it work?
mov esi, Cat$(Chr$("z", ecx+48, "EC ")+d$(ct, 3)) ; City: Column z (=10+26+26), row ecx, foregroundcolour E (yellow), bg C (red)
Print At(#esi) Left$(esi, 13, "_") ; for short strings, fill right half with "_"
esi points to a string with a specific format:
ABCD this is a string
A is the print column, where
0 0
9 9
A 10+0=10
Z 10+25=35
a 10+26+0=36
z 10+26+25=61
B is the print row, using the same scheme.
C and B are the foreground and background colours, with
cBlack = 0 ; http://support.microsoft.com/kb/319883
cDarkBlue = 1
cDarkGreen = 2
cDarkCyan = 3
cDarkRed = 4
cDarkMagenta = 5
cDarkYellow = 6
cGray = 7
cDarkGray = 8
cBlue = 9
cGreen = 10 ; A
cCyan = 11 ; B
cRed = 12 ; C
cMagenta = 13 ; D
cYellow = 14 ; E
cWhite = 15 ; F
The attachment contains sources and files to build this; including a new Left$() macro:
Print Left$("some string", 20, "_") ; prints some string_________
The third optional argument is a fill char for padding the string to the right in case it's shorter than 20 chars. Can be quite useful in some situations, inter alia for overwriting the previous field when filling the screen as shown above. In the attached exe, the Street column does not have padding, and when scrolling through the database you can see the effect.