What are the general debugging methods
What is a debugger for?
What is a debugger for?
As you develop and test your methods, it is important to be able to find and fix any errors they may contain.
There are different types of errors when programming: Typing errors, syntax or process errors, structure errors or logical errors and runtime errors.
The Method editor.They appear in red. A message appears in the area below the method window. The following window shows a highlighted typing error:
Note: The comments were added manually afterwards. 4D only changes the color where the error occurs.
Typos like this usually lead to syntax errors. The table name is unknown here. The error is described in the information area when you confirm the programming line.
In this case, correct the typing error and confirm the correction with the Enter key on the numeric keypad. Further information can be found in the manual 4D design mode.
Some errors are only found when executing the method. If there is a syntax error, the Syntax Error window is displayed. Example:
A table name was passed in this window for the Uppercase command, but the command expects an expression of the Text type. The "Details" area is expanded to show the most recent error and its number.
For example, there may not be enough memory to create an array or BLOB. Or you want to access a document on the hard drive that does not exist or has already been opened by another application.
These errors are not directly related to your programming; they occur because sometimes something is wrong. In most cases, such errors can be resolved with a debugging method that uses the ON ERR CALL command.
Such errors are generally hard to find — use the Debugger. To a certain extent, the types of errors described above - with the exception of typing errors - also fall under the heading of structural errors or logical errors. For example:
- A syntax error occurs if you try to use a variable that has not yet been initialized.
- A process error occurs when you try to open a document whose name is received from a subroutine that does not have the correct value in the parameter. Note that in this example, the code that breaks off may be different from the code that is causing the problem.
Structural errors or logical errors also include the following situations:
- A data record is not updated correctly because you did not check whether the data record is locked before calling SAVE RECORD.
- A method does not work correctly because you have not checked whether an optional parameter is present.
Errors can occur in application mode that you have never seen before in interpreted mode. Example:
This message says: "You are trying to access a character that is outside the defined length for the character string." To quickly find the cause of the problem, write down the method name and the line number, reopen the interpreted version of the structure file and go to the appropriate line in the method.
Mistakes are nothing out of the ordinary. It would be abnormal to write hundreds of lines of programming without any mistake. Finding and correcting errors is a completely normal process.
4D's multitasking capabilities allow you to edit and step through methods quickly as you can switch between windows. You don't have to go through all of the programming every time. Also the Debugger accelerates error management.
A typical early mistake is to click the Cancel button in the Syntax Errors window while troubleshooting, go back to the Method Editor, and scour the code to find what is wrong. Do not do that! You save a lot of time and energy when you always with the Debugger work.
- If an unexpected syntax error occurs, use the Debugger.
- If a process error occurs, use the Debugger.
- If any other type of error occurs, use the Debugger.
In 99% of the cases the delivers Debugger the exact information needed to understand why an error occurred. You can then use this information to rectify the error.
tip: Study and experiment with that for a few hours Debugger. In this way, you can save days and weeks in the future when searching for and correcting errors.
use this Debugger also for developing code. Sure, sometimes you write a rather large amount of code. No matter how precise you are, it is only when you run it that you can be absolutely sure that your code is working. Instead of letting it run blind, put the TRACE command at the beginning of your code. You can then do it step by step and see what happens. A purist may be against this method, but sometimes pragmatism pays off. Anyway ... use that Debugger.
use this Debugger.
Window syntax error
ON ERR CALL
Debugger keyboard shortcuts
4D programming language (4D v15.4)
4D programming language (4D v15)
4D programming language (4D v15.3)
4D programming language (4D v15.5)
4D programming language (4D v15.6)
- Who was the sun god Aten
- What causes teardrop infections
- What are family meals
- Who built the Airbnbs Android app
- How does ethanol react with nitric acid
- What does the calculus help to explain to scientists?
- If 63 36x 84 what is x
- Let's limit the range of the hotspot
- A business pregnancy test is exactly bought
- Overrated in America
- What is a multi-stage extraction
- Why isn't it illegal to cause emotional trauma?
- How has life changed until now
- How do you identify solvents in chemistry
- How do cycling teams work
- What are your little joys of life
- How can I improve my English efficiently
- How can I earn faster with YouTube
- When was Aden separated from India
- Is it possible to smooth teeth?
- Who are Taylor Swift's girlfriends
- Jenny Mccarthy is pregnant
- What should I do with oily skin?
- What are some bad smells in programming
- What's included in house blueprints
- What is the beauty and attraction of climbing
- What is your favorite AI algorithm
- Is a front-end developer creative
- What does a drunk psychopath look like
- Why is sucralose sweeter than sugar?
- How important is it to be heard from Mr Comeys' Congress
- What are the five pillars of Reiki
- Why is technology a good essay
- Why isn't Quora developing its user interface