Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Spaces
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Spaces
Miscellaneous
Thread ID:
00440335
Message ID:
00440380
Views:
14
>?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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform