Different Colored Words in FORTRAN Output?

In summary, there are two ways to achieve different colors for each word in a print/write statement. The easier method is to use a subroutine library such as "curses" and the harder method is to manually write ANSI escape codes to the terminal output.
  • #1
gmcke1
9
0
Hello all FORTRAN geeks and geekettes,

I was wondering if there is a way to get different colors for each word in a print/write statement?

For example:
WRITE(*,*)'This is my test sentence'

Can I get each word in this write statement to appear as a different color in the terminal window?

Thanks a bunch :D

-Glenn Mckeever
 
Technology news on Phys.org
  • #2

Related to Different Colored Words in FORTRAN Output?

1. What causes the words in FORTRAN output to have different colors?

The color of words in FORTRAN output is determined by the syntax highlighting feature of the text editor or IDE being used. Different colors are used to distinguish between different elements of the code, such as keywords, variables, and comments.

2. How do I change the color of words in FORTRAN output?

The color of words in FORTRAN output can be changed by adjusting the settings of the text editor or IDE. Most text editors and IDEs have options for customizing the syntax highlighting colors.

3. Why are some words in FORTRAN output highlighted in a different color than others?

Certain words in FORTRAN, such as keywords and functions, have predefined colors assigned to them in the syntax highlighting settings. This is done to make the code more readable and easier to understand.

4. Can I create my own color scheme for FORTRAN output?

Yes, many text editors and IDEs allow users to create custom color schemes for syntax highlighting. This can be helpful for those who have specific color preferences or have difficulty distinguishing certain colors.

5. Do the colors in FORTRAN output affect the functionality of the code?

No, the colors used in FORTRAN output are purely for visual purposes and do not affect the functionality of the code. The code will run the same regardless of the colors used for syntax highlighting.

Similar threads

  • Programming and Computer Science
2
Replies
59
Views
9K
  • Programming and Computer Science
Replies
6
Views
3K
  • Programming and Computer Science
Replies
9
Views
1K
  • Computing and Technology
Replies
3
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
3
Views
2K
  • Programming and Computer Science
Replies
2
Views
3K
  • Programming and Computer Science
Replies
2
Views
8K
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
1
Views
2K
Back
Top