Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Spaces
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Spaces
Divers
Thread ID:
00440335
Message ID:
00440380
Vues:
10
>?LEN(PADL('FRED',13,' ')) returns 13 as you'd expect
>
>but
>
>?PADL('FRED',13,' ')+'BLOGGS' returns "FREDBLOGGS" instead of "FRED BLOGGS" which is what I want.
>
>why?
>
>and how do I get what I want?
>
>Thanks
>
>Harry


If you are looking for a 13-character result *after* adding the two fields together, than you should be using ...
? PADR('FRED' + ' ' + 'BLOGGS', 13) && For Left-Justified
? PADL('FRED' + ' ' + 'BLOGGS', 13) && For Right-Justified
If you are using variables instead of hard-coded names, than change the code to ...
? PADR(ALLTRIM(cFirstName) + ' ' + ALLTRIM(cLastName), 13) && For Left-Justified
? PADL(ALLTRIM(cFirstName) + ' ' + ALLTRIM(cLastName), 13) && For Right-Justified
Cathy
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform