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

go to the end of the line when using Visual Studio

Mike896
Beginner
3,357 Views

Hi

I use VS 2008.

Very often, when I press "End"(keyboard), it doesn't go to the end of the line. I mean it goes father than the real "end" (including many blanks).

What's wrong?

Mike

0 Kudos
13 Replies
onkelhotte
New Contributor II
3,357 Views
Quoting - Mike896

Hi

I use VS 2008.

Very often, when I press "End"(keyboard), it doesn't go to the end of the line. I mean it goes father than the real "end" (including many blanks).

What's wrong?

Mike


In VS2008 you have to select Edit -> Advanced -> View White Spaces (Ctrl+E,S), then you see, where you have blanks.

Markus

0 Kudos
Mike896
Beginner
3,357 Views
Quoting - onkelhotte


In VS2008 you have to select Edit -> Advanced -> View White Spaces (Ctrl+E,S), then you see, where you have blanks.

Markus

But why there are blanks at the end of the line? I didn't add them.

Mike

0 Kudos
Les_Neilson
Valued Contributor II
3,357 Views
Quoting - Mike896
But why there are blanks at the end of the line? I didn't add them.
Mike


Did the source come from another system?
Has it beenedited ouside of Visual Studio?
In which case it may be that some other editorhas "padded out" the lines.

Les

0 Kudos
Mike896
Beginner
3,357 Views
Quoting - Les Neilson


Did the source come from another system?
Has it beenedited ouside of Visual Studio?
In which case it may be that some other editorhas "padded out" the lines.

Les

No. I am sure that I write the whole program.

And also at first it ends without padded blanks.

Mike

0 Kudos
jimdempseyatthecove
Honored Contributor III
3,357 Views


VS IDE auto-indents the code depending on {} level and other factors (e.g. newline following if(expr))

Assume some level of indentation exists on a whitespace lines following some statement (e.g. open lines for visual clarity of statements). Then assume you position the cursor elsewhere, then come back with cursor at beginning of line (in front of white space). Now you start entering TAB or space to align code.

In VS you can turn on a highlight for whitespace. Or get into the habit of pressing END when you move the cursor.

Jim Dempsey

0 Kudos
Mike896
Beginner
3,357 Views


VS IDE auto-indents the code depending on {} level and other factors (e.g. newline following if(expr))

Assume some level of indentation exists on a whitespace lines following some statement (e.g. open lines for visual clarity of statements). Then assume you position the cursor elsewhere, then come back with cursor at beginning of line (in front of white space). Now you start entering TAB or space to align code.

In VS you can turn on a highlight for whitespace. Or get into the habit of pressing END when you move the cursor.

Jim Dempsey

I don't know if I know exactly what you say. I always use Home or End. When pressing End, I cannot go to the real "End" of line.

For example, parts of program are as following:

minl = MINLOC((/-7,2,-7,5/),dim=2) ! returns 1, first
! occurrence of minimum <===I hit return here and add the following line,
print *,minl <=== Press End here.
^ <==== cursor stop here

How to quickly move the cursor by keyboard to the real "End" of minl (I use CTRL-> CTRL<-, but no exact answer).

Mike

0 Kudos
jimdempseyatthecove
Honored Contributor III
3,357 Views

Could it be that you are using Fixed Line format (F77) and that the line is padded to 80 character position such that you can add a comment past column 80 should you so desire to do so. If your source file is of format FILENAM.F as opposed to FILENAME.F90 then the Visual Studion IDE may assume fixed line length and padd the line for you (as an unwanted favor).

Jim

0 Kudos
Mike896
Beginner
3,357 Views

Could it be that you are using Fixed Line format (F77) and that the line is padded to 80 character position such that you can add a comment past column 80 should you so desire to do so. If your source file is of format FILENAM.F as opposed to FILENAME.F90 then the Visual Studion IDE may assume fixed line length and padd the line for you (as an unwanted favor).

Jim

No. My filename is named as *.f90.

Now I'd like to know how to quickly move the cursor by keyboard to the real "End" of a line?

I use CTRL-> CTRL<-, but no correct answer.

I am wondering don't you or other user find this similar problem?

Mike

0 Kudos
Les_Neilson
Valued Contributor II
3,357 Views
Quoting - Mike896
No. My filename is named as *.f90.
Now I'd like to know how to quickly move the cursor by keyboard to the real "End" of a line?
I use CTRL-> CTRL<-, but no correct answer.
I am wondering don't you or other user find this similar problem?

Mike

Mike,
I have just triedCtrl-< and Ctrl-> and they didn't do anything in the IDE editor.
"End", "Home", "Ctrl-End" and "Ctrl-Home" did. "End" especially taking me to just after the last character on the line, which is what youare looking for."Ctrl-End" takes me to the end of the source file.
You say"End" is taking you to the end of a line with many blanks after the last non-blank character, even though when youtyped inthe line there were no blanks.I (and presumably others here) have not experiencedyour problem (except when I haveadded files which were originally created or edited outside of Visual Studio). If Edit->Advanced->View White Space is showingthat your lines have spaces at the end, then something has affected your source code;some settingmust becausing it.

But I have just searched the Tools->Options and other IDE settings but I can't see anything in there that would cause your problem. Maybe someone else will see it.
Sorry
Les
0 Kudos
Les_Neilson
Valued Contributor II
3,357 Views
Quoting - Les Neilson
But I have just searched the Tools->Options and other IDE settings but I can't see anything in there that would cause your problem. Maybe someone else will see it.


Mike,

I knew there was something in there, just couldnt see it (lack of coffee!)
It's a long shot but :
If you look at Project->Properties->Fortran->Language
If you have "Source File Format" set to fixed format (compiler option /fixed) AND "Pad Fixed Form Source Lines" set to "Yes" (compiler option /pad_source) then this would explain the behaviour you are getting.

Otherwise I am stumped as to what is causing it :-(

Les

0 Kudos
Steven_L_Intel1
Employee
3,357 Views

Les, those options affect the compiler's treatment of source lines and have no effect on the editor.

I just tried this and I found that for my sources, pressing End took me to the end of the line without trailing spaces. I wondered if the behavior might be different in Fortran and C++ sources, but it worked the same for me.

0 Kudos
davidspurr
Beginner
3,357 Views

FWIW, in VS2005PPE (& Fortran code), pressing End takes me to the end of a line including trailing spaces, if any.

By "if any", I mean those I have added incidentally due to copying lines or deleting earlier comments etc - only a small proportion of lines affect, so it is not a problem.

OT: Incidentally, how come the spell checker on this site does not like "Fortran"?

David

0 Kudos
Steven_L_Intel1
Employee
3,357 Views

Ah, the spell checker is a child of the 70s. As is Microsoft Word's. I'll get this fixed.

0 Kudos
Reply