This
template makes the debug, implementation and support of Clarion for Windows
applicacions easy and better, allowing to easily find the conflict points with
excellent results without the use of the complex debuger or the arcaic, poor and
dangerous technique of the use of the MESSAGE()
or SETCLIPBOARD() finctions.
TraceIt
Template
For Clarion6 and C55, Legacy and ABC)
Now for Clarion 7.2 and
NetTalk web Server 5 !
This
template makes the debug, implementation and support of Clarion for Windows
applicacions easy and better, allowing to easily find the conflict points with
excellent results without the use of the complex debuger or the arcaic, poor and
dangerous technique of the use of the MESSAGE()
or SETCLIPBOARD() finctions.
Adding a few
lines of code, you can radically change the way you debug and support your
software.
Have you ever:
Added a MESSAGE or a SETCLIPBOARD to your app to trace some value, or some
script and when you solve the problem have to go back to delete it?, or worst...
forgot to delete it before sending it to the user?
Needed to
trace a report and could not use Stop or Message?
Had problems by following a complex variable calculation?
or some user
calls because he cannot pass trough a security door and nobody knows which is the door involved?
Needed to
trace which Query is supposed to be sent to a Sql Backend?
All that,
and more, can be solved using this template.
You can:
Add tracing code no needing to go back to delete it and
recompile.
Easily find report logic errors, wher you cant use MESSAGE() o
STOP(). Trace Sql queries
sent to the server without the need of a profiler.
Define types of trace messages and its properties.
Define its colors and indent.
Copy to the clipboard the trace message automátically.
Trace the text of all messages box showed to the user and the response button.
And, at runtime: Trace your app at your client home, with his
database!
Verify why some control is disable or hide.
Follow the calc flow of a variable.
Find why a user cant pass trought a system door
Copy a Sql script at runtime to carry it to the Query Analizer to test and debug
it.
Program Stop points to copy messages to the clipboard.
Program Halt point inside loops that you dont know why they are not breaking
Your user can activate the trace, reproduce the steps that are not runnig as
desire and send you the trace containing all the messages including the text of
the message box and respose buttons.
No more
typing and deleting Messages and Setclipboards, from
now on, you take an advantage of all this typing keeping it in your application
and seen it when you need to.
No more
problems when needing to understand what’s going on with a user request.
How to use it:
Add the ARMiTraceIt Global Template to
all the apps you need to trace. If you are working with a mulit
DLL you will need to add the template first in the data DLL.
In the
General tab choose the Window Language, if you need
other than English/Spanish/French or Portugues choose Other and translate
the Windows editing the ARMi_TraceIt.ini and copy it to the exe directory.
Declare the
messages Types to trace, these type defines the way the message is traced and
allow them to be filtered.
Lets asume we want
to trace a message to know what happen inside our check door procedure, then
declare a trace type called Doors with Code D, and, suppouse we need to trace some sql queries,
those really complex belonging from complex filters an user options, then we add
another trace type with the Q code:
Description: Doors
Code: P
Color: color:red Indent: 3
SetClipboard: No
Or, in
places where you need to trace a sql query you can
type:
Trace( ‘Reading
clients total with : ‘ & MiQuery , ‘Q’ )
you will trace that
messages at real time if you have the Trace Window active, that window is SDI to
allow you to drag it outside the app window.
To call the
Trace Window, normally from a menu item or an alert key on the frame, simply add
START(wTrace)
The trace
Windows willlooklike:
This window and its
messages can be translated to English, Spanish, French or Portugues automátically
or you can translate it trhough the ini file: ARMi_TraceIt.ini
While you
are tracing, if the type have the Setclipboard
property cheked then you will se the following
Windows.
At this
moment, befote clicking OK, you have to paste the
clipboard to save the Query.
Copy to Clipboard:Using or
not the Setclipboard property, the query will be
traced in the window, if the message is larger than the 255 chars of the list
row, it will be split in as many rows as needed. Then you can use the setclipbord button, paste it to where you need and
rearrange the query.
Draft Messages: If you send messages
omitting the Code like:
Trace('This is a
draft message')
it will be treate as
a draft message, those which we type "urgently" to see a variable value and we
will not remember in the future even why we type this trace :-), this type of
message are normally hide in the trace window but you can unhide them with a
window check.
Search: in any row from the row you are
selected down, the >>> button searchs for the
next instance.
Trace the Proc Name at Init and Kill:As you can
see in the trace Windows below, there are two messages like:
To do this automatically,
just check the Trace all proc/app names at Init and Kill.
Menu
option trace: This is added automátically to
all frames with a menu, you will trace message like:
---> Menu: Invoices
Message
Box Trace:
The trace window has its own message box, then
it can trace the text messages and the button that the user clicks.
Special
Types: TraceIt use some special trace types to
log its automatics messages and functions, all begining with an #, these are: #P
: Init, Kill, Menu options, MessageBox text and responses (these messages
responds to the Hide specials check.
#MH : Message Halt, this type allows you to log the message an show amessage box
allowing to halt or continue, this is usefull to log whats happend inside a loop
that is not breaking.
Copy to File: You can even define
the name of the ASCII file to dump the traced messages, type it like a string,
between single quotes or type a variable name.
Code Template: You already
have a simple Code Template to help the message trace typing:
The Setclipboard check overrrides the
Trace Type definition.
We include too:
Enable Procedure Identification Window Template
Which enables you to identify Proc and App of a Window without using the
TraceIt Template, just typing a Key.
Demo:
How to Install:
The installer detects automatically your Clarion versions and allow you to
install to the apropiate clarion directory, in the following subdirectories: Templates, Examples
and Bin
The installer can register the templates for you or you can register ARMi_TraceIt.tpl (ABC) o
ARMi_TraceItCw.tpl (Legacy) later manually.
Nettalk web server tips:
In the Webserver proc window, add a button and type in
its embed START(wTrace) With this button you will begin to trace. To trace GetSessionValues,
add a Trace type with Description GSV, Code GSV and in the WebHandler proc:
at the p_web.GetSessionValue PROCEDURE(string p_Name), after the parent call add: if p_name<>'' then Trace('GSV: '&p_Name&'='&ReturnValue,'GSV')
end To trace SetSessionValues,
add a Trace type with Description SSV, Code SSV and in the WebHandler proc.
at the p_web.SetSessionValue PROCEDURE(string p_Name,STRING p_Value), before the
parent call add: if p_name<>'' then Trace('SSV: '&p_Name&'='&p_Value,'SSV')
end To verify the browses filters add after the Setfilter
embed: Trace(loc:filterwas)
Future enhacements: Trace to a TXT file instead of a memory queue.
Trace to TPS & SQL allowing to define the fields to fill.
Trace in silent mode, without showing the trace window.