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

fortran code appearance in vis studio 2022

stedwomas
Beginner
2,510 Views

I must have done something but my fortran code now appears as plain text, This is how it appears in vis studio 2012

stedwomas_0-1707304953834.png

 

but now it is just plain black and white  in vis studio 2022

 

 any help would be appreciated 

 

steve

0 Kudos
9 Replies
JohnNichols
Valued Contributor III
2,477 Views

This is a color theme for VS 2022 that comes from the MS color themes for VS 2019, it may fix the issue, at least it gives a nicer background than the standard blasted awful colors. 

Unzip and run and it will install.  

Sorry about the name. 

0 Kudos
stedwomas
Beginner
2,429 Views
0 Kudos
jimdempseyatthecove
Honored Contributor III
2,471 Views

The code snip you showed must have been from a Fixed-Form source file (*.f or *.for) as opposed to the Free-Form source file (*.f90).

Fixed-Form files reserve the first 6 characters of the line for special purposes (C in column 1 for comment, nnnnn in first 5 characters for statement number, and non-blank character in column 6 for continuation line indicator), and the remaining characters in columns 7:72 are for code, any characters following column 72 are ignored. Free-Form does not follow this.

 

In Visual Studio, the text highlighting has been enhanced to highlight characters 73 and beyond (ignored characters) in green.

Therefore, some of (4) your statements are truncated.

 

It may be advisable to change your file type to free-form (*.f90)...

*** However, this will depend on if other statements in the source file require Fixed-Form.

 

Jim Dempsey

0 Kudos
stedwomas
Beginner
2,429 Views

Hi Jim , i know about the 72 character in fixed format Fortran,but i set the allowable characters to 132 , however  characters after 72 do show up green , although they count as it were. 

The problem appeared about two weeks ago when suddenly i lost the text colors.  I must have altered the settings inadvertently, but I am at a loss to  what I have done ,  I just want the colors back to as they are shown in the snippet of code (from vis studio 2012) i have shown.  I can live with "green" code after column 72 but its difficult to work without the "red" text 

steve

 

 

 

 

 

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,420 Views

Is highlighting present in a C/C++ project?

 

Under Tools | Options do you see Intel Compilers and Libraries?

jimdempseyatthecove_0-1707415216025.png

If you do not see it, then you may need to re-install or Repair the oneAPI installation and check the box to integrate with VS 2022

 

Jim Dempsey

0 Kudos
stedwomas
Beginner
2,373 Views

hi JIm i see this

stedwomas_0-1707501285777.png

 

 i have not worked in C++ but managed to get  a sort of basic standard program loaded and saw this

stedwomas_1-1707501622431.png

so it may seem just the fortran is not conducive 

 

best regards

 

steve

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,328 Views

So the C++ configuration demonstrates that color highlighting is available.

 

I would suggest uninstalling and reinstalling the oneAPI toolkits. I have no other explanation for this behavior other than an integration issue with MS VS. 

Note, your most recent post shows IFORT and IFX were integrated into MSVS so it is odd that the colorization did not appear. Perhaps a behind the scene update of MSVS disrupted the behavior.

 

Also, be cautious of the practice of updating MSVS to "latest and greatest" as the 3rd party toolkits (intel oneAPI in this case) may lag behind in integration.

 

Jim Dempsey

 

0 Kudos
JohnNichols
Valued Contributor III
2,319 Views

MSVS

if you use 2019 you will have no problems, but a number of odd  warnings are starting to pop up with building. These can be ignored.  This is a older build.

If you are using 2022 then you will have few problems, currently I am at the latest iteration and there are no Fortran problems,  this has a few nice bells and whistles

If you are using 2022 Preview and the latest, it is apparent that Intel are starting to accommodate the changes, but they are not fully there yet.  If your Fortran skills are high, this will cause no problems merely as noted elsewhere a few annoyances with debugging, which if you loved MS Fortran 3.31 and a vedit editor you will feel just like it is 1989 again.   This is much improved in Studio, it is worth pain if you can handle old fashioned debugging.  It has a lot of neat features.  

It is dependent on the age of your computer and your personal pain tolerance, but as it takes only a few hours to reinstall a complete windows with MS and IVF it is not the issue it used to be.  

The biggest problem at the moment is the latest iteration of Windows 11 - normal update has an issue with folders and about 25% of my computers around the world have needed a reinstall.  It cannot be fixed. 

 

0 Kudos
stedwomas
Beginner
2,269 Views

thanks Jim and John , I am using WIndows 10

 

this is from help\about

stedwomas_0-1707843917888.png

and

stedwomas_1-1707843976516.png

The issue came out of the blue about 2 weeks ago. It may have been caused by an update , but completely unsure why i have the problem

0 Kudos
Reply