Skip to main content

Posts

Showing posts from May, 2005

Code in Methods, not Events. But why????

Andy Kramek does a great job explaining why it's better to create new methods instead of relying on existing events. Certainly, there are always times when you drop code directly into one of the built-in methods but if you think about adding in the new method right off the bat, even for what appears to be a simple job and a few lines of code, you may head off some future refactoring work. Code in Methods, not Events. But why????

How to convert Color code into RGB

I had a problem recently where I had to convert a color code selected by a user using GETCOLOR ( ) into an RGB setting for use in a report. I am across this code and then rewrote it into VFP. Update - until of course, Ted, took me here instead where I should have started all along, in the Wiki. (don't bother reading below unless you want to see the other ways people do this. LPARAMETERS tnColor,tcVal LOCAL R1, G1, B1 LOCAL R2, G2, B2 LOCAL A As Long R2 = 0 G2 = 0 B2 = 0 If tncolor = -1 && DEfault to 255 regardless RETURN 255 ENDIF For B1 = 0 To 255 A = RGB(R2, G2, B1) DO CASE CASE A > tnColor B2 = (B1 - 1) Exit CASE A = tnColor B2 = B1 Exit Endcase Next B1 For G1 = 0 To 255 A = RGB(R2, G1, B2) DO CASE CASE A > tnColor G2 = (G1 - 1) Exit CASE A

Developer Poll: When do you formally start thinking about or planning the next version of your application?

Also noted on the FoxShow today, Microsoft has started laying the groundwork for Hawaii, the version after the next after the next version of Visual Studio. So while other developers may not have the advantage of thousands of developers at our disposal, I thought it appropriate to ask the question.

Tip: Don't set values without saving them first

I've been reviewing some FoxPro code recently and wanted to pass along a recommendation. Don't issue SET statements without checking the value first. Many developers do this already and consider it obvious but many don't or they end up writing extra lines of code for no reason. For example, if you say SET EXACT ON , run some code, and then say SET EXACT OFF - what happens if the user already HAD SET EXACT turned ON? You just affected someone else's code without realizing it. After all, Why write lc = SET("EXACT") SET EXACT OFF and then SET EXACT &lc At the end of the code when you can get by with just one line of code. Now to deal with this, I've created a piece of code that deals with this in a single line. DEFINE CLASS csaveset AS ffcustom csetting = .F. cvalue = "" Name = "csaveset" PROCEDURE Destroy LPARAMETERS tcSetting,tcValue LOCAL lcSetting lcSetting = THIS.cSetting lcValue = THIS.cValue IF NOT EMPTY(lcSetting)

FoxBlog: Longhorn is Dot Not

Interestingly enough - I just had a recent discussion with a colleague on this who is moving their application to DotNet (which was "because it's more reliable than the current Fox environment" ) and that was my response to it as well. Add to that fuel the fact that the new 2.0 framework breaks existing apps and Microsoft has a real challenge ahead of them if they want to convince developers who have not yet jumped into the DotNet waters that this is the right way to go. I'm sure eventually it will be - but for a company that typically advocates eating their own dog food , it's a bit disappointing. FoxBlog

Windows Mobile Team Blog : 27,469

So now that the Windows Mobile team has Windows Mobile 5.0 out - they now have to convince developers and end users to use it. While Rob Levy is tasked with that (and will be getting 27460 air miles for it), Mike Dimmick makes the point: "This 1 developer not very happy he has to buy 1 new development environment, not yet released, to debug code on 1 new operating system. You seem to forget that Pocket PC 2002 is only three years old - companies do _not_ want to replace their devices that frequently." Agreed - Mike. I actually have a PocketPC 2003 and am amazed that I will have to actually think about replacing the unit later this year to get the latest features. It's enough to make me want to consider more open-sourced programs for the PocketPC rather than the provided ones. Why can't Windows Mobile 5.0 run on these devices as an upgrade? That would at least solve the end-users problems and make it easier for developers to swallow getting a new environment. It may

Wizards are for Dungeons and Dragons

Jeez - I go heads down into work for 2 days and missed this great post on Thursday by Joe Wilcox on the Microsoft Monitor. Whenever I give Visual FoxPro training, I almost always skip over the Wizards except for one: the reporting wizard but for the most part I agree with this article. Instead, the Builder or Helper approach is much more straight forward. A Wizard typically "does it all" but how many steps make up a good Wizard UI? Traditionally, Wizards have at least three screens: a welcome, a to do and a finish. Well - get rid of the Welcome and now you're left with two. In those cases, I think it makes very good sense to get rid of the Wizard - it's simply not needed. The Add Hardware wizard sometimes really bugs me - it says 'I'm hear to add your hardware" and then almost instantly "I'm done." Why not just add it automatically? I used to like putting in Wizards for some of my more advanced configurations - because they neede

dodgeball.com or Jambo :: mobile social software

Sounds a lot like Jambo but via cell-phones. Jim and Danny should watch out - Google has a habit of making stuff like this bigger and bigger. I have to say that most of this mobile/wireless social software always makes me think of a dating service moreso than a community builder or "friend-finder" but the examples that Jambo give on their Blog make it seem much more usable. dodgeball.com :: mobile social software

Rick Schummer: speculation is unproductive

Fresh from his visits with the Chicago, Kansas City and Atlanta FoxPro user groups, Rick offers some good points on how to ensure what comes out of the FoxTeam is more than just a roadmap: " keep using VFP 9 and reporting any issues you find so the Fox Team can squash the bugs in Service Pack 1" Not sure where to post them? After visiting newsgroups , Try here Shedding Some Light: 05/01/2005 - 05/31/2005

Recommended Site: Steve's Transitions Journal

The title is a little misleading - the subtitle and poster are far more enlightening. This truly is a journal of thoughts and experiences relating to the art and science of business and management with a mantra of "Analyze, Integrate, Communicate" Former FoxPro guru Steve Sawyer takes on regular business practices and adds extremely thoughtful points typically , but not always, from a technology or former technology perspective. Do you want to be Process or technology driven? Do you see yourself as a partner or a sales person ?? It's with almost every post of his that I take it and send it around to various clients who aren't using RSS yet. Steve's Transitions Journal

Update Visual FoxPro syntax to SQL Server syntax at runtime

Cool - looking tool to help move VFP Syntax to SQL Server syntax. It says that Les Pinter 's been using it. Les - so tell me - what do you think? Anyone else tried it out? Looks like it would only be useful for basic SQL statements but still could help reduce a lot of code for $99. Update Visual FoxPro syntax to SQL Server syntax at runtime

Running VFP 9 with Windows NT 4?

Saw a recent note from Woody You may know, VFP9 (IDE and RT) are not working on NT4 based systems due to a not resolved API call. This may get fixed in a possible SP, but until then maybe this statement by Rainer Becker (Leader of the German FoxPro Usergroup) may be of interest: Please inform your readers/customers/users in your next issue / email that a free patch for VFP 9.0 is available to run it on NT 4.0. The patch has been created by the German FoxPro User Group (www.dfpug.de) and can be found at the dFPUG document portal in the directory http://portal.dfpug.de/dFPUG/Dokumente/Freeware/ so VFP-developers do not need to wait any more to buy an update of VFP 9.0 if they or their customers still use NT4. Some Technical details what the patch program does: 1. vfp90nt4.dll is copied to Windows system directory 2. vfp9r.dll and vfp9t.dll in VFP-Runtime folder at "Shared Files" are patched. 3. vfp9.exe in VFP-program directory is patched. 4. vfp9.exe, vfp9r.dll, vfp9t.dll in s

The Anatomy of Noise

Great post about how "interview" was not verbatim and it caused all kinds of problems. Seems like Winer is doing this quite a bit these days. The Post Money Value: The anatomy of "noise"

Odeo: 25 Breakout Companies in 2005

This sounds like something very cool - taking podcasts and making them accessible by show OR channel tags. Seeing as Evan started Blogger, he knows all about making it easy. I wish I was on the beta. Fortune.com - 25 BREAKOUT COMPANIES 2005: Odeo

TiddlyWiki - a reusable non-linear personal web notebook

FoxShow #10 is almost up but in browsing Odeo, I found this cool tool! TiddlyWiki - a reusable non-linear personal web notebook A Wiki - WITHOUT any server side logic required. Now THAT is cool. Only supports saving on Windows FireFox and IE but that looks like it's getting fixed and it automatically generates an RSS feed. Did I mention that it only uses HTML, Java and CSS? But they do note that it's NOT Ajax. Why? AJAX is an acronym standing for Asynchronous JavaScript and XML. Although TiddlyWiki uses JavaScript extensively, it doesn't do anything with XML or XMLHttpRequest, so it doesn't really fit the category.

Ken Levy: Plans for Visual FoxPro beyond version 9.0 coming

Well there's an old adage that ends with "you just might get it..." and Ken, while not spilling any proverbial beans, lets us know "the Visual FoxPro team has already started working on enhancing Visual FoxPro beyond version 9.0" But what's also important is that he warns "People should keep in mind that our goals and focus is on how Visual FoxPro apps run in 5+ years rather than on specific VFP IDE, engine, and language features." Well - there's a wealth of suggestions on the Wiki but... Hmmm....5 years.....MS has already made a very large push towards 64-bit and it reminded me of a comment that Steven Black ( I thought) had made on the Wiki (but I couldn't find it) that seemed to suggest that VFP might be very ripe for a transition to a 64-bit environment. ( Update: from Ken and the VFP FAQ: Q: Are there plans for Visual FoxPro to support 64-bit versions of the Windows operating system? A: No. While Visual FoxPro will remain 32-bit a

Where Is Your Screen?

If you haven't heard this Malcolm Gladwell talk from the the SXSW conference - be sure to give it a listen. It's from March but I was re-listening to it the other morning and wanted to point it out. It's all about how removing information can be on of the best ways to make intelligent and truly objective decisions. IT Conversations: Malcolm Gladwell - SXSW Interactive 2005

Andrew's Space: How To Become A Canadian Cabinet Member

I need to post this now lest the Canadian government decide that I'm really a PAID campaign advisor and have to register. Thursday will be an interesting day - I'll already had clients push back on any decisions lest hell freezes over. But one of the comments on Captain's Quarters had it right (we're skipping over banana republic and jumping right into irrelevance ) - and hey they even have a great quote from Churchill Andrew's Space: How To Become A Canadian Cabinet Member

Dave: Consider the way interviews are written

Dave Winer, "But these lies have gone on and on, he just doesn't stop. Permanent link to this item in the archive." To be fair, you never know what the original source for the interview was. I've seen numerous instances where someone says "we" and the writer changes it into "I". The writer wants good copy - and it doesn't sound good if you're interviewing one person and they only refer to a group - it makes the writer feel like the story isn't just there but everywhere. In short, "better copy" may make terrible truths and distort facts - but sells more paper. You've listened to Adam's show so you know he doesn't usually come off as "I'm the one who does everything" - he always talks about the group of people who helped create it and always tries to NAME names. And not trying to be a conspiracy theorist or anything, but it actually stands to benefit the MSM (mainstream media) to creat

The Book on Podcasting

(right on the heels of the xBox release), Todd Cochrane (of GeekNewsCentral and TechPodcasts ) has got the first full book out on Podcasting: Although Amazon is noting as "not available", it's available today and for a decent price too. Here's a link to the Podcast where Todd announces it as well as promo . Congrats, Todd!

Apprentice Finale

I was hoping for Street Smarts - but honestly, neither of these two are capable of the job. (no link, no nothing!!!!)   I have to say - both teams were sh*t - and Kendra did the job required. Tana couldn't do it - I actually thought she could.   ANd now watching the episode, OMIGOD!!!! Both of these two have no place in any organization (after watching them for the past 14 weeks) but Kendra definitely did win the job.   Good job.    

Cliff Atkinson Beyond Bullets Presentation

Watching Cliff Atkinson's Live Meeting on Beyond Power Points - looks like Craig is there as well. (at least it says Craig but when you've got 1200 people all over the world, it may not be) Cliff's storyboard approach is a great way for creating meaningful and memorable presentations. It's a tough skill to master but by breaking down the presentation into three acts and identifying the headline first BEFORE filling in the body really does make the presentation work well. sociable media // PowerPoint solutions

CommandBars - The More I use, the more I like

The more I use it, the more I like it. CommandBars from Arg-Software Design Lab is so cool and for only $165/dev, it's a steal. No more ActiveX controls needed, no more ActBar conflicts - and I can change the UI with a single tweak. Check it out here

How Do you Run Windows?

As noted in the new FoxShow , I was having a discussion with a colleague and it struck me that everyone makes assumptions about how Windows is being configured on each workstation, even from a visual perspective. So I thought I would ask the question: How do you run Windows? Take the poll and let me know. Take My Poll

FitNesse.AcceptanceTests

Bob Archer pointed me over to this tool from one of the FoxShow comments. This looks like it should be another open project similar to FoxUnit . I think I'm going to grab Bob for an interview on FoxShow. FitNesse.AcceptanceTests

FoxPro Design Tip: Check Visible before checking Autosize Width

This may seem fairly obvious but it's something that may catch up many FoxPro developers in screen design, as it just did me Setting AutoSize to True is a great way to identify how wide a label needs to be to show its entire content. However, you may be tempted to set the AutoSize before showing the label so your screen doesn't appear to resize dynamically. The catch here is that if the object isn't visible, AutoSize will not change. Want to try it out? _SCREEN.AddObject("lox","label") lo = _SCREEN.lox ? lo.Width && Returns 100 lo.Caption = "Hello" lo.AutoSize = .T. ? lo.Width && Still Returns 100 lo.Visible = .T. ? lo.Width && Now Returns 29 This isn't really a bug - after all, AutoSize should only ever decide what width to use once it knows it's being seen, but it can trip you up if you are trying to layout objects on a screen before making them visible. The solution? Use LockScreen before doing any of the work

Adding an embedded image to an HTML message in Microsoft Outlook via VFP

A fellow developer asked me about Visual FoxPro and Outlook and I was stumped. I want to create a "HTML-Outlook-email" from Visual FoxPro (8.0) and have no problems so far to creating it. But... I want to include a picture (like this one of me down there) in the. "htmlbody" of the mail. Sure enough, you could just put do some code like: loOut = CREATEOBJECT("Outlook.application") loSpace = loOut.getnamespace("MAPI") loFolder = loSpace.GetDefaultFolder(4) loMsg = loFolder.Items.Add() loMsg.HTMLBody = "My image is [bracket]img src='http://myimage.gif'[bracket]" But the problem is that the HTML refers to a web site. If the user was off-line, they would get a missing image icon. What was really wanted was to have the image EMBEDDED into the email just like users are able to do with Outlook when they choose Insert Picture. I researched this one - thinking that maybe MHTML and CDO had to be used or maybe even getting a link to the MA

Democracy in Media: Sirius, Adam Curry and “The Economics of Abundance”

Interesting post about what Adam Curry's deal with Sirius really means about the "citizen's media triumph", which it isn't. Alex Rowland hits the nail on the head: "(I can hear the executive meeting reaching the crescendo, “Hey, instead of us deciding what people are going to want to hear, let’s ask Adam Curry! He involved in all that Blogging and Podcast stuff! He’ll know!”)" "It’s just that Adam’s going to be better at sorting through the chaos than anyone else at Sirius, and instead of content originating from the creative staff at Sirius; it comes from a bunch of individuals. But, like Current.TV, it’s just replacing the tyranny of a few guys in Hollywood with the tyranny of popular public opinion (or in this case, Adam’s opinion)." Democracy in Media: Sirius, Adam Curry and “The Economics of Abundance”

beyond bullets: Information Overload Makes You Dumb

beyond bullets: Information Overload Makes You Dumb Cliff points to two studies showing how information overload is even worse than smoking marijuana for dropping IQ and sums it up with a quote from Tom Grimes : " The human brain is today as it was in the 1880s, the 1580s and in the time of the Greeks and Romans...we are no better able to parallel process conflicting information than we were 300 years ago." and a great tip: "Tip: Simple is smart, overload is dumb." FYI - Cliff's got a free webinar coming up on May 12 (sold out) but it's now be added with additional room here If you've simply enjoyed his great tips on making better power points, attend the seminar - his approach on storyboarding is certainly a lot fresher than the typical approach of building presentations.

Happy Birthday Dave!

Agreed, Ted. It's one of those unbelievable moments when it hits you that here is a guy who has essentially created a revolution in web communication and yet (at least to my recollection) hasn't posted a "Paypal donation " box or anything of the like on this... Yes, there's a business behind it - but the spirit behind it is still about "what is possible" rather than "what is profitable." I think it's important to realize what IS profitable but here's to someone who has certainly provided a monumental change in the entire "webosphere". Ted's Radio Weblog

Tracking Undeclared Variables with FoxPro

Simon Arnold explains valuable uses for the LanguageOptions property : Tracking Undeclared Variables with FoxPro This is similar to what the FoxMasters CodeInspector does , although their interface is a little easier to walkthrough than going through the text file. The problem I have with the LanguageOptions is that you have to RUN your application - whereas with CodeInspector , you can do a scan right on the fly of your existing code. Of course, if you tested each piece of code as you were writing it (a la FoxUnit methodology), the LanguageOptions approach would likely suffice but realistically for $79 US, CodeInspector would be a pretty good investment for any developer/manager who has to review other people's code.