[Coco] Release CenterText.b09

Wayne Campbell asa.rand at gmail.com
Sun Apr 8 23:27:42 EDT 2018


Is there a reason why you are dimming four variables of type real when the
values never exceed the maximum an integer can hold? I would recommend
adding :INTEGER to the end of that Dimension statement. Doing this will
reduce memory usage and speed up execution by doing integer math instead of
floating point math.

DIM A,B,C,I:INTEGER

Wayne

On Sun, Apr 8, 2018, 9:58 AM phil pt <ptaylor2446 at gmail.com> wrote:

> The following code is a procedure file CenterText.b09 that is used in Os9
> Budget. This is the only source code that will be release.  Please read the
> copyright notice.
>
> PROCEDURE CenterText
>
> (* CenterText (C) 2018 By Phillip Taylor *)
> (* Relase conditions The user can use this code but not for commercial *)
> (* Use. Any modifications that the user makes to this code may not be *)
> (* be included in the Os9Budget Program. Violations of this terms the user
> *)
> (* will not longer be able to this procedure file. *)
>
> (* Params Passed TT Text & SW is the Screen Width *)
>
>
> PARAM SW:Integer; TT:String[80] \(* SW = Screen Width, TT = Text *)
> DIM A,B,C,I
> DIM T1,T2,T3:STRING[80]
> DIM ID:String[1]
> T1=""
> T2=""
> T3=""
> A=0
> B=0
> C=0
> A=LEN(TT)
> B= B + SW - A
> C=INT(B/2)
> FOR I=1 TO C
> T1 = T1 + " "
> NEXT I
> T2 = T2 + T1 + TT
> Poke 64301,C                \ (* Save the screen position in memory/Center
> Text  *)
> PRINT T2
> END
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list