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

Visual Studio 2010 "Format Whole Document" command problem with WHERE...ELSE WHERE

andi_zuend
Beginner
1,402 Views

Hi,

I have recently installed the MS Visual Studio 2010 (including Intel Visual Fortran Compiler XE 12.1.3.300). I started to explore some of the new features regarding source code text editing, code outlining etc.

I found the commands to format the source code text of Fortran files "Format Whole Document" (Ctrl+K, Ctrl+D) command (> Edit > Advanced in MS VS 2010, when Fortran souce file is open). Trying this formatting options, I found that there is a problem with the indentation of WHERE...ELSE WHERE...END WHERE block statements. Apparently the "Format Whole Document" does not recognize correctly the ELSE WHERE (or ELSEWHERE) statement and indents it and everything that follows. It does not do that with a WHERE...END WHERE block without ELSE WHERE. This might also have to do with the "outlining" of block statements in VS 2010, since it appears as if the editor confuses the END clause corresponding to the opening WHERE, as shown in the attached screen shots. After formatting with "Format Whole Document", the outlining of some of the block statements is broken or incorrect.

Is this a known issue? Any ideas how to fix that?

Andi

---------------

MS Visual Studio 2010 / Intel Fortran Compiler XE versions and settings:
- Microsoft Visual Studio 2010, Version 10.0.40219.1 SP1Rel
- Intel Visual Fortran Composer XE 2011 Update 9 Integration for Microsoft Visual Studio* 2010, 12.1.3526.2010,

VS Options (Text Editor, Fortran):
Enable Outlining: True,
Outline Statement Blocks: True

TestVSTextFormatting.f90

0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,402 Views
I will let the developers know about this - it is not an issue I am familiar with. It would not be something you could fix on your own. Issue ID is DPD200181525.
0 Kudos
onkelhotte
New Contributor II
1,402 Views
This is a very nice feature, havent seen that yet. Very comfortable, because when you have code by different authors you can make it all look unique!

After trying this on some of my code I found one error and (for me) a "not so nice" behaviour:
- There is a compiler error because the "2." is divided into "2 ." (after.png)
- Could it be changed that code, that is splitted into different lines with a ampersand is tabbed one more? We use this a lot to make long formulas look easier (suggestion.png)

Markus
0 Kudos
Steven_L_Intel1
Employee
1,402 Views
The WHERE..ELSE WHERE problem is fixed for a release later this year.
0 Kudos
Reply