Using a window – PB Docs 2017

Using a window

You can create a window that is similar to the Profiling tab on
the System Options dialog box and add it to any application that is
under development, so that you can start and stop tracing when testing
specific actions.

The w_starttrace window is available in the PB Code Profiler
sample in the PowerBuilder Code Samples at
https://www.appeon.com/developers/library/code-samples-for-pb. This
sample also shows the code used to create the profiling tools
described in Analyzing trace information using
profiling tools
.

The w_starttrace window lets you specify a trace file name,
label, and timer kind, as well as which activities you want to
trace:

trace02.gif

The following instance variables are defined for the
window:

The open event for the window sets some defaults:

The following code shows the script for the Clicked event of the
Start Trace button. The text for the button is set to Start Trace in
the painter. When the user clicks Start Trace, the button label
changes to Stop Trace. The Clicked event script checks the text on the
button before either starting or stopping tracing. This script uses
the functions described in Collecting trace
information using PowerScript functions
:

of_errmsg function

The window uses two functions to handle error messages. The
of_errmsg function displays a message box:

of_converterror function

The of_converterror function converts the ErrorReturn parameter
to a string:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x