>cMsg1="Hi there I'm a centered"
>cMsg2="Two line message!"
>nMsg1Len=LEN(cMsg1)
>nMsg2Len=LEN(cMsg2)
instead of:
>nRefLen=MAX(nMsg1Len,nMsg2Len)
>cMsg1=PADL(cMsg1,nMsg1Len+((nRefLen-nMsg1Len)*.5),CHR(32))
>cMsg2=PADL(cMsg2,nMsg2Len+((nRefLen-nMsg2Len)*.5),CHR(32))
Why not:
>nRefLen=MAX(nMsg1Len,nMsg2Len)+6 && just adding at least three spaces around
>cMsg1=PadC(cMsg1,nRefLen)
>cMsg2=PadC(cMsg2,nRefLen)
Though, it won't be centered with proportional fonts anyway, and I also think centering was not required at all.