Home > database > The location of the PB how to get to the current code to run (line number, the method name)
The location of the PB how to get to the current code to run (line number, the method name)
Time:09-21
Often have users send me a system map, usually system appeared a hint, but in many cases we don't know what the hint is derived from a method, in which line of code, often looking for half a day to find the position of the tip. If it is a system level error, I know the answer can be found in the error object, but common tips, but no way of knowing the number of rows in the code to run and position, is there a way to get this information, thanks a lot.
CodePudding user response:
If it is XXXX. Exe illegal operation, memory XXXXXXXX is read-only, whether to report an error or something that Microsoft. Basically, you haven't had the chance, PB can fly out.
But most of the time, because the memory of crossing the line, pay attention to the external function calls, whether have enough memory.
If really can't find, can you write the log file test, remember to which line is wrong,
CodePudding user response:
Not mean what you say, the tips, is usually written in our code, such as more than at the time of preservation, prompt "quantity cannot be greater than the number XXX XXX", and then can't let the user to save, then the user will be sent to us, ask what is the row, this time we may help to check the tips from what position to come out, is a data errors or bugs. Now I just want to quickly learn that the tip's method and line number. You can quickly find the problem from the source.
CodePudding user response:
If this estimate oneself write a error message dictionary, each title in prompt box display error message ID, and then to find the corresponding code position,
CodePudding user response:
Method and line number can be obtained directly is impossible, at least I also thought, common practice to use global variables to save the current object name: window and data window object, where the PBL, and so on, if need be, triggered by specific shortcuts, for your purpose, the simplest method is to right-click on application, search you need to locate the prompt information, but be PB8.0 and above,
CodePudding user response:
Basic can achieve lz needs: String ls_script RunTimeError e Try If true then//judge where the problem by themselves, such as user input data error Throw e End the if The catch (RunTimeError lrte) Ls_script="OBJECT:" + lrte. ObjectName + "" + lrte. Class +" ~ n "+ & amp; "SCRIPT:" + lrte. RoutineName + "~ n" + & amp; "The line:" + string (lrte. Line) + "~ n" + & amp; "Number:" + string (lrte. Number) Messagebox (' error 'ls_script) The finally Messagebox (', 'FFF) End the try
Results:
OBJECT: w_main cb_10 SCRIPT: clicked The line: 7 Number: 2