1
! Center A handy utility for centering printed text in the lower
2
! or upper window for Inform 6 by L. Ross Raszewski
3
! (rraszews@skipjack.bleucrab.org)
4
! Ever wanted something like a status line centered but not known how to do
5
! it without storing the width of the text somewhere? I know I have.
6
! Yes, I'm sure everyone knows how to _now_, but do you have a library to do
7
! it for you? Are you a casual programmer who doesn't want to play with
10
! x is either a string, or a routine to print one. The result is centered
11
! on the current line.
14
! x is as above, i is the number of the line IN THE UPPER WINDOW you want to
16
! The catch? It will only center a number of characters less than your
17
! screen width. Moreover, if your screen width is greater than 128, you can
18
! only center 128 characters. And I think new lines will make it blow up.
20
! Still, it's better than the alternative, innit?
23
Array CenterText string 128;
27
@output_stream 3 CenterText;
28
if (instring ofclass string)
29
print (string) instring;
30
if (instring ofclass Routine)
37
if (instring ofclass string)
38
print (string) instring;
39
if (instring ofclass Routine)
42
[ CenterU instring j i;
44
@output_stream 3 CenterText;
45
if (instring ofclass string)
46
print (string) instring;
47
if (instring ofclass Routine)
54
if (instring ofclass string)
55
print (string) instring;
56
if (instring ofclass Routine)