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

Can someone please explain why this program outputs 0x00000004? class AndAssignment { static void
I have a little c# console program that outputs some text using Console.WriteLine. I
The following program is very simple: it outputs a single dot each half a
I have a command line program, which outputs logging to the screen. I want
Updated question, see below I'm starting a new project and I would like to
Program followed by output. Someone please explain to me why 10,000,000 milliseconds from Jan
I need to run a native program and retrieve the output in an Adobe
I'm wanting to execute a program and as it runs read in it's output
Most program languages have some kind of exception handling; some languages have return codes,
My program generates relatively simple PDF documents on request, but I'm having trouble with

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.