Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Messageboxes
Message
De
02/10/1998 09:02:06
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
29/09/1998 17:06:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00142123
Message ID:
00143181
Vues:
27
>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform