Dear All, I would like to ask you the debugger function and its purposes, please let me know every fields usage inside the debugger if it set active. rgds, Mark
The debugger is a great tool to see active fields/tables in the current program. Meaning if it calls 5 functions, the system will display all fields/tables/variables/keys/filters etc, currently being executed. Remember, to learn how to use F8, F9, F5 etc. Marking a line of code to tell the system where to stop, this will save you at looking at hundreds in not thousands of coding lines Navision goes through. When the field or coding has not be processed or in the active stage of being processed, the system will mark it as In-ACTIVE.
Dear GFuentes, Tks a lot for your reply. Does debugger give me a solution and a way to correct the error if I find error when running some granules in Navision ? I actually can’t still understand if I can utilise it maximal. rgds, Mark
No, it won’t give you a solution, you will have to figure that out yourself. The debugger helps you understand, what is going on with giving you information about the values of Records and Variables, that you use, and the order your code executes. There is also a little trick, that let’s you see, where you hit an error: turn the debugger on, but do not put the checkmark by the “breakpoint on triggers”. Usually, the program stops exactly, where the error occurs, and then you have a starting point for checking what’s wrong.
An error doesn’t have to be ‘wrong’. The debugger just tells you exactly what code is executed. It is up to you to figure out if it’s the correct thing and if it isn’t what to do about it. The debugger only takes you through the code one line at a time.
Dear All, I have understood about the using of debugger, I thought it can give a solution to an erronous problem. but I will try to dig more deep inside it.tks a lot for your explanation rgds, Mark
Mark, I once met a programmer that developed Navision code that had no bugs. When I asked him how he managed this, he looked at me as though I was a real beginner, and explained that Navision has a built in tool to ensure there are no bugs in the code you write. You just press F11, and it tells you if your code is big free [:D] Basically the phrase “Debugger” is a little silly.In reallity, and degugger is just a tool that letsw you run step by step through your code and at each step, you can stop and look at what has happened to the variables and thus possibly find a bug in your code, that otherwise was too hard to find at full speed. In the old DOS days, Navision had a gret debugger, a very usefull tool, but it vanished about 10 years ago, and only recently (3.70) came back, so after ten years of no debbugger, you find other ways to solve issues. In reality the best way to debugg code, is to have a good design written out beforehand that gives you a guide line of what you are trying to achive. Then define clear test cases that show what results are to be expected for what user input. Then it will make it easier to develop code with the minumum number of bugs.
Dear David, Tks a lot for your answer and good “story”. I am very happy because my question is solved now. I have tried to press F11 for what I have made change in all codeunits in Navision, and it works good. Tks also for your suggestion. I wonder if I always answer “yes” for a question asks when closing form designer and table after made some changes and there is a check in field “compiled”, isn’t it same as press F11 ? Rgds, Mark
Sorry Mark, maybe you missunderstood. F11 just compiles the object, it does not find bugs in code. That was the point. The thing that is important, is to have a well defined dtest case for the mods you are making. That way, whent he code is complete, you run though the test cases, and find exceptoins. You relate these back tpo your original design, and then see where the exception is occuring. Debugger is most usefull, when the code is not ating as you expect it to, and you need to find what you did wrong, like not initializing a variable, or having locals and globals witht he same name etc.
The term ‘Compiled’ does NOT mean ‘your code will run correctly’. All that the compiler does is check for syntax errors, and if there are actual variables declared for the variable names that you use in code, things like that. It does not check the validity of your code. You can for instance program a divide by zero and the compiler will be happy. You better get used to it, the bugs in code are there because the developer put them in there, and it is up to the developer to figure out how to get rid of them. There is NO SUCH THING as a computer telling you how to solve a code problem. All that any ‘smart compiler’ could do is make suggestions based on certain parameters. In Navision? No way [^]…
Dear All, Tks a lot for your answers. but I wonder if I always answer “yes” for a question asks when closing form designer and table after made some changes and there is a check in field “compiled”, isn’t it same as press F11 ? I know Navision is not a bug free but I understand half why programmer put bugs, because they have strength assurance that it won’t give a bad threat / error when running Navision in some parts that doesn’t relate to the bug, do you agree with this ? Rgds, Mark
A bug inside a software is just a piece of code which does not do what it is supposed to do. Nope. A program always follows the code, so a bug is a piece of code which does not do what the programmer wants it to do. That makes it clearer. Anyway. The most common reason for a bug is that the programemr does not take ALL circumstances into account when developing. As far as I’m able to develope a debugger which can find a solution for a problem, I can also write a program which writes bug-free Navision code. But I don’t like that because of some reasons: 1st. This forum would be useless 2nd. All of us would be unemployed.
Dear Thomas, All, tks a lot for your all replies. Thomas wrote:
As far as I’m able to develope a debugger which can find a solution for a problem, I can also write a program which writes bug-free Navision code. But I don’t like that because of some reasons: 1st. This forum would be useless 2nd. All of us would be unemployed.
In your side, I agree with you and it’s no problem for that, but don’t say this forum would be useless, someone will not ask you to develop a debugger, it’s impossible because time consuming for that, someone only maybe ask for a hint. Rgds, Mark