|
PowerBASIC Forums
![]() PowerBASIC Console Compiler
![]() PBCC 4 Error Handling (Page 1)
|
This topic is 3 pages long: 1 2 3 |
next newest topic | next oldest topic |
| Author | Topic: PBCC 4 Error Handling |
|
Ion Salius Member |
Programmers and customers of PowerBasic, Inc. have talked a lot about the error handling by PBCC. This forum is a good example. For example, I posted extensively here at the end of 2004 on the topic of PBCC error handling. I just received PBCC 4 and was anxious to put it to work. I compiled a production program, not the ‘Hello world’ type of programs that every compiler company (in the world!) uses to show the prowess of their products. The program ran well compiled with PBCC 2.11, 3.0, and 3.04. I recompiled it, without any change in code, with PBCC 4. The program compiled well and performed well. One might expect a penalty in performance when many new features are added to the language. There was no change in performance, as far as I can tell. My main curiosity and interest were directed at the (in)famous error handling of PBCC. After so many and intense debates, one would have hoped to see a final solution to error handling…errors by PBCC. Not! Non! Virtually the same incoherent and incorrect error handling. I caused several types of errors in the source code.
Curiously, the compiler did not care about the FOR/NEXT error!
OPEN FILE ERROR IGNORED BY THE COMPILER:
The debugger always jumps to the highest hierarchic loop, regardless of its nature. CONCLUSIONS I am NOT implying legal action against PB. I do appreciate the creations of the tiny team of computing enthusiasts. I have written hundreds of programs in PowerBasic. The programs perform well. They are also small in size. The small size made possible for me to distribute hundreds of programs over the Internet. Should I have used VB, the results would have been a herd of dinosaurs. VB adds automatically 1.5MG (yes, megabytes) even to a ‘Hello, world’ program! I am dissatisfied with the attitude of the PBasic guys! Not long ago, they tried to make believe that the way PBCC handled errors was a virtue, not a sin! Now, they dropped that claim. But they still don’t take fixing the error handling very seriously. It’s time for them to stop adding all kinds of garbage commands and statements to the compilERR (sic!) Instead, they must put every bit of their effort in fixing the debugger and error handling. They must offer a free fix to every programmer who bought PB compilers. The computing enthusiasts at PowerBasic Inc. owe that to their programming followers. That ‘Inc.’ is the most compelling reason!
IP: Logged |
|
Joe Byrne Member |
quote: Well, that's an interesting opinion but I'm willing to bet its in the minority here. I for one wouldn't complain about errors in my source code unless I had used the tools available to me to detect the error messages generated by the compiler. That's just my opinion, but having been a customer of PB for nearly 2 decades, I'm willing to bet most people believe the same. ------------------ IP: Logged |
|
José Roca Member |
There must be something more in the more than three thousand lines of code of the application, because this code gives error 451: FOR LOOP expected.
And this one error 459: NEXT expected
Regarding PRINT#, why don't use ON ERROR or TRY/CATCH? ------------------ IP: Logged |
|
Bob Zale Administrator |
Sounds to me like it's working precisely as one would expect. Thanks, Jose. Bob ------------------ IP: Logged |
|
Ion Salius Member |
The same childish attitude of cult following! 1) Yes, there is a LOT more than just one FOR/NEXT loop! They are deeply nested in SELECT CASE, IF/END IF blocks… Jose, why don’t you try to write a real program, something with one thousand more lines than ‘Hello, world’? 2) Here you distort the truth, just to make your parrot point:
It trips the compile error: 3) About your parrot suggestion of using ON ERROR. Some errors are not triggered by the compiler, even IF ON ERROR and/or DEBUG ERROR ON are enabled. The compiler simply doesn’t care about anything, sometimes! 4) As of TRY/CATCH, you parrot again one of Bitser Zale’s previous responses. “Tell us PRECISELY the erroneous statements, and we’ll help you.” If I had known PRECISELY the erroneous statements, would I have complained, o wise ones, o axiomatic sons of Logos and Axioma? Who could add TRY/CATCH verification to hundreds of loops and logical blocks? You, tropical parrot, would suggest immediately: “Add TRY/CATCH precisely to the blocks where the errors occur!” “Gracias, but no, thanks!” 4) I post in this strong manner because I want to help PB and help myself in the process. I intend to keep using PBCC. So, a real improvement in error handling by PBCC would be of much help to my programming endeavors. I do not go as far as asking PBCC to handle error the same way as VB. VB does it so greatly, that PBCC looks like the cave man. But when comparing the EXE performance, VB looks like the girly man! PBasic should look around. No serious compiler misbehaves so badly as PBCC regarding error handling. Every serious compiler points exactly the error, its type, and the line where it occurred. That’s a MUST for every compiler. PBCC disregards that compliance. Which makes PBCC’s slogan: It is a whole more than simply “put more of an ONUS on the programmer to write code that is BUG-FREE…”
IP: Logged |
|
Michael Mattias Member |
>Jose, why don’t you try to write a real program, something with one thousand more lines than ‘Hello, world’? Excuse me, sir, but the little ten-line snippet you posted seems to pass all the required edits and returning the correct compile-time errors. Since it is your "real program" which has a problem, let me suggest that perhaps you would get better-quality assistance if you posted the entire failing code along with your compiler name and version. IP: Logged |
|
Mike Doty Member |
------------------ [This message has been edited by Mike Doty (edited March 13, 2005).] IP: Logged |
|
José Roca Member |
quote: I'm not distorting anything. I have used the code that you have posted, with a few instructions added to be able to compile it. I don't know if some or hundred lines above you have a couple of For without Next.
quote: Sorry, but my doctor has forbidden me to write more than five lines a day.
quote: I don't add TRY/CATCH precisely to the blocks where the errors occur, I add them to the blocks where they CAN occur, and the code that deals with files is a very good candidate because even if the code is correct it can fail for other reasons. If we repeat the general advices for proper error trapping is not [This message has been edited by José Roca (edited March 13, 2005).] IP: Logged |
|
Borje Hagsten Member |
Insults like calling PB users and staff childish is to show disrespect to both us and the forum rules, which you have agreed to follow when registering for posting to these forums. Please respect the forum rules: "Profanity and rude or derogatory comments (about PowerBASIC or others) Also, if you have a specific complaint, please send a compilable example to ------------------ IP: Logged |
|
Adam J. Drake Member |
Ion, I really think you need to relax and take a deep breath. You are making accusations that the compiler is malfunctioning based on an a snippet of code that will error out, EVERY TIME. We can only make suggestions and offer help based on the code you post. You haven't even posted the snippet of code around the offending line:
quote:Error 447 in SUMS.BAS(1146:008): IF expected The compiler doesn't list every error it finds, it lists the first, and drops out if it encounters one. Is the for/next loop before or after line 1146? If so, it won't catch it until you correct error 447... ------------------ [This message has been edited by Adam J. Drake (edited March 13, 2005).] IP: Logged |
|
José Roca Member |
Write the following code:
Post only these lines:
Ask why it compiles and why x shows a "wrong" value of 21. Take the opportunity to show your bad manners. ------------------ IP: Logged |
|
Bob Zale Administrator |
Mr. Salius-- Your posted code shows absolutely no flaw in PowerBASIC Compilers. If you actually believe you have discovered a flaw, please send a specific example to support@powerbasic.com, or post the code here. So far, you have only shown that PowerBASIC compiles perfectly. I think it's fair to say that most everyone here sees right through your trolling. It's also fair to warn that you have repeatedly violated the rules of these forums. Your disparaging remarks (directed towards anyone) aren't welcome here. You must treat everyone with normal business respect. If you do that, we'll do our best to treat you in the same manner, and answer any question you may have. However, if you persist with antagonism, I'll need to take steps to stop it. Please don't force me to do that. Regards, Bob Zale ------------------ IP: Logged |
|
Joe Byrne Member |
"How to win friends and influence people" ![]() Ion, You're completely free to make suggestions for improvements, but if you notice that not too many people are agreeing with your stance, then don't get too upset to find your ideas have not been implemented. One of the criteria for changes come from the number of times a particular request is made. If only 3 people asked to have the color scheme of the IDE changed, there is not a very high likelyhood that Bob would change the color scheme. Know what I mean? And has already been mentioned, calling your fellow programmers here parrots is not going to endear you to too many. Just relax, accept the fact that you're in a minority in this case, and move on. ------------------ IP: Logged |
|
Donald Darden Member |
I would like to make a small suggestion. In very large programs, or programs that extend into many layers, it is often very difficult to keep track of what loops and conditional statements are still open, and which sequence they need to be closed out in. I find that putting multiple statements one a single line, separated So how does this relate? Well, if you use a source code So what I am saying is that the previous discussion is about A program that reformats the source code by indentation alignment
Note that the commented lines are move to the left edge and are Do maybe you should try using a program that reformats your Another point: PowerBasic is like a fancy sports car that is But you always have the option to turn on debugging features and ------------------ IP: Logged |
|
Jim Padgett Member |
When dealing with mainframes at work we have a saying... Smart and slow or Dumb and fast You get one or the other but not both.. Our original plant computer? My point ? You had to be sure you did not code where an error Code Complete is a good book that will teach us all about good programming ------------------ IP: Logged |
This topic is 3 pages long: 1 2 3 All times are EasternTime (US) | next newest topic | next oldest topic |
![]() |
|
Copyright © 1999-2005 PowerBASIC, Inc. All Rights Reserved.