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 6048487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:28:07+00:00 2026-05-23T07:28:07+00:00

My program outputs state of computations to the terminal and includes quite a bit

  • 0

My program outputs state of computations to the terminal and includes quite a bit of information. I would like to, if possible, color code parts of the text.

I have seen how it can be done in Bash and C++ by referring to threads on this site. However, I have not been able to use any of that to achieve the same result in Fortran (modern). For example, I tried this sample code, which I thought should work:

PROGRAM test
    PRINT*, 'A great color is \033[95m pink \033[0m.'
END PROGRAM test

I would have expected the output to be “A great color is pink” where pink is colored pink. Instead I get “A great color is \033[95m pink \033[0m.” I don’t understand what I am missing.

If I replace the print line in the code with: CALL EXECUTE_COMMAND_LINE(“echo ‘A great color is \033[95m pink \033[0m.'”) then I get the output as desired. However I wouldn’t want to keep calling on echo from my code. Is there any way I can get colored output?

Thanks!

  • 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-05-23T07:28:07+00:00Added an answer on May 23, 2026 at 7:28 am

    The escape character representation as ‘\033’ doesn’t appear to be working for you. I don’t have fortran handy to check, but you might try explicitly using the character instead of the c-style escaping by calling the char conversion function, i.e., make the actual character by calling char(27) and build it into your output string in the correct places.

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

Sidebar

Related Questions

Following program would state my doubt clearly I think,so I posted the program: #include
The program outputs a bunch of nulls when comparing. I think I am not
I have a program that outputs a table, and I was wondering if there
I have a program which outputs a pair of words surrounded by spaces on
Here is a special Haskell program which outputs a Python program that outputs a
A while ago, I wrote a program that outputs any localhost or network database
I've been working on a program that visually outputs the contents of a binary
I wrote a program that accepts and outputs Hebrew (i.e. right-to-left) text. In lieu
I am having issues with one of my outputs in my program. The issue
I have the following program. I wonder why it outputs -4 on the following

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.