Re: Inform: bug in a box?


27 Nov 1995 13:55:18 GMT

Julian Arnold <jools@arnod.demon.co.uk> wrote:
> Compile this (it only takes 1 second):
>
> #SWITCHES sv5x;
> [ Main; box "Hello"; Key(); box "@@92@@92@@92@@92@@92"; Key(); quit; ];
> [ Key k; print "[Press a key]^^"; @read_char 1 k; ];
> #END;
>
> Notice the second box is far too wide, taking each '\' to be four
> characters, presumably because of the `@@92' notation.
>
> Is this a (known) bug? Is there a way around it?

Well, it's a known bug now... One workround is to use Inform's internal
names `Box__Routine' and `Box__table', like so:

[ Main;
box "Hello";
Key();
Box__table-->0 = "@@92@@92@@92@@92";
@erase_window -1;
Box__Routine(1,4,Box__table);
Key();
quit;
];
[ Key k; print "[Press a key]^^"; @read_char 1 k; ];

If you look at the assembly code for the original program (compile with
the switch -a), then you'll see that Inform compiles the function call

Box__Routine(1,20,Box__table);

with the incorrect width 20.

-- 
Gareth Rees