Silverfrost Forums

Welcome to our forums

Curiocities

30 Mar 2015 4:22 #16048

The Generic utility that John Silver referred to has no bearing on the FTN95 error message regarding the colon. To see that, change the code of the loop to the following:

      DO  i = 1, NUMBlevsZ (izs)
        C_Sum = 0
        Do  j = 1, NUMBlevsZ (izs+1)
        C_Sum = C_Sum + Ct_Hull(j,i,IZSp1) (RELAB(IZSp1,iii)+1e-7)
        enddo
      enddo

I have simplified the expression, and shortened the variable names, so no continuation line is needed and there is no line that is longer than 72 characters. However, as in Dan's example code, wherein tab expansion moved the '/' operator to a position beyond column 72, I have left out the '/' operator that should have been present between the adjacent parentheses.

The compiler again gives the error message involving the mysterious colon. This is simply another instance of a compiler not quite giving a clear diagnosis when the input code is in error, and I do not think that we should complain loudly in such instances.

30 Mar 2015 10:44 #16050

Dan, I downloaded your file defect.for and listed it with my utility to expose control characters. It lists as: [31] integer NUMBlevsZ (100)<CR><LF> [36] real4 RELABex (100,100,100)<CR><LF> [36] real4 Ct_Hull (100,100,100)<CR><LF> [ 1] <CR><LF> [27] <HT>DO i = 1, NUMBlevsZ (izs)<CR><LF> [16] <HT> Ctbr_Sum = 0<CR><LF> [31] <HT> Do j = 1, NUMBlevsZ (izs+1)<CR><LF> [66] <HT> Ctbr_Sum = Ctbr_Sum + RELABex(j,IZSp1,III)* Ct_Hull(j,i,IZSp1)/<CR><LF> [39] * (RELABexSUM(IZSp1,iii)+1.e-7)<CR><LF> [ 8] <HT> enddo<CR><LF> [ 6] <HT>enddo<CR><LF> [ 4] <HT>end

If I replace all <HT> with 8 spaces, I get integer NUMBlevsZ (100) real4 RELABex (100,100,100) real4 Ct_Hull (100,100,100)

        DO  i = 1, NUMBlevsZ (izs)
           Ctbr_Sum = 0
          Do  j = 1, NUMBlevsZ (izs+1)
          Ctbr_Sum = Ctbr_Sum + RELABex(j,IZSp1,III)* Ct_Hull(j,i,IZSp1)/
     *    (RELABexSUM(IZSp1,iii)+1.e-7)
          enddo
        enddo
        end

Note that the / on line 8 is in column 73 so the expanded line 8 really looks like Ctbr_Sum = Ctbr_Sum + RELABex(j,IZSp1,III)* Ct_Hull(j,i,IZSp1) * (RELABexSUM(IZSp1,iii)+1.e-7)

Including compile option /WIDE removes the error message, confirming the interpretation of <HT> replacement. I tried the compile option /no_truncate but the colon error was again reported.

The devilry is in the 'hidden' code, those dastardly tabs

John

30 Mar 2015 11:51 #16051

Eddie,

From memory the 029 was much preferred to the 026, as it had more capabilities. I just can't remember what those capabilities were !

Just about every day, I would catch the bus to uni, go to the physics building, pick up the overnight run, go to the card punch room in the basement and look to see if there were any 029 desks free. It almost never happened ! Always too late. Never a thought about indenting do loops in those days, just hoping there were no typing errors, or another day lost.

Back to tabs; there are two possible interpretations. FTN95 appears to replace the tab with 8 spaces, while other interpretations move the next character to the size 8 grid or what ever the spacing is. I just tried notepad, which has the grid approach, but the column count in the status bar does not agree.

Further, I opened Dan's defect.for in PLATO and it does not display the tabs in a way that FTN95 interprets. This is a problem ?

John

31 Mar 2015 9:39 #16056

You are right, guys, this / is in column 73. But how this happened? I checked that twice and saw it at reliably below of that (and i always care about that limit with the eagle eye) ? Don't understand that...Still a damn devilry. I feel bad like aging Dersu Uzala when he for first time missed his bullet into Siberian tiger.

31 Mar 2015 10:53 #16058

Quoted from DanRRight You are right, guys, this / is in column 73. But how this happened? I checked that twice and saw it at reliably below of that (and i always care about that limit with the eagle eye) ? That depends on how you did the checking. If you used a text editor or used the TYPE <filename> at the console, the transformation of tabs done by the editor or CMD would have probably been different from the transformation that FTN95 applies, so your eagle eye could have been viewing the code through grandma's glasses.

Since your code-base is large, you need to use a more reliable system to check your source code than relying upon mere visual checking of small samples of the code. Obtaining/building filters to do the checking is quite easy, but you need to summon the will and take the initiative.

I think that the design decision to have FTN95 treat a tab as equivalent to eight spaces is regrettable. It would have been better if FTN95 rejected tabs completely instead of applying an interpretation that is different from the interpretations given by other Fortran compilers that allow tabs in source input, and different from the well-known response of typewriters, teletypes and line printers to tab keys/characters. The FTN95 interpretation of tabs is not even consistent with Plato's treatment of tabs, and it is impossible to check by viewing in Plato whether a source file with tabs goes beyond column 72/132.

31 Mar 2015 12:25 #16059

Mecej4 - We discussed here limit checking few times before, both 72 and 132.

  1. First my shield is editor, it shows cursor position, there is no discrepancy between editor and FTN95
  2. i made 73 character barrier width of editor for fixed code and larger for 132 one as it has two panels each for different types of sources. But recently i had desktop shuffling and probably changed the sizes
  3. i periodically use built into the code source limit checking subprogram i wrote hell decades ago. Basically the code checks itself. Seems I have to make it working automatically every hour by default
  4. i strongly advocated for the use of /no_truncate compiler option as default but it was buggy few times and only recently fixed as Paul reported. If this option worked fine this thread would not exist! No tab hatred would be here either. I have nothing against of use of tabs.

That was why i was so sure that this was some kind of devilry because i believed in all my not breakable shields and setups not in the compiler diagnostics.

31 Mar 2015 12:53 #16060

Which editor do you use?

31 Mar 2015 12:57 #16061

NoteTab

(awards from PC Magazine, PC World and WUGNET, 3 times Shareware Industry Awards)

31 Mar 2015 1:46 #16062

I did not know about this editor. I downloaded a trial version, opened your file defect.for in it, set the tab size to 8 ( to match FTN95 ) and tab type to 'fixed'. The slash in line-8 was shown in column 73. This is as things should be, but without a visual aid it can be hard to look for that specific column. Other editors show a dotted line at a specified right margin (such as column 72). Perhaps Notetab can do so, too, but I have not found the menu to make that setting effective.

If you are going to rely on your source checker, perhaps you should investigate why it failed in this rather simple case.

31 Mar 2015 2:30 #16063

I personally use SPFLite as my source editor. If you have some experience with ISPF or have to edit a lot of old fixed format source files, then its a great tool.

On SPFLite, the visual column markers could be defined, but you could also type a command:

EX ALL; F P'=' 73 132

This would hide all the lines in the source file and then show only the lines that have something between columns 73-132.

31 Mar 2015 11:29 #16065

Mecej4, The ultimate right way to handle this type of errors is via compiler only with /no_truncate. Other ways as we all see in my case fail because rely on faulty human psychology. But visual aid definitely a must in editor. In Notetab you have to open second window and scale both panel sizes +1 pixel to the limit. You will see that you touch the margin if you at 73+. I did not notice violation because started using touchscreen recently and make a lot of mistakes in moving and resizing windows with too fat fingers for the 13.3' screen when I remotely control my main computer. Another reason was my arrogance that this kind of errors is unlikely with all my shields. Third was that I actually remember that I checked the limit and the number was around 72 which again and again is ... a devilry LOL. Well, ok, my last reasonable explanation is that in the permanent hurry and very late night I looked at the working file instead of faulty because made few of them when experimented.

There exist few more levels of explanation - aging, for example. Or stress factor. Both became interesting to me. I permanently lose my cellphone, keys, wallet and glasses. Fun is that though I carelessly drop them easily everywhere (these are just few common places though), i can not believe that they are found then with big difficulty and often a lot of swearing typically not in these common places. OK I bought literally 100 glasses. Added police siren into cellphone activated even if it on silence. But still i often lose and couldnt easily find other things.

All my life I make tons of programming errors and thanks to FTN77 and then FTN95 easily find them. Compared to all my colleagues I more became a damn professional bug hunter. LOL. Even more, these skills developed by this compiler push to find errors, lies, tricks everywhere in the life, politics, art, religions... But inability to find the damn wallet or keys literally explodes me. So psychology of this started to be interesting as it may be related to the error I made in this thread. And few others I couldn't easily find. Or could it be more related to psychiatry? 😃. I'm damn serious. How many times I mentioned Altzheimer? Or super-arrogance? I don't hear about similar symptoms from older programmers.

1 Apr 2015 6:52 #16066

The following example still produces error 612 real*4 Ct_Hull (100,100,100) integer i,j,k, iii real Ctbr_Sum

        Ctbr_Sum = Ct_Hull(j,i,k)(iii)
        end

It appears there is a problem suspected with an array section ?

1 Apr 2015 7:26 #16067

I have logged this for investigation.

1 Apr 2015 11:03 (Edited: 1 Apr 2015 12:31) #16069

John-Silver, Thanks for the nice link! In one single post you found me 7 billion of different degree colleagues by insanity 😃

Paul, Does fixed /no_truncate find this error (my 7.10 does not)?

1 Apr 2015 11:32 #16070

Dan, I felt that 'over confident' or 'too trusting' would have been more apt than 'arrogant' in describing your outlook. And, as someone famous (Mark Twain) said, the issue is well described by 'It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so'.

To compensate for the forgetfulness that comes with age, one can follow the principle of 'Trust but Verify' and develop a set of checks and redundancies in one's activities, whether that is about finding keys or exceeding the 72-character limit in fixed format Fortran. After a couple of years, you may be pleasantly surprised to find that you are using these redundant checks less and less, and even old dogs can learn to do old tricks better. See http://www.brainyquote.com/quotes/quotes/d/davidmamet478663.html . One more link on finding keys: https://www.youtube.com/watch?v=j8e-X15JuCc .

1 Apr 2015 12:09 #16071

Mecej4, Will think about this, thank you very much for suggestions. And for song! Great i'm not alone. You guys made my day... well... night ...again.

But...Meantime what definitely i have to do ASAP is to stop my workaholic addictive behavior. I found that i lose more time fixing and rewriting stuff later if i'm not in perfect shape, sleepy, tired etc when do programming.

Another is vision. It is very important to have great screen. Amount of information on screen is increasing, fonts decreasing, vision deteriorating, amount of typos skyrocketing.

I plan to change my 2- or 3-monitor setup to 52' 4k monitor for which i think to take latest 4k TV with HDMI 2.0 or Displayport and IPS matrix. That is the size some people recommend for greater productivity, not 27, not 32, not 35 or 40 but >50'. I used before 62' screen and found it very pleasant - as to me i will not need to use tricky value very hard to find (+0.5) large size frameless reading glasses then. 50' monitor is OK, they became cheap. But it's kind of stupid to buy today 60-70' 4K TV for being a monitor and to be also a TV because 4K TV needs to be more then 85' in any even small size rooms to see its resolution advantage. Curved screens give additional 10' in angular dimension but all that large size gear did not drop to reasonable prices yet. Any suggestions here, guys? All, don't hesitate to share your productivity tricks and thoughts!

1 Apr 2015 12:43 #16073

Dan

Version 7.2 is now available for you to try.

1 Apr 2015 1:35 #16077

Paul, Link says it's still 7.10

1 Apr 2015 6:15 #16078

Have you downloaded the new version available from yesterday? If so, are you sure that you are actually using the new version?

2 Apr 2015 1:13 #16081

Note at the end, that it is still a devilry until one finds how this is possible that *** I did not fix the error*** (because obviously I did not know what it was till the page 3 of this thread) but as I wrote the source code somehow fixed itself.

Decently though there exist some small chance, which I do not remember, that trying to resolve abrupt crazy problem appeared from nowhere in the middle of the night, angry, I tried everything and pushed Ctrl+Z to undo this spurious space symbol which might land into editor

Please login to reply.