I have a program that reads a file of birthdays and prints
out impending ones when I activate my (Linux) console.
It first prints a header
print '(/" Birthdays:")'
Is it possible to get it to print that in bold or a colour?
If yes, how?
On 1/12/2024 7:54 AM, db wrote:
I have a program that reads a file of birthdays and prints
out impending ones when I activate my (Linux) console.
It first prints a header
print '(/" Birthdays:")'
Is it possible to get it to print that in bold or a colour?
If yes, how?
Ok, I'll bite. So what is the device that you are printing to ?
If the device is a screen then there are control codes that you must
print also.
If the device is a file then, no way. This is the reason that HTML was invented.
On 1/12/2024 7:54 AM, db wrote:
I have a program that reads a file of birthdays and prints
out impending ones when I activate my (Linux) console.
It first prints a header
print '(/" Birthdays:")'
Is it possible to get it to print that in bold or a colour?
If yes, how?
Ok, I'll bite. So what is the device that you are printing to ?
If the device is a screen then there are control codes that you must
print also.
If the device is a file then, no way. This is the reason that HTML was invented.
Lynn
Maybe this way?
bold.f90: ------------------------------------------------------------------------ program testbold
call system('tput bold')
print'("Hello, World!")'
call system('tput sgr0')
print'("Bye, World!")'
end program testbold ------------------------------------------------------------------------
That's my 1st hand full of Fortran lines since the early 90s, so please
don't laugh too loud.
Using `system` and `tput` avoids needing
+ to find a Fortran (n)curses library
+ to hardcode the terminal commands
.
It worked for me with Gfortran on OpenBSD. I was too lazy to install Gfortran on Linux while already having access to it on BSD.
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,075 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 114:29:14 |
| Calls: | 13,799 |
| Calls today: | 1 |
| Files: | 186,990 |
| D/L today: |
5,718 files (1,657M bytes) |
| Messages: | 2,439,099 |