View previous topic :: View next topic |
Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Tue Oct 08, 2019 1:11 am Post subject: |
|
|
The code
Code: | i = winio@ ('%^bt[OK]&',
'Exit') |
Gave error
Code: | *** Error 58: Unpaired right bracket(s) |
which is correct given just fixed right-left wording but more relevant error is missing continuation symbol & at the end of first line |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Tue Oct 08, 2019 7:36 am Post subject: |
|
|
Yes an "unpaired left bracket" report could occasionally be the result of a missing trailing ampersand. But would this rare mistake justify changing the report to "unpaired left bracket or missing trailing ampersand"? |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Tue Oct 08, 2019 8:19 pm Post subject: |
|
|
If there are 20 lines of continuation and 100 brackets in one line then sure yes |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Tue Oct 08, 2019 8:36 pm Post subject: |
|
|
Dan,
If you program in that style, then you should expect His Satanic Majesty to occupy that particular tract of the underworld.
Especially when you could, instead, write a single line 1000 characters long!!!
Eddie |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Tue Oct 08, 2019 11:10 pm Post subject: |
|
|
We see the trend that compilers become more and more capable and precise. So that we humans will be able continue to do more and more stupid things and not get caught.
The most crazy programming style i saw was HTML file 40 KB in size all written in one single line. I am still far from that |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Wed Oct 09, 2019 9:11 am Post subject: |
|
|
Paul,
Regarding "unpaired left bracket" report, I could imagine that gFortran would report the line of code and also place a "1" under that unpaired left bracket, not that I am familiar with this message in gFortran.
Could it be possible for FTN95 to provide an indicator of the position of the offending line of code and the position of this lonely bracket ?
For the case of Dan's 100's of continuation lines, it would also be important to identify the correct line of code. (Often the line number is the start of the continuation, rather than the line in the 100's of lines.)
The other related type of error that I have found confusing is when I omit an END IF or END DO in a multi-level IF or DO coding, the reporting is not always clear. Could the report identify the IF or DO level where the problem was identified or the range of lines associated with this DO or IF structure. (This could be identified by BOTH the line where the IF started and the line where it was identified it was not terminated.)
Often, I have coded with my informative (to me) indents, but they are not recognisable to the compiler. It becomes difficult to identify the mistake as the code looks clearly set out!
Could the .lis report annotate DO or IF by there start and end levels ? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Wed Oct 09, 2019 11:06 am Post subject: |
|
|
John
FTN95 starts by taking out all redundant white space so the column positions are not available when the error is reported. In theory the files could be revisited to do the matching but the information is not immediately available.. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Wed Oct 09, 2019 3:46 pm Post subject: |
|
|
Adding that will be great. I even did not miss enddo and still suffering in my damn spaghetti code which abruptly reached unmanageable state!
As to showing unmatched bracket additionally - adding that would be also very cool.
By the way I still did not find matching enddo in my source code I mentioned few days back. When I start searching for this enddo again, it hurts my brain quickly. That was the cost for not marking and commenting enddos for easy search done clearly in the hurry. Downloaded Notepad++ but it does not mark matching do/enddos, only if/endifs. Will try Plato next |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Wed Oct 09, 2019 11:39 pm Post subject: |
|
|
I use a text editor called EditPad (I have the Pro version). It has a way of looking at your FORTRAN code, highlighting keywords, matching parentheses across continuation lines, etc. I find it very useful.Personally, I'm bad about miscounting parens.
DO and END DO are in bold, making them easier to find. Same for SELECT CASE and END SELECT, as well as each CASE() construct, and others.
The editor itself has a lot of other features, like comparing two (or more) files for differences, making a selected region UPPERCASE, split screen in a file, two active copies of the editor, etc.
Worth a look at if, as I do, you spend a lot of time in the text editor!
https://www.editpadlite.com/ |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Thu Oct 10, 2019 4:19 pm Post subject: |
|
|
Dan,
I went all the way back to page 1 to see how you started the topic.
The best advice I can possibly give you is to shorten your WINIO@ format strings, and only have one format code that requires multiple parameters or a callback at a time.
Eddie |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Sun Oct 13, 2019 4:02 am Post subject: |
|
|
Thanks Bill and John,
I will look at all editors again to see what's changed during decade when I last time scanned all editors. Very important feature I need is to show matching IF/ELSE/ENDIF and matching DO/ENDDO. Just highlighting them is not enough, often there are 100s of Dos and ENDDOs to find where the hell are their heads and ends.
Another feature is to edit both Windows and LINUX/UNIX files without distorting UNIX files with WINDOWs style CR/LF.
Of course dual side by side windows view is a must when you simultaneously can edit two files.
I must is a pasteboard which automatically collects everything you saved before into clipboard. |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Sun Oct 13, 2019 3:22 pm Post subject: |
|
|
EditPad can handle both Windows and Linux style line terminations with ease! You can select which one you wish and have the preference saved for a specific file-extent if you wish. Since the "Light" version is free, you might give it a go! I love it! Does not do the Do/ENDDO, though. It's not that context sensitive! |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Sun Oct 13, 2019 3:49 pm Post subject: |
|
|
At the moment Plato does not show matching DO/ENDDO etc. but it does the other things including Copy/Paste, Spike (adding to the clipboard) and a clipboard ring that remembers the last 16 clips (Alt+V). |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Mon Oct 14, 2019 3:15 am Post subject: Re: |
|
|
wahorger wrote: | EditPad can handle both Windows and Linux style line terminations with ease! |
Notepad on Windows 10 now finally recognises both Windows and Linux/Unix style line terminations. It has been so annoying that this simple update took so long to be done. Unfortunately, I tried to copy notepad.exe from Win 10 to Win 8 but it did not work. It is a very simple and useful program and have found it so annoying when scanning Linux text file.
Also, have you seen the preview panel on Win 10 Explorer ? This can also be a useful additional feature, that I only recently found. (Has it been there for years ?)
John |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Mon Oct 14, 2019 1:16 pm Post subject: |
|
|
On the grounds that most Linux and Mac users are pretentious (include appropriate plural noun here), I have to be paid a lot to have anything to do with their outputs!
I use a nice little editor called PFE32 developed by a bloke at Lancaster University. Development of this little utility stopped 20 years ago, so it has a dated look and feel. Perhaps the best bit for me is the default font it uses - no, wait a minute, the 2 best bits are the font and the DOS window, or maybe 3 ...
I tried various text editors, and haven't found anything that suits me better.
Eddie |
|
Back to top |
|
 |
|