Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

The Copyright Symbol

Ilie__Daniel
Beginner
1,426 Views

Hello!

Is there a way to print the "copyright simbol" (ALT+0169) from within a FORTRAN program?

I tried to use the char() intrinsic, but I could not find the symbol.

Thank you for your help.

Daniel.

0 Kudos
5 Replies
Les_Neilson
Valued Contributor II
1,427 Views

character :: c

open(11,file='copyright.txt')

c = char(169)

write(11,'(a)') c

Les

0 Kudos
Ilie__Daniel
Beginner
1,427 Views

Thank you Les!

That worked fine. However, I wanted to print the symbol to the screen.

I added the following line of code:

print

("(a)"),c

but all I saw was this symbol

Could the regional setting of my computer have any effect?

Daniel.

0 Kudos
Les_Neilson
Valued Contributor II
1,427 Views

Possibly.

When I did print instead of write, in my console windowI got the "Registered" symbol - like copyright but with "R" in place of "c" in the circle.

Les

0 Kudos
Steven_L_Intel1
Employee
1,427 Views
When you say "the screen", do you mean a console window? Whether this works depends on what "codeset" your console window uses - the copyright symbol is not included in all such codesets. You can use the text "Copyright" instead. "(C)" is often used but has no legal meaning.
0 Kudos
Ilie__Daniel
Beginner
1,427 Views

Steve,

Yes, I meant the console window.

My codeset is 437, so that is why I did not get the symbol.

The symbol displays correctly in codeset 850.

Thank you for your help.

Daniel.

0 Kudos
Reply