- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The automatic formatting in VS has a problem if there is a do statement in an if block. The following statements give an example:
if(RCA(M, Zi) .eq. 0) then
else
allocate (YPLOTA(P,RCA(M, Zi)), STAT = astat)
if(astat == 0) then
write(*,*)"Allocated matrix RCA(K,K)"
else
stop "Failed to allocate matrix RCA(K,K)"
end if
do 400 i = 1,51
if(zi .eq. Z(i)) then
YPLOTA(:,count) = X(:,i)
count = count + 1
endif
400 end do
YMAX = maxval(YPLOTA)
Line 17 and line 20 are incorrectly placed if you are following the intent of the algorithm for setting out the code. This is pulled from a few hundred lines, all the lines after 20 are incorrectly placed.
I do not know if there is a fix?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The numbers mess thing up, why have those at all?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that using the do numbering confuses the formatting between free format and fixed formatting.
When DO / END DO is used without numbers, the indentation normally works for me.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page