[Coco] Release CenterText.b09

phil pt ptaylor2446 at gmail.com
Mon Apr 9 22:17:30 EDT 2018

I will make the proper changes to the copyright notices and Dim a,b,c as a
Integer. Since the code is so small it really should not cause any issues.

For the Copyright notice The program is being release as Public domain with
no technical support. You may use the program in your own project but the
users are prohibited from making changes to CenterText and release it to be
included in Os9Budget.

On Mon, Apr 9, 2018 at 4:08 PM, James Jones <jejones3141 at gmail.com> wrote:

> Wayne Campbell is quite right about making those numeric variables integer,
> but few to none of them are actually necessary. Ditto for most of the
> string variables. T3 is set and never used; T2 is set to the empty string
> and then overwritten; it might as well just be set rather than appended to,
> and one could just as well PRINT T1;TT, but all that said, since one has
> PRINT USING which can center strings, why not take advantage of it?
> Actually, there may be one reason; if you fill it out to the screen width,
> it may do something unfortunate like gratuitously double space or even
> scroll on the bottom line. The code as written doesn't print out the
> trailing spaces--I take it something else has always cleared the line?--and
> perhaps that's why, in which case one could write what does the same but
> doesn't clearly say "yes, I am centering this":
> PROCEDURE CenterText
>     PARAM width:INTEGER;text:STRING[80]
>     PRINT USING "S"+STR$(INT((width-LEN(text))/2)),"";
>     PRINT text
> The following is by far preferable if it doesn't cause unfortunate
> wrapping--actually, that's why I added the semicolon in the original reply:
> PROCEDURE CenterText
>     PARAM width:INTEGER;text:STRING[80]
>     PRINT USING "S"+STR$(width)+"^", text
> Now, so far we've ignored the POKE. What's special about the byte at
> address 64301? What owns it? Can one have two processes running the budget
> program concurrently?
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco

More information about the Coco mailing list