![]() |
|
Published 1999-02-01 Printer-friendly version
Well, well, well. Here we are a month into the new year, and what a month its been
Aargh. And that's being polite!
I've been wrestling with trying to import a file from a clients older CW 2.0 Dictionary file into a C5EE Dictionary so that I could write a new utility program for them.
My mission: To import a single file definition from one dictionary into another. Doesn't sound too tough, now does it? It wasn't in C4, etc. Just choose the option, choose the dictionary, pick the file and voila. Well, we are in the brave new world of C5 now, boys and girls
Started 'Multi-file Import'. Why? Well, I don't have an actual database file, just the DCT file, so the 'Import File' option is out. In any case, Multi-file Import fires up a wizard. I choose the Dictionary and file, then press Finish. After a LONG wait, up comes the Dictionary Synchronizer and can't press OK to import the file because it doesn't like some of the other files in the dictionary I am importing into. WHAT!?!? Who cares about those files? I just want to import one NEW file!! Press the button to take you to the first problem. *CRASH* C5 dies a grisly death. Start the whole process over. Finally get back to the Synchronizer (DON'T PRESS THAT BUTTON). Ok, so now I'll try and just tell it to ignore the things it doesn't like about the files that are already in my dictionary and which are working just fine in apps, thank you very much. I manually scroll to the first problem it doesn't like the validation range on a field. I tell it to ignore the file it ignores me. I tell it to ignore the field it ignores me. I tell it to ignore the ranges IT WORKS! Keep in mind, I shouldn't even be having to mess with this in the first place. Take a deep breath. Proceed to the second file. Ignore, ignore, ignore. I'm telling it to ignore the problems and it is ignoring my attempts to tell it to ignore. Try a few more times and then *CRASH*, down goes C5 (I kind of enjoy it by now "DIE, SPAWN OF EVIL!!").
Ok, I think, I'll try something completely different maybe Data Modeller will help me out. Fire it up, load this big old dictionary into it after exporting to a TXD. Look at the Tools and hey, there's an option for 'Create empty file'. Cool! I'll just create the file and import it directly into the dictionary.
Uh-uh. Tried that option and *CRASH*, up pops the old Norton Crash Guard. Down went everything after a few messages about invalid TXD or TXR(?) files. After taking a closer look, I could see that DM didn't even import the TXD file right (lopped off a bunch of fields from the end of the file and yes, the fields were in the TXD). Groan back to the Synchronizer. Lets do some cleanup first, though.
What were the problems in the files? In the first, 'Must be in numeric range' was selected, but the ranges were both zeros. Not exactly a show stopper, in my opinion, but I changed it to no validation. In the second case, the file had an Index that the Synchronizer insisted had the unique attribute turned on. Did it? Nope. Curiously, though, just going to the key in the dictionary and verifying that it wasn't seems to have fixed that problem.
Ok, started again with my squeaky clean dictionary. Click, click, wait, wait, finally back to the Synchronizer screen.
One final 'error' in the file I wanted to import. It had a field named 'Class' which the synchronizer regards as a syntax error. At least telling it to ignore that 'problem' worked, although it took a few tries to figure out where to tell it to ignore. For example, it was flagged at the lowest level under 'Field Name' (one of many Field properties). To get it un-flagged, though, required telling it to ignore two levels up the tree, at the 'Field' level.
Gloriosky!! The OK button is accessible! With great relief I click on it and wait and wait and wait hmmm, can I do something else while I wait? Nope, C5 has the machine utterly tied up. So I wait some more and what do I see? Up pops up a cute little message telling me "Cannot create dictionary from text file. ) expected".
So I press the "Just kill me now" button (otherwise known as the OK button) on the message, Synchronizer goes away, and I am returned to the dictionary editor. One itsy, bitsy, teensie, weensie problem here, though. ALL MY FILES ARE GONE!! I'm looking at an empty dictionary (I thought I pressed 'import', not obliterate!). Are we done yet? What do you think?
Press the 'Close' button on the Dictionary, fully intending to say no, no, a thousand times NO to the save your changes prompt, but it doesn't come up. The Dictionary Editor simply closes and saves the empty dictionary. Over my existing one. Stick a fork in me, cause I'm done now!
All I can say is that I am really, REALLY glad Clarion creates backup dictionary (BCT) files. Deleting the empty DCT and renaming the backup at least got me back to where I started, oh so long ago.
Ok, time for a bit of detective work. What caused the import error that wiped out my dictionary? Time to look in the temporary TXD file created by the Synchronizer that was being imported back to recreate the dictionary. (It will be the newest TXD in your working directory, and will have a name starting with TEMP.)
Got it the problem was the name attribute for a file. In wanting to browse a file earlier, I had stuck a ! in front of an actual path in the file properties so that it looked like this: "!/hmprog/data". I had forgotten to remove the exclamation, so it was trying to interpret the path as a variable name a variable name that contained invalid characters. Right. This one was my fault, so fixed that, whole thing works and the file definition was finally imported. Mind you, the file in question didnt have anything to do with the file I was trying to import, but at least I had a dictionary now. BUT do you think we are done yet? Bwa-ha-ha-ha-ha-ha!!!
Remember where I used the synchronizer ignore option for the field named Class? Well, I found out that it means really ignore it, because it dropped the class field entirely from the file definition. Yup the upshot was that the imported file definition didnt match the Clients actual file, so here come the Error 47 Invalid record declarations. Ill just add the field manually, I think. Uh, oh. The IDE refused to let me add it (illegal name errors).
So did I ever succeed? Hah! Whos smarter, me or this program? (Ok, ok, thats a debate well save for another Bit-vine!)
I finally ended up asking the client to send me a copy of the dang file and just used the import file option. It took one minute. It didnt gripe about the Class field. Program finished and delivered.
Let's see. When TopSpeed talked about 10x increases, I didn't think they were talking about the time it took to do something that was trivial in C4. Ah, well. A day in the life of an Angry Programmer
Well, as long as Im griping about the TopSpeed IDE, maybe Ill just take this opportunity to air another pet peeve of mine
Why, oh why, in 1999, the year of Pentium III, Xeon, AMD K6-3 and K-7 processors, does the stupid TopSpeed IDE still default to optimizing for the blasted brain-dead and long forgotten 80286 CPU? Does anyone even use one of those things anymore, much less use it for running Windows? Think about it -- How many fancy Clarion programs do you think are out there with that setting, either because the author forgot to set it initially, or (and this is the worst part), because the IDE seems to reset back it to 286 every time you edit the project.
I first asked about this three years ago at a DevCon Q and A session, and still havent gotten a good response (or, even better, a change!). Cmon guys, would it take more than a minute just to change the dang default setting to Pentium?
Grrrrrrrrrrr.
Have you accidentally opened a C4 dictionary in C5 yet? You will and youll find out that C5 has silently and automatically converted it so that C4 will no longer read it. Exporting it as a TXD from C5 and trying to import that into C4 doesnt work, either. Can you say "Eeeeeeek!!"?
This happened to me recently (can you tell this has been a good month for me?), but I did manage to resolve it by doing the following:
The key is that C5 adds that Usage(File) designator to each definition, since with C5 you can also have Global variables and/or a Field Pool in your dictionary along with your files. This new C5 attribute is the one that chokes the C4 TXD import routine, since it has no idea what usage means. By removing it, C4 can import the TXD file.
Note that this technique will only work on a dictionary that has merely been converted. If you have been actually working in the dictionary in C5 (adding globals, a field pool, deriving fields from others, etc.), youll have a lot more editing to do before the file will be acceptable to C4.
I really would like to suggest to TopSpeed that they offer you the choice to convert before embarking on these one way app and dictionary conversion journeys.
Ok, enough of the kvetching and whining!
Been working with the beta of compression specialists Linder Softwares new SFX Toolkit, and this puppy is going to be great! What does it do?
When used in conjunction with their LSPack compression libraries, it lets you create an installation package from directly within your program. For example, a client had a need to distribute file updates to reps at remote locations. We created an extract program, which takes data from the main files and reformats it for the remote programs to use. We had been using Linders LSZip libraries within the extract program to package the files, but that still left us with needing the remote workers to a) have WinZip or a similar program properly installed and configured, and b) have the skill to extract the files from the ZIP into the proper locations on their hard drives. For some of these people, thats asking for a whole lot more effort than they want to put out.
Enter the SFX Toolkit. I converted the extract program so that it created LSP files instead of Zip files. (LSP files are a proprietary Linder format used by their LSPack compression libraries.) Using exactly two (count em, two) SFX toolkit functions, I could now convert the archive file into a smart, self-extracting installer. It displays my welcome message, confirms the install location (which the developer can either force, suggest or let the user choose), and then extracts and places the files in the proper locations.
Way cool, and I can think of dozens of uses for it when it comes to distributing information via web sites, email or whatever. Future plans also include creating a version for the LSZip package as well.
Dave Harms, well known author and Team TopSpeed member has announced Clarion Magazine, a web based zine to be located at http://www.clarionmag.com. Check there for information on his premier issue, subscription costs, etc.
This means that, for the first time ever, the Clarion community will have not one magazine but two -- and in my opinion, thats a good thing! With what appears to be an expanding market, TopSpeed may just be poised to finally achieve a higher profile in world of Windows development systems, and having multiple sources of information helps to demonstrate that the platform is not only viable, but thriving. After all, how many VB mags are there (both print and electronic)?
Some people have asked me if the Clarion community will support two (or even one) magazine. I have to say that I can only believe that smart developers will recognize the value of having multiple sources of information, articles and viewpoints, and that the cost of subscriptions is really quite small for the value received.
Here are some tidbits and announcements gleaned from the TopSpeed forum and elsewhere over the last couple of weeks. If you see any products here that 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 or tools that 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 that 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 template), 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 jewel is:
Heres how NiceTouch describes it:
"Embed Assistant (EA) allows for the documentation and analysis of embedded application code. Through a template utility, EA imports filled embed text from your application into a TopSpeed database. The database may be searched and printed using EA's text searching functionality, complete with wildcard support."
Why are they giving it away?
"To inaugurate our first newsletter and to say thanks to Clarion developer community we are offering the Embed Assistant as a free download. Point your browsers to the NTS Clarion product page http://www.nicetouch.com/clarion and follow the Embed Assistant link."
Dont forget to say Thank you!.
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 is TomH@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: $184
(includes all back issues since '99)
Renewals from $134
Two years: $274
Renewals from $224