====================================== FoxPro Developers Network of San Diego ====================================== FoxDev TipsLetter #04-01 February 7, 2004 Website: Editor: ---------------------------------------------------------------------- CONTENTS: * Calendar * From the Editor * Tech Tips: Selecting Specific Characters Ed Leafe CSV File Format Dan Covill Printing a PDF file from VFP Yet Another Clock Updater Dan Covill * Other Stuff: Systems Speak When Executives Code Dan Covill TicketMaster Is Not Your Friend * Knowledge Base Updates New/Updated KB articles on VFP * Links: Where Can I Find...? * Administrivia ====================================================================== CALENDAR: All meetings are at Sizzler unless specified otherwise. Thu - Fed 12 - Marcia Akins and Andy Kramek ----------------------------------------------------------- Short Presentation - NONE Main Presentation - Andy Kramek and Marcia Akins Andy and Marcia do the Kit Box column in FoxTalk each month. Topic: Marcia will be showing us her presentation on how to use ActiveX controls in VFP. Her topic will focus on commonly used controls that come with VFP. Andy will be speaking on "Designing a Database Right the First Time" One of the perpetual challenges that we all face from time to time - the creation of a new database. This may be for an entire new application or simply to support a new module or new functionality for an existing application. Before we can even start thinking about table definitions, data normalization and referential integrity we need to ensure that the database accurately models the process (or processes) that it will have to support. It doesn't matter whether we are using Visual FoxPro, SQL Server or some other database, getting this right is the key to a successful database implementation. In this session Andy explores the issues involved and illustrates, with practical examples, how the application of some simple rules will help you to get it right first time. If you have ever had to add new tables to a database because something was missing, or found yourself wishing that you had structured things differently to start with, or just have a new project looming, this session will be invaluable. Thu - March 11 - Darrell Gardner ----------------------------------------------------------- Short Presentation - OPEN Main Presentation - Darrell Gardner Topic: How to tell if your computer has been hacked (it probably has) and what to do about it April - Open ----------------------------------------------------------- Thu - May 13 - Drew Speedie ----------------------------------------------------------- June - Open ----------------------------------------------------------- Thu - July 15 - Mike Stewart ----------------------------------------------------------- All meetings start at 6:30 pm. Sizzler Meetings: Back room of Murphy Canyon Sizzler: 3755 Murphy Canyon Rd Take I-15 to the Aero Dr exit (South of Balboa) Head West to first traffic light West of freeway Turn Right Sizzler is on the right almost immediately Buy your dinner at Sizzler and we'll have our Q&A session while we eat. PLEASE TRY TO COME EARLY ENOUGH TO ORDER YOUR DINNER BEFORE 6:30! ====================================================================== FROM THE EDITOR: Lots and lots of new KB articles this month. Check out the list - there's probably an answer there to the problem that's been bugging you! A lot of nice new "how-to" articles as well. We get the meeting room at the Sizzler for free - based on the assumption that something approaching 20 people are going to buy dinner there. It's a pretty good deal for us - handy location, edible (though not great) food, and the price is right. So help us out - even if you're not that hungry, buy SOMETHING from Sizzler so they will let us keep meeting there. It's only fair. Through Randy Brown, the board is inquiring (again) about the possibility of meeting at Microsoft. Won't be any food available there, though. Let any Board member know your thoughts and/or preferences. Dan Covill ====================================================================== TECH TIPS ====================================================================== SELECTING SPECIFIC CHARACTERS by Ed Leafe Q: What is the easiest way to get just the digits from a string? E.g. '21 ', 'Flat 23', ' Appartment 14 third floor', '#32', etc. A: LPARAMETERS tcString lcDigits = "0123456789" lcBad = CHRTRAN(tcString, lcDigits, "") lcResult = CHRTRAN(tcString, lcBad, "") The first CHRTRAN() gets all the non-digits, and the second removes them from the original string. Ed Leafe ed@leafe.com ---------------------------------------------------------------------- CSV FILE FORMAT by Dan Covill This exchange appeared on ProFox a while back: ----------------------------------- Q: I'm generating a comma delimited file from a dbf. However I need to include the field names within the file. COPY TO does not give me the field names. Can anything think of a setting or a command that would help? A: Instead of DELIMITED, do this and you'll get field names in the first row: COPY TO NewFile TYPE CSV ----------------------------------- I said, "Hmmm... wonder what CSV is?" Well, it's DELIMITED with the fieldnames. I guess it's crept into the industry while I wasn't looking, like so many other things. [Note from Barbara Peisch: CSV stands for Comma Separated Value] The option works in VFP 6, 7, and 8, although it's not mentioned in the Hacker's Guide, and the VFP 6 Help erroneously calls it "CVS". The VFP 7 and 8 Help have it correctly. But there's more to it than that. "CSV" files have been implemented all over the place, and (you guessed it!) they're not all the same. Here's a reference you might look at before just blindly using it. Deals with those gotcha's like commas and quote marks inside the fields, etc. Dan Covill ---------------------------------------------------------------------- PRINTING PDF DOCUMENTS FROM VFP ProFox Want to print a .PDF from inside VFP? Here's how: lnError = ShellExe(lcFileName,'PRINT') *------------------------------------------- FUNCTION ShellExe(lcShellFile,lcFileCommand) * Check parameters IF PCOUNT() < 2 RETURN ENDIF * Declare API Command DECLARE LONG ShellExecute IN "shell32.dll" LONG HWND, ; STRING lpszOp, STRING lpszFile, STRING lpszParams, ; STRING lpszDir, LONG nShowCmd * Try and use default editor program lnError=ShellExecute(0 ,lcFileCommand ,lcShellFile,'' ,'' ,1) * Return with return code RETURN lnError ENDFUNC ---------------------------------------------------------------------- YET ANOTHER CLOCK UPDATER by Dan Covill Yeah, I know everybody already has three ways to update their computer clock. So did I, but somebody pointed me at a better one, so here it is. Tclock is absolutely free, dazzlingly simple, and it works. It's the product of a Japanese programmer: I knew I wanted it when I read his installation instructions: "If you get any problems with TClock, quit using it." All it really does is give you a dozen ways to customize the format of your system time in the taskbar, plus a simple, working way to auto-update from the NTP site of your choice. No registry entries, nothing in your Start menu, simplicity itself. Recommended. Note that if you're running XP, you don't need this because it's already built into the system. From the "Date and Time" icon on the Control Panel, choose the third page, which is "Internet Time". There's a checkbox to "Automatically syncrhonize with an Internet time server", and you can choose either time.windows.com or time.nlist.gov. Dan Covill dcovill@san.rr.com ====================================================================== OTHER STUFF ====================================================================== WHEN EXECUTIVES CODE by Dan Covill A fascinating article of this name, by Phillip Armour, appeared in the latest Communications of the ACM. Armour's thesis is that many manufacturing companies are becoming de facto software companies, because they OEM the manufacturing and marketing, leaving only system design and software. The problem is, they knew how to run a manufacturing business, but don't know anything about software. [Gee, I'd never have suspected that! DC] Armour, a long-time consultant, ran a 3-day workshop for such executives. The second day began with: "Today you are going to design, develop, and test a software system." Blank stares and open mouths. Their task was to gather requirements, create a project and test plan, design, code, and test the system and present the result by 3:30 that afternoon! "These executives did uniformly great project plans, and quite good process planning, too. However, they did not actually use either of them." [!!! DC] Three times during the day Armour interrupted them to discuss their project status. By the third interruption, they were "about 90% complete", and getting angry at the interruptions. No team ever produced a system that worked. [Surprise! DC] "Even though the stated job was to create a system, the lure of discovery took over. And so they succumbed to the siren song of learning and ignored their own restrictions of planning and process... These executives had discovered the two greatest motivators of the software developer: to learn and to create." "The job of executives is not to stifle learning and creativity under a blanket of control and process and metrics and status reports. They need to learn to channel this energy, not suffocate it." ---------------------------------------------------------------------- SYSTEMS SPEAK "If you base your work on eetasoft (open source) and use a socket dll without MS Winsock limitation, rewrite some genhtml using the new VFP7++ features, you, at the same time, fix the problem of the limit to 5 sessions and the port security problem, as you'd use only one port and you'll accept only POST and GET methods you program/code to accept and proceed." [Saw this post on ProFox. Is it any wonder people don't know what the devil we're talking about? DC] ---------------------------------------------------------------------- TICKETMASTER IS NOT YOUR FRIEND [The following is TicketMaster's stated Privacy policy. :-( ] "By purchasing a ticket, or completing a registration form so that you are able to access a purchase page for a ticket, to a concert, game or other event on the Site, you consent (i.e., you opt-in) to us sharing your personal information with the venues, promoters, artists, teams, leagues and other third parties associated with that concert, game or other event ("Event Partners"). We cannot offer you a separate opportunity to opt-out, or not to consent, to our sharing of your personal information with them. Event Partners may use your personal information in accordance with their own privacy policies, and may consequently use your personal information to contact you and may share your personal information with others. You will need to contact those Event Partners who contact you to instruct them directly regarding your preferences for the use of your personal information by them." ====================================================================== VFP KNOWLEDGE BASE UPDATES ====================================================================== Visual FoxPro 101292 How to Create a WordPerfect Merge File 101302 How to Prevent "Source Is out of Date" Error Message 104054 PRB: Calling Screen from Another Without Jumping a READ Level 104056 DEFINE WINDOW Syntax and "Position Off Screen" Error 103088 How to Determine If All Elements in an Array Are Empty 101592 Support for the AS Clause in RQBE 106161 How to Convert Screen Object Positions Between Platforms 108164 PRB: RQBE Not Generating FROM Clause When .QPR Table Missing 109152 How to Create a Data Grouping on Every Nth Record 105279 How to Remove Carriage Returns/Linefeeds from @ ... EDIT 104345 How to Determine If a Library Is Loaded in Memory 104349 PRB: SetupWizard .INF File Contains a Bad Description Line 102586 PRB: Unable to Find Proc./Func. 106485 PRB: Menu Hot Key (ALT+) Doesn't Work 106489 No Keyboard Shortcuts in FoxPro for Win Screen Builder 104477 FIX: FoxPro Calculator Returning Incorrect Percentages 112083 PRB: "Invalid or Missing .EXE" w/ Backslashes in Folder Names 103585 How API Function Array Arguments Are Passed 103595 Obtaining Subscript Info for Array Passed by Reference 109579 PRB: SELECT - SQL Command Reads Contents of Memo Field 109580 Causes of Common SELECT - SQL Error Messages 109583 PRB: SQL SELECT Causes ICE or "Invalid Function Argument..." 106659 How to Sum or Count Specific Fields in a Report 106660 RUN /N Not Working Correctly with MS-DOS Batch File 106661 How to Determine the Shape of the Mouse Cursor 109612 How to Pass Parameters from Windows to FoxPro for Windows 106690 Function for Returning a Julian Date in FoxPro 105634 PRB: Records from Other Platforms Remain in .SCX/.FRX 106708 How to Generate Unique Key Field Values 110254 INFO: How to Restart Windows from Within FoxPro 107665 How to Create a Table Structure Using an ASCII File 102890 How to Calculate Running Totals in a BROWSE Command 110361 How to Find the Current Video Resolution 110364 PRB: "End of File Encountered" with APPEND GENERAL 102895 How Increase & Decrease Size of Compound Structural Index 112220 PRB: System Resources Not Released While in FoxPro 112240 Running Multiuser Screens Created w/ Screen Wizard 111513 PRB: Application Tries to Locate Menu 103833 Using Alternate Character Sets Provided by Code Pages 104865 PRB: "Report File Invalid" or "Memo File Missing/Invalid" 104884 How to Write to the Calendar/Diary Programmatically 113175 How to Print Multiple Columns in FoxPro for MS-DOS Visual FoxPro 6.0 134704 HOWTO: Add Controls to a Form Generated by the Form Wizard 131836 PRB: Grid Not Refreshing Displaying a Cursor From Query 130864 PRB: Form with One-to-Many View Does Not Update Parent Records 140294 HOWTO: Append Records from Any Delimited File with Memo Data 137681 HOWTO: Control the Screen Size of an .Exe File at Startup 139597 HOWTO: Use the Wizard txtbtns Class in a Non-Wizard Form 138779 HOWTO: Make a Lookup Combo Box in a Grid 138809 PRB: Update Conflict w/Remote View When WhereType Set to Time How To Look Up These Articles: To get to a specific KB article: a. Go to support.microsoft.com. Search is at left of the page. b. Select "Visual FoxPro" on the drop-down. c. Enter the document number in the textbox below it. d. Click on the green arrow. To Subscribe: Subscribe at . You can specify any MS product to receive alerts on. ====================================================================== LINKS ====================================================================== This is a (semi) permanent list of places to look for technical help when you get blind-sided by the latest urgent requirement. We don't give specific URLs for MSDN articles because (a) they're too long and (b) they change too often! ------------------------------- 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 MSDN Library: "Building Three-Tier Client/Server Applications with Visual FoxPro" ADO MSDN Library: ADO Jumpstart for Microsoft Visual FoxPro Developers John V. Petersen, April 1999 DNA (Distributed interNet Architecture): MSDN On-line: "Top Windows DNA Performance Mistakes and How to Prevent Them" FoxPro 2.6: http://members.aol.com/FoxProResources/fpfp.htm MTS: Microsoft Transaction Server MSDN Library: "Microsoft Transaction Server for Visual FoxPro Developers" ODBC: MSDN Library: "Using Visual FoxPro to Access Remote Data" ODBC drivers are part of MDAC - Microsoft Data Access Components - and are available for download at: "www.microsoft.com/data" VS Installer: MSDN Library: a. "Using Visual Studio Installer for VFP 6.0 Applications" b. "VFP 6.0 and VS Installer Tutorial" VFP Publications: www.advisor.com FoxPro Advisor www.pinpub.com FoxTalk magazine www.hentzenwerke.com Hentzen Publishing (Books, discussion, and downloads) VFP General: msdn.microsoft.com/vfoxpro Microsoft's official VFP home page www.foxcentral.net Joint effort by Microsoft, West-Wind, and the Universal Thread Lots of news and development info. MS Developer Applications Forum on Compuserve http://go.compuserve.com/msdevapps The History of FoxPro (submitted by Steve Settimi) www.foxprohistory.org The Universal Thread http://www.universalthread.com The "Wiki" www.wikis.com fox.wikis.com fox.wikis.com/wc.dll?Wiki~FoxForumWiki Here is the most complete set of FoxPro links you're likely to find: http://www.cetus-links.org/oo_visual_foxpro.html Private websites with useful free info and downloads: www.prolib.de/foxlinks.afp wOOdy Wondzinski www.gatwicksoftware.com Allen Pollard www.ukfug.org.uk British user group www.lafox.org LA user group www.pinter.com/ Les Pinter www.vfug.org/ Virtual Fox User Group www.leafe.com Ed Leafe, ProFox listserve www.jamesbooth.com www.foxforum.com www.foxfolk.com www.foxite.com (registration required) A group of Dutch developers - refreshingly geeky. (Don't be put off by the registration - they're not selling anything.) www.stevenblack.com www.craigberntson.com WEB Development: These products all work well with VFP. AFP www.afpweb.com and www.afpages.com DotFox www.elsoftware.com FoxWeb www.foxweb.com Web Connection www.west-wind.com X-WORKS www.x-works.com Windows General Win32 API (with VFP examples) XML - What's New in XML for Microsoft Windows 2000 See also OLE DB drivers for XML in MDAC 2.6 at "microsoft.com/data" [Contributions solicited. DC] --------------------------Administrivia------------------------------- This newsletter is a service to all FoxPro developers, provided without charge by the FoxPro Developers Network of San Diego (FPDN). Anyone may subscribe (or unsubscribe) at our web site . The link is on the home page. The Resources button on the website will take you to the back issues of the newsletter. The editor (Dan Covill) is solely responsible for the content. E-mail him with YOUR tips, comments, or complaints. Editor: Dan Covill 858-272-2448 dcovill@san.rr.com Board of Directors: Eric Lendvai - President 760-734-4929 eric@elsoftware.com Art Bergquist - Vice Pres 760-740-0428 abergquist@sbcglobal.net Thad V'Soske - Secretary 619-544-9900 tvsoske@yahoo.com Barbara Peisch - Treasurer 760-729-9607 barbara@peisch.com Dan Covill - Director 858-272-2448 dcovill@san.rr.com Claude Nikula - Director 619-615-6318 crndev@verizon.net ----------------------------------------------------------------------