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

CodePudding user response:

reference 5 floor xys_777 reply:
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 "...


This way is too much trouble, I have not every location of the code will be changed again? Did not need to change the original code can be easy to get to?

CodePudding user response:

Don't change the code is not possible, can write a function, fifth floor the code every time error adjust it with respect to OK

CodePudding user response:

Problem is that you first write all of the program, and then consider the design of architecture, is bound to be trouble, if your relationship is very good, it may change is not too much trouble,

CodePudding user response:

So you can see the importance of good design

CodePudding user response:

refer to 6th floor SMZDG response:
reference 5 floor xys_777 reply:
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 + "...


If simple figure

Export all code to be *. The SR *.//this is a text file

Another. Write a program to find all MESSAGEBOX, the first parameter (title) with a unique serial number, after the modification to import.

Such as the original messagebox (' information ', 'because... Unable to save ')

Changed to a messagebox (' information '+ "# # 23,"' because... Unable to save ')

This work won't take you to half a day.

CodePudding user response:

Don't need so complicated, PB object error, this object has many properties you use enough,
Directly in the event of an APPLICATION of sysError capture, a place to write,

CodePudding user response:

The PFC

CodePudding user response:

General is inside the application object syserror event record error log

CodePudding user response:

You will change little by little.
Your prompt, you should know what the problem is.

CodePudding user response:

Brother living power

CodePudding user response:

Agreed to the 11 floor, in the application of sysError event capture the Error object attributes.
Error. The number
Error. Windowmenu
Error. The object
Error. Objectevent
Error. The line

CodePudding user response:

Find yourself writing errors, the easiest way to the upstairs said, right click on the application, search, PB8.0 above, if the program is not more than 8.0, and that a 8.0 or 9.0, set up a workspace - & gt; Application, all the PBL to join the library list, you can search, I used to do with 6.5 time, woo hoo

CodePudding user response:

Try
Catch

CodePudding user response:

In the study

CodePudding user response:

11 floor is right,,,, it is better to own,,,

CodePudding user response:

Several top 11 floor upstairs seemingly did not see the host's questions, and they say it's not the system error, not trigger SYSERRor the event!
10th floor method is more simple and practical,

CodePudding user response:

Can use populateerror ()
Can work: to application custom Error number and Error information filling Error object, the function does not trigger the application object SystemError events,

Language: PopulateError (number, text)

And count: number: an integer type, specify to save the number attribute values in the Error object;

Text: string type, specify to save to the Error object text attribute values,

Return values: an Integer, the function returns 1 on success, an error occurs when the return 1,

Use method: when the application needs to custom Error according to the current value of the variable object, you can use PopulateError () function to fill the number of the Error object and text attributes, at the same time, the function, automatic filling and Error according to the context object properties,

Custom Error object, an application can use with no arguments SignalError SystemError event () function to trigger the application object, in this way, in the event handler SystemError event to deal with the custom Error and system Error writing custom code, if the application does not write the SystemError event event handlers, then SignalError () function is doing nothing,
Pass SystemError event so that you can get want detailed information, can also modify prompt error message and fixed the error code, combined with the upstairs said only marking can be derived in the text to this code, and in the event of an SystemError, don't know this whether feasible,

CodePudding user response:

Release of the PB selected Error Context information

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related