====================================== FoxPro Developers Network of San Diego ====================================== FoxDev TipsLetter #00-03 February 24, 2000 Website: Editor: ---------------------------------------------------------------------- CONTENTS: * Calendar * Tech Tips: Optimizing SQL Ed Leafe A Note on Resizable Where Do I Find...? * Other Stuff: It's Not a Bug Dr. GUI One More Time, With Feeling Steve Sawyer Why We Survive Paul McNett Windows "ME" WWW Why The Life Is So Hard? Ivan Martinez Consulting Solutions Group * Administrivia ====================================================================== CALENDAR: We alternate meetings between Escondido and Sorrento Mesa. All meetings are at 7:00 pm. March 1 - Escondido ------------------- Part 2 of 2 - Nick Nikula and Steve Settimi continue with VFP Com Objects and MTS. April 5 - Sorrento Mesa ----------------------- Eric Lendvai will be showing us a tool he uses to export VCX classes to code. Eric has found that PRG based classes run significantly faster than VCX based classes. Of course, designing visual classes in a PRG is difficult. With this tool, you can have the best of both worlds. May 3 - Escondido ----------------- Kristyne McDaniel will be showing us how to implement configurable toolbars. June 7 - Sorrento Mesa ---------------------- Tim Daly will be showing us "more SQL Server stuff, and using the VFP upsizing wizard, along with ADO, and ASP." Escondido meetings are at Bergelectric, 2222 Meyers Avenue. Take the Nordahl exit from Highway 78 (west of I-15). Head South. Right on Meyers Ave, first right past Mission. It's a one-story building on the right (there's no sign). Sorrento Mesa meetings are in the PS Business Center, 6450 Lusk Blvd. From the Lusk Blvd driveway, go straight back to the furthest corner of the rear bldg and park. The conference room is upstairs over the Fitness Center. ====================================================================== TIPS ====================================================================== OPTIMIZING SQL by Ed Leafe Question: The following Select clause is taking 10 to 15 seconds to execute. The Rushmore optimization is always Partial. Why is it not Total? >SELECT RECNO(), DESCRIPTION, cargotype, commoditytype, cubicfeet, ; > grossweight, revenuetons, wharfagechg; > FROM gItemDbf ; > INTO ARRAY mResultArray; > WHERE DOCUMENTNBR == '123' AND NOT DELETED() Answer: First, you've used the '==' operator, which is not Rushmore-optimizable. If you need the sort of string comparison provided by '==', you could use PADR() to pad the value being compared so that it is the same length as the field. Second, SQL constructions for logicals do not follow the same rules as Xbase. You always need to include both sides of the expression; otherwise, the results can be unpredicatable. In Xbase, it is redundant to write something like: IF DELETED() = .T. since 'IF DELETED()' is exactly the same. However, in SQL code, you should always write a WHERE clause like that. In your case, the WHERE should read: WHERE DOCUMENTNBR = '123' ; AND DELETED() = .F. [from the ProFox forum - ] ---------------------------------------------------------------------- A NOTE ON RESIZABLE Dan Covill We should have stipulated that the code for the resizable class appearing in the last newsletter was not original; it was an enhancement to the existing resizable class of controls.vcx that ships with VFP. Steve Settimi modified the LoopThroughControls method of the class to allow for the resizing of buttons within a CommandGroup object, which the original code did not provide for. The remainder of the code is provided "as is" and can be found the Foxpro Foundation Classes in controls.vcx. ---------------------------------------------------------------------- WHERE CAN I FIND...? (Microsoft has rearranged the MSDN website again, so many of the links we had have moved - and got longer!) MSDN ON LINE: There's a ton of stuff here, look at the Magazines tab, and read some of the regular columns. MSDN Library Look in Technical Articles | Visual Studio | Visual FoxPro Three-Tier Apps: MSDN Library: Building Three-Tier Client/Server Applications with Visual FoxPro MTS: Microsoft Transaction Server MSDN Library: Microsoft Transaction Server for Visual FoxPro Developers ODBC: MSDN Library: Using Visual FoxPro to Access Remote Data VS Installer: MSDN Library: a. Using Visual Studio Installer for VFP 6.0 Applications b. VFP 6.0 and VS Installer Tutorial Windows General XML - What's New in XML for Microsoft Windows 2000 [Nick Nikula and I have agreed to keep this list as a permanent item in the Tips letter. Contributions solicited. DC] ====================================================================== OTHER STUFF ====================================================================== It's Not a Bug . . . by Dr. GUI Dr. GUI doesn't normally share personalized license plate jokes with his readers, but he couldn't pass this one up. It was on a '68 or '69 VW Beetle parked near one of the buildings in which the Windows 2000 team works. The plate read "FEATURE." [from a regular column in MSDN on-line] ---------------------------------------------------------------------- ONE MORE TIME (WITH FEELING) by Steve Sawyer [from the Detroit Area DANEWS] In the last two issues of DaNews, I've been discussing (okay, complaining) about how much difficulty we can experience just getting Microsoft's operating systems installed, and keeping them working through installation of various applications and components. I'm not alone in my concern. Even the folks at Microsoft appreciate the magnitude of the problem. I received an E-mail from my friend Steven Black (Hi, Steve!) who wrote to say that he thought my August editorial was "spot on" as they say in the UK. He recommended that I read an article that appeared in the August issue of Harper's. I took his advice and snagged a copy. The article is indeed highly worth reading and turns out to be an excerpt from the author's book "The Dumbing Down of Programming", which will be winging it's way to my door as soon as I remember to log onto Amazon.com to order it. I'd cite the author's name and give more specifics about the ISBN number and such, but I've temporarily misplaced the photocopy I made of the article. (Just think, if I'd gotten it electronically I wouldn't have lost it! ) I'll have all the particulars at our next meeting for those interested. Anyway, this author compares the open architecture of Linux to that of her primary development platform, Windows NT/Workstation. I remember back when I bought my first "modern era" PC, and was trying to decide between the IBM-PC platform and the Macintosh. I decided on the PC platform because of its open architecture. I preferred a system where, if necessary, I could lift the hood and turn a wrench on the sucker. (Never mind that Mac- heads claim that this is not necessary with a Mac). When we were still in the DOS world, it was very annoying to have to constantly tweak all the entries in the AUTOEXEC.BAT and CONFIG.SYS files to get everything working right. On the other hand, you could, eventually, usually, get the darn thing up and running. Each new piece of software had it's potential for forcing you back into the bowels of your configuration. However, the configuration was contained in two ASCII text files, you had an editor, and you could always fiddle and change load orders and driver switches until it worked. In today's environment, you all too often come up against a brick wall where you've exhausted most or all of your options. In application development, too, we often hit the limitations of the current architecture. You have an ActiveX control that doesn't work. Can you fix it? Not if you didn't write it! Even if you've created an ActiveX control in VB, you can still get stuck in DLL Hell in which you have few options but to do a "Freeman" on your machine, formatting the hard drive and re-installing everything, and even then things may not work. What Microsoft is trying to do is make things easy for programmers. Point. Click. Add this control. Set these properties. Bingo! Yes, this is indeed "dumbing down" programming. A unix system on the other hand does allow you access to the innards of the operating system, and even provides the opportunity to fix or modify the OS when necessary. The developer has complete control over the entire process from the hardware to the user interface. It's important to recognize, however, that there has been a tradeoff in this process. We've lost a lot of control, yes. But let's consider what we've gained. First, how many application developers are experienced, competent "C" programmers? Not enough. The whole point of high-level languages like VFP, VB, Delphi etc., are that you can accomplish in one line of code what might take hundreds of lines in "C". Even when working with Microsoft Foundation Classes, programmers are initially much more productive with a high-level language. RAD is as close to reality as it can get with many high-level languages. Second, when was the last time you had to crack a manual or the on-line help file when working with an unfamiliar application? In many cases, users will find that they can install the software, and get something productive done within 20 minutes of playing around with it. Compare this with the weeks of study required to familiarize yourself with DOS-era apps like dBase, Lotus 1-2-3 or WordStar! I don't think we can minimize the value of the common user interface (regardless of your opinion as to how good it is). Back to programming, I know I don't want to go back to DOS-era Basic or Pascal where I had to write 200 lines of code to create the equivalent of a VFP TextBox! So we're faced with a Really Big Question. Must we sacrifice control for productivity in application development? Is this a Zero Sum Game? I know I'm growing increasingly weary of being out of control of my development environment, to say nothing of my user's and customer's production environment. So what do we have? 1) An increasing desire on the part of developers to regain control of the development environment. 2) The oft-spoken lament by developers that "things are moving too fast to keep up". 3) The increasing desperation by the business world to reduce TCO. 4) The Justice Department's continued interest in Microsoft, and continued speculation by many of the eventual forced breakup of Microsoft. 5) The increasing amount of trade-press column inches and IT community mental shelf-space given to Linux. 6) Current and projected economic costs (and, some would have us believe, outright catastrophe) from the "millennium bug". 7) Ever-declining hardware costs, coupled with ever-increasing broadband technologies Perhaps there is in the foreseeable future an interesting convergence of these forces that may have a significant effect on this situation. I don't mean to make a pre-millenial cry of doom, just a "heads up" that we may be on the verge of some interesting sea-changes in the IT industry. I sure hope so. I don't think things can get much worse. Steve Sawyer President, Detroit Area Fox User Group [This appeared in the October 1998 issue of DA News. Somehow, I missed it, or I would have re-printed it earlier. Right on, Steve] [I can't find a book, but the (terrific) article on "Dumbing Down of Programming", by Ellen Ullman, is at DC] ---------------------------------------------------------------------- WHY WE SURVIVE by Paul McNett [from the ProFox listserve] "But then again, isn't this one of those reasons we Foxpro developers thrive and succeed in this competitive world? We see beyond the documentation... We excel at workarounds... We are loyal to an incomplete product that nonetheless does the job in the end... Paul McNett Software Consulting [Paul is an independent developer in Hollister, CA. DC] ---------------------------------------------------------------------- WINDOWS ME from Woody's Windows Watch, January Windows Millennium is the code name for the next consumer version of Windows. Some wags have named this Windows 98, Third Edition but those wags either underestimate what's in this product or misremember how little was in Second Edition. This upgrade is comparable to the upgrade from Window 95 to Windows 98 although certainly not of the magnitude of the shift to Windows 3.0 or to Windows 95. And it's going to be called Windows Millennium Edition or Windows Me. (Jokes abound for this name -- something from the next Austin Powers movie perhaps?) Today it was revealed that the English language version will be released on 26th May 2000 with various language version rollout out in the month after that. Here are some thoughts raised during my testing: 1. The disk requirements are awesome especially during installation. It complained that my C drive only had 330 MB free - it wanted at least 360 MB although given that I was saving old files on another drive, it only took a net extra of 220 MB. 2. Changing the name of Network Neighborhood to My Network Places is harmless although pointless but the reorganization of what's there is bad for anything but a very small network. Instead of showing the PCs as their own icons which you can open in a tree in Explorer view, it shows all the shared drives on all attached machines with all the c drives first, then all d drives - that is in alphabetic order which is confusing. I guess the presumption is that users of this product only have networks with two or three machines. 3. The setup automatically installs MSN Messenger Service (Microsoft's answer to AOL Instant Messenger) and starts it whenever you start Windows. Apparently Microsoft has learned nothing from the DOJ trial. 4. One nice touch is that on error messages there is a button labeled Survey (presumably only during the beta) that lets you comment on whether you found the message useful and what you might have found more useful. 5. Built into the OS is the ability to open and create zip files. Not even close to the elegance of Winzip, but for many users, it will be good enough [Subscribe to Woody's Windows Watch at ] ---------------------------------------------------------------------- WHY THE LIFE IS SO HARD? by Ivan Martinez [the following post appeared on the ProFox listserve, in response to a complaint about finding things in the Microsoft Knowledge Base] Not all in the life is so easy. A person wrote the article. Another sent the article to MS Another put it in the MS KB. You have a problem. Yow ask someone of your problem. These person say you go to article 666777 in the ms kb. You go and read the kb article 666777. And you are happy. Why the life is so hard ? :-( Atentamente ---------------------------------- Ivan Martinez von Halle - From: Los Teques/ Venezuela - [Now there's a guy with a multi-cultural heritage! DC] ---------------------------------------------------------------------- SOLUTIONS CONSULTING GROUP Solutions Consulting Group, at 6540 Lusk Blvd, is the host for our Sorrento Mesa meetings. But who are they, and what do they do? "Since its inception in 1993, Solutions Consulting Group has grown to more than 40 employees with over 65 active clients throughout Southern California. We are a Microsoft Certified Solution Provider Partner and a member of the Oracle Business Alliance Program." They do: Corporate Application Development Data Warehousing Network Services They work in FoxPro, VFP, VB, Access, SQL, and Oracle. They are looking for more employees and they do use contractors as well; contact Armando Andrade at if you're interested. For More Information... --------------------------Administrivia------------------------------- This newsletter is a service to members of the FoxPro Developers Network of San Diego (FPDN). The editor (Dan Covill) is solely responsible for the content, Barbara Peisch does the distribution. E-mail the editor YOUR tips, comments, complaints, and rebuttals. Editor: Dan Covill 858-272-2448 Board of Directors: Eric Lendvai - President 760-734-4929 Art Bergquist - Vice Pres 760-740-0428 Claude Nikula - Secretary 619-615-6318 Barbara Peisch - Treasurer 760-729-9607 Dan Covill - Director 858-272-2448 Thad V'Soske - Director 619-544-9900 ----------------------------------------------------------------------