![]() |
|
Published 1998-05-01 Printer-friendly version
Welcome to the May Bit-vine! Just a quick reminder to you all to send me your news, tips, tricks, cool web sites or anything else you want to share with the rest of the world!
For quite a while now, TopSpeed has been talking about a new top rung in the Clarion food chain - the Enterprise Edition (EE). (In case you didn't know, most all of us are currently using what is designated the Professional Edition.) Sightings of actual product, though, have been on par with Elvis sightings - lot's of rumors, but nothing you could put on stage and take picture of.
Well, I just got a glossy flyer advertising the availablity of the first public beta of EE, so it appears that EE may be getting a leg up on the original big E. No word of price, though, and very little hard info in the flyer either. To further the confusion, David Bayliss (TopSpeed UK, author of the compiler and architect of ABC) has been talking about C5EE in his CompuServe postings. C5? Yup.
Hopefully, TopSpeed will be making official announcements (or at least pronouncements) regarding EE at EuroDevCon in mid-May. Stay tuned for "As the Big EE Turns".
For EE beta program pricing info, call TopSpeed Sales at 1-800-354-5444.
Debugging. Yuck. What else can be said?
I have seen some interesting tips for debugging lately, though, and thought I'd share them with you.
We've all done this one a million times - sticking in a message() statement to let us know just what the program is doing. This works fine for simple problems, but there are cases where message is awkward or actually makes it harder to solve a problem.
For example, if you are looping through records and need to see what is happening at some point in each record's processing, you'll quickly wear out your mouse finger as message pops up over and over (and over and over...).
Even more insidious is the fact that message() can change the state of your program. Huh? Think about it. You are popping up another window - your window loses focus while the message is being displayed, threads are held up, things go modal, etc. If the problem you are trying to track down is dependent on a particular set of circumstances within your program, popping up a message() window may prevent the error from occuring. In this case, the program fails without the message, but works with it! Not very helpful, is it?
Granted, this second type of problem is rare, but according to Richard Chapman (TopSpeed Development Center), it can happen.
This tip is attributed to Team TopSpeed member Brian Staff and it works great for simple debugging. It is also very handy for testing when particular events occur.
Instead of using message(), try just putting your debug message into the title bar of your window. How? Well, let's say we are debugging some field validation code and want to test the value of a variable after the user has tabbed out of the field. Where you would normally put in code like this:
If FIL:Field <> TheRightValue
message('FIL:Field is ' & FIL:Field,'Debug Msg')
End
Try using something like this:
If FIL:Field <> TheRightValue
0{PROP:Text} = 'FIL:Field is ' & FIL:Field
End
If there is a problem, you'll see the message displayed in the title bar of the window. Your program flow is not interrupted, and you still get to see the information you need. What does the zero in "0{PROP:Text}" stand for? It just means 'use the current active window'. If you know the label of the window, e.g., 'ThisWindow' or just 'Window', that works exactly the same way. I just find the zero is quicker to type, and it works no matter what the template writer has labelled the window.
Another case where this works great is if you are testing something like drag and drop, where popping a message() box can interfere with the process itself. You can change the title bar all you want during those events, e.g., ' LeftMouse pressed on field', etc., without interrupting the actual function of the code.
This method was devised by Carl Barnes, another Team TopSpeed member.
It is a bit more work than the previous method, but it also offers several substantial benefits:
Basically, you just use the PUTINI() statement wherever you want to see what happened or would have used message(), etc. Here's a quick example:
LOOP Age = Now to Retire
blah..blah
PUTINI('Pass ' & Pass, | ! Sets the section
'Age ' & age, | ! The 'entry'
' Payment='& pmt & | ! The 'value' string
' int='&int & |
' blarg=' & blarg, |
'debug.log' ) ! The INI file to use
blah..blah
END
This might result in an INI file (named 'debug.log') which contains something like this:
[Pass 7] Age 30= Payment=34.50 int=8.75 blarg=77 Age 31= Payment=37.80 int=8.75 blarg=88
Note that in this case the 'entry' value needs to be unique. For example, if we had just called the entry 'Age', each time through the loop the 'Age' entry in the INI file would have been replaced with the new value (updated rather than added). By using a changing value with it (a loop counter, unique record ID, whatever), we ensure that new lines are added to the file. Other times you may simply want to replace the values from the last run.
Finally, notice how sections can be used to further divide up the information into meaningful chunks within the INI file. Read up on the PUTINI() function in the Clarion Language Reference Manual for exact syntax and more information.
Happy hunting!
Linder just announced version 2.0 of their LSP SFX Builder ($69 US). I have mentioned this product before, but let me stress again that this is a GREAT tool for building small single file installation files. Version two has a bunch of new features such as multi-volume support, passwords, encryption and a lot more. More info is available at http://www.lindersoftware.com. Oh, and if you already own LSP SFX Builder v1.x, this is a free upgrade.
Interestingly, I recently received a small product whose install was built with the TopSpeed Deployment Kit (TDK). Just for grins, I created an install of the same product using SFX Builder. There was a 10-1 difference in the final EXE size - SFX was around 111 KB vs 1.2 Megs for the TDK version. Yes, products like WISE or the TDK are better for large, complex installations which require a lot of choices or complex interaction, but in my opinion SFX Builder is the tool of choice for compact, good looking installs of simple products. If you need to create downloadable installation files, your users will thank you.
Here are some tidbits and announcements gleaned from the TopSpeed forum and elsewhere over the last month. If you see any products here which you would like to see scheduled for a full review in Clarion Online, let us know!
One of the really nice things about using Clarion is the overall generosity of the user community. (Go ahead, all of you give yourselves a pat on the back!) Often, this manifests itself in truly useful templates which the authors have made available to the rest of us for that most favorite of prices: FREE! Each month, this column features a handy free template or tool which you might want to add to your bag of Clarion tricks.
Note: If you decide to download and try out any free items mentioned here, please remember that you get what you pay for - don't expect support from the author like you would from a commercial product. While most of them are generous to a fault (as witnessed by their giving away the product), they are NOT obligated in any way, shape or form to you because you want to use the template. Be nice to them!
This month's cool tool is:
From their announcement: "This version is compatible with both CW20 and C4 environment. Keep that special code handy, then when needed, simply copy and paste. Keep track of any notes you might need for your application. And all from within Clarion Editor's Menu."
Since it is larger than our usual small free template, you will need to download the program from the Gitano web site (http://bizweb.lightspeed.net/~gitano) if you'd like to check it out. It comes in a very professional self-contained installation file.
While you are at their web site, they also have a nice collection of 50+ icons that you can download for free.
Note: If you are not familiar with Gitano's nifty G-Notes product, there was a review in the very first issue of Clarion Online.
Next month: Who knows? You'll just have to come back and find out!
Each month, this column will provide you with the latest in Clarion news, tips, rumors, freebies and basically anything else that seems interesting about the going's on in the Clarion world.
So, who determines what's most interesting? YOU DO!!
Are you a vendor? Let me know about new releases, updates, betas, product plans or anything else you think Clarion Online readers might want to know about.
Are you a user (and who isn't)? Drop me a line about any cool nuggets of information you come across, free templates or examples worth sharing, or anything else that other readers might find useful.
What do you get for contributing? Well, you'll see your name up in lights (phosphor, to be accurate) here in the Bit-vine credits. For especially useful bits, you may even win an autographed GIF of an official Clarion Online shirt or other similarly valuable prize. Come on, how can you resist?
Let me hear from you! The magic address isTomH@ClarionOnline.com
Everything in this column is the sole opinion of me, the author, and does not necessarily reflect the views of this magazine, its publisher, or even of myself (hey, I can change my mind, too!). Don't bet the farm on anything you read here: consider it a starting point for your own inquiries and research. The point here is that this column is intended to both enlighten and entertain, and that in the fast-moving world of software development this month's truth (or product release date) is often next month's "oops, did I say that...?".
'Nuff said!
Copyright © 1999-2008 by CoveComm Inc. All Rights Reserved. Reproduction in any form without the express written consent of CoveComm Inc., except as described in the subscription agreement, is prohibited.
Clarion Magazine ISSN 1718-9942
One year: $189
(includes all back issues since '99)
Renewals from $139
Two years: $289
Renewals from $239