kerry
Member in Training
Posts: 21
|
Post by kerry on Feb 24, 2020 19:47:42 GMT
OK, trying to get some things printed to the screen in aligned columns. Sorry if this is elsewhere, but I could not figure out how to search for the right answer. Here is my code and the resulting output.
This is code snipet:
print " Gender: "; tab(30), genderword$ print " Type of drink: "; tab(30), drink$ print " Number of drinks: "; tab(30), number print " Hours you drink: "; tab(30), using ("##.##", hours) print " Your body weight: "; tab(30), weight print " Hours before driving: "; tab(30), using ("##.##",delay)
This is result when program is run:
Gender: Male Type of drink: Regular Beer Number of drinks: 3 Hours you drink: 1.00 Your body weight: 183
Hours before driving: 0.00
Just don't seem to be able to get Male, Regular Beer, 3, 1.00, 183, and 0.00 to be aligned
|
|
|
Post by tsh73 on Feb 24, 2020 20:07:03 GMT
Using monospaced font, like Courier or Lucida console, tends to help You can set it in menu, Setup/Editor font
|
|
ntech
Junior Member
Posts: 99
|
Post by ntech on Feb 25, 2020 3:54:55 GMT
If you make the strings all the same width like
print " Gender: "; genderword$ print " Type of drink: "; drink$ print " Number of drinks: "; string$(number) print " Hours you drink: "; using ("##.##", hours) print " Your body weight: "; string$(weight) print " Hours before driving: "; using ("##.##",delay)
that's another way to align those.
|
|
|
Post by B+ on Feb 25, 2020 17:25:34 GMT
Consolas is another good one.
|
|