Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8110883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:55:02+00:00 2026-06-06T01:55:02+00:00

How to right align a string in 4gl with specified no.of spaces?

  • 0

How to right align a string in 4gl with specified no.of spaces?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:55:04+00:00Added an answer on June 6, 2026 at 1:55 am

    You can use the FILL function to create a specified number of spaces. For example, FILL(“A”, 10) will return “AAAAAAAAAA”.

    Here’s is a simple demo:

    DEFINE VARIABLE cText   AS CHARACTER   NO-UNDO.
    DEFINE VARIABLE iLength AS INTEGER     NO-UNDO.
    
    iLength = 16.
    cText = "Some text".
    
    cText = FILL(" ", iLength - LENGTH(cText)) + cText.
    
    MESSAGE cText.
    

    Your required overall length is 16 characters. Use LENGTH(cText) to determine how many characters your text takes up, and then use FILL to create the remaining number of spaces at the front of the string.


    Informix

    I answered this question for Progress 4GL, and only noticed afterwards that the question was asked about Informix 4GL. I am very sorry for my mistake.

    You can use the same principal to do this in Informix. You use the LENGTH keyword to find out how long your existing text is, but instead of using FILL() to pad it with spaces, you should use SPACES.

    Progress: FILL(" ", 10) + c_text
    Informix: 10 SPACES, c_text
    

    I really hope this helps you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this string: <td align=right><span>&nbsp;19:45&nbsp;</span></td> I want to use a NSPredicate on it
By default, printf() seems to align strings to the right. printf(%10s %20s %20s\n, col1,
I want to right-align an inline element to the right of a div .
I am trying to right-align the output of some PL/SQL code, but dbms_output.put_line is
I'd like to right align this gridview so that it's flush against the right
The most obvious way to right-align a Label in WinForms doesn't work: setting anchor
I have seen questions posted on here asking how to left and right align
Say I have this HTML fragment <td width=25% style=text-align:right; > <span style=font-family: Arial; font-size:
i have this <li><a href=# >title</a> <span style='text-align:right;'>(0)</span></li> its not working and this <li><a
I am trying to align a part of text to the right and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.