Re: TIB:New programer


[Prev][Index][Thread]

Re: TIB:New programer




>To clip between two points use:
>
>centrtxt(s,y,x,z)
>Prgm
>Local d
>int((z-x)/2)->d
>dim(s)*3->z
>Pxltext when(z>d,left(s,dim(s)-int((z-d+2)/3)),s),y,d+x-z
>EndPrgm

Should be (it now centers the clipped text correctly):

centrtxt(s,y,x,z)
Prgm
int((z-x)/2)->z
if dim(s)*3>z
left(s,dim(s)-int((dim(s)*3-z+2)/3))->s
Pxltext s,y,z+x-dim(s)*3
EndPrgm

It is now 100 bytes, but works right. Before using the d+x-z< The z was 
the size of the original string time 3 so if the string was clipped it 
would be messed up. Sorry about the problems this may have caused. If 
someone can find a smaller/quicker way of writing this please let me know.

Hope this helps,

Michael Van Der Kolk
mikev@iserv.net
http://www.iserv.net/~mikev