Results 1 to 6 of 6

Thread: How to Left Justify Data, pad with spaces on right.

  1. #1
    Member
    Real Name
    Mark Spearman
    Join Date
    Jul 2009
    Posts
    20

    Default How to Left Justify Data, pad with spaces on right.

    I want to left justify data and fill the left with spaces. For example, if the input is only "AA" in a character field that is 10 long, I want the field to hold the value "AA ".

    Any help appreciated. This should be common, but I'm not finding anything on a search of the forum or the help files.

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    22,702

    Default Re: How to Left Justify Data, pad with spaces on right.

    Did you mean "fill the left with spaces" or "fill the right with spaces"?


    If you have a table field defined as character, ten places, the contents will by nature be left justified padded to the right to the length of the field with spaces, in an Alpha dbf. You can't store just "AA " in a ten place field.
    If you're the smartest person in the room, you're in the wrong room.

  3. #3
    Member
    Real Name
    Mark Spearman
    Join Date
    Jul 2009
    Posts
    20

    Default Re: How to Left Justify Data, pad with spaces on right.

    Wow, I really worded that poorly. My apologies.

    Simply put, I need to know how to format at field for left justification with spaces padding the right.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    22,702

    Default Re: How to Left Justify Data, pad with spaces on right.

    I'm not understanding, sorry.

    Character table fields by definition are left justified and filled to the right with spaces. If you have a numeric field you can

    Code:
    test = 12345
    ? str(test)
    = "     12345"
    
    ? padr(alltrim(str(test)),10," ")
    = "12345     "
    If say a label for a field is right justified and you want it left justified, edit the display properties.

    (Speaking for desktop items.)
    Attached Images Attached Images
    If you're the smartest person in the room, you're in the wrong room.

  5. #5
    Member
    Real Name
    Mark Spearman
    Join Date
    Jul 2009
    Posts
    20

    Default Re: How to Left Justify Data, pad with spaces on right.

    That's exactly what I was trying to do. Thank you so much.

    The documentation for padr confused me when I tried it before. I'm new to Alpha 5 and not used to their docs yet.

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    22,702

    Default Re: How to Left Justify Data, pad with spaces on right.

    Glad to help. Remember to illustrate your issue as closely to the actual problem as possible.

    The use of "AA " as an example confused me.
    If you're the smartest person in the room, you're in the wrong room.

Similar Threads

  1. Signature Pad
    By Tom Henkel in forum Alpha Five Version 8
    Replies: 7
    Last Post: 05-13-2011, 09:35 AM
  2. pad field on data entry
    By dcorcoran in forum Alpha Five Version 6
    Replies: 11
    Last Post: 04-19-2005, 07:53 PM
  3. New user - Right justify or 0 pad field?
    By michaelklein in forum Alpha Five Version 5
    Replies: 13
    Last Post: 09-18-2003, 04:41 AM
  4. XDialog Justify
    By Scott Emerick in forum Alpha Five Version 5
    Replies: 9
    Last Post: 05-26-2003, 06:04 PM
  5. Right Justify
    By nick marodis in forum Alpha Five Version 4
    Replies: 1
    Last Post: 04-24-2000, 04:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

The Reviews Are In...

It just is revolutionary and reminds me of VB and how it changed the world.
quote Robert Scoble, Scobleizer

...Version 10 is a turning point on how developers will be writing applications for the web
quote Alan Ashendorf, Lets Talk Computers

Alpha Five version 10... this version is really a break-through for web developers.
quote The Wall Street Journal, Digital Network

Our Professional Services Division

Training and Mentoring - Alpha Software's Professional Services division is here to help. We offer mentoring and training services, for those who need guidance or advice building their own applications.

Development Services - Need someone to build your application? We'll get the job done right. We have an in-house team of Alpha Five developers and a network of carefully selected artists, designers and IT professionals ready to handle projects of any size. Read more .

submit a project request

Alpha Five Awards & Press
awards
Products Store Support Services About Cart Site Map Resources Home
© Copyright 2000-2011 Alpha Software, Inc. 70 Blanchard Road Burlington, MA 01803 781.229.4500
more