Friday, April 28, 2006

Hmmm....could SolutionExplorer have a continuous integration component?

After reading this post from Eric Sink, I was intrigued about CruiseControl and if it could be made to work with VFP.

It doesn't sound like it but the concept is something that might play very well with similar concepts in VFP.
This article describes it:
What is CruiseControl.NET - Confluence

In VFP, one could imagine setting up a dedicated folder for Production Builds and then monitoring the source control repository. When an update is made, it automatically downloads it (this part could all happen with CruiseControl if it would recognize VFP components) and then it would run a build on a specific project.

Is anyone doing this today?

This also reminded me of this post by josborn.

Which reminds me, Craig/Scott - didn't Solution Explorer mention some kind of cool integration pieces....

Wednesday, April 26, 2006

Tuesday, April 25, 2006

Scary Thought: Is Scoble Mini?

After reading this post - How Microsoft can shut down Mini-Microsoft - yesterday, I had a very disturbing thought.

In the middle of the night, after putting down the camcorder, relinquishing his SmartPhone and stopping his SecondLife game, Robert goes down to basement of his home, knocks three times on a bookcase, and pulls on his signed copy of "Business @ the speed of thought". The bookshelf moves forward and spins around, unveiling a dark room with a single AMD black computer on it. (possibly running Linux, or maybe even, gasp a customized MacBook Pro)

His usual smiling face is replaced with a scowl that could only be described as...(slightly - punkish)


Hmmm - am I far off? As from the description "(Mini is an anonymous blogger, who generally talks about things that Microsoft is doing wrong, and/or that he wants to see improved. His motto is to, by slimming down Microsoft, make Microsoft a more lean profit-making machine)."

Scoble is always talking about making Microsoft better.

Mini talks about bad policies. Scoble just talked about "Bureacracy. Politics. Committeeisms. And too much centralization of power and decision making authority."

And then when you read his "I have a dream" speech and the way the two sites just love each other...hmmm.

Scoble spins positive. Mini spins negative. Two sides of the same coin?

Then again - is it possible that two people at Microsoft would actually share the same beliefs that they both work for a company that will one day achieve "A guaranteed Terabyte of Internet-based storage space for EVERYTHING and for EVERYONE running Windows in the world."

Nah...why would Bill hire like-minded people? Only a guy like Steve would do that.

Note: I say this never having met Robert (or Mini but who has) but definitely respecting the way he blogs. No disrespect intended.

Blogging Conferences

Maybe it's just that Australia has better wireless in their conferences. I think it's great when developers blog the conferences they are attending, as Craig is doing with his DotNet: Code Camp.

While I've always liked the Universal Thread Conference coverage, I hate logging into it - it's just a complete pain (especially since this board doesn't even support RSS)

So for all those who were there, how was Great Lakes?

Hey - and as I just saw on the UT, there's now even a RUSSIAN VFP DevCon.

Monday, April 24, 2006

What's Wrong With This Statement?

Code in a textbox valid method:

IF TRIM(THIS.Value)<>TRIM(THIS.oObject.SavedValue)
THIS.oObject.SavedValue = TRIM(THIS.Value)
ENDIF


On the surface, this code may look like it should execute properly, right?

There is one approach that you might change immediately :

Sethe ControlSource property to THIS.oObject.SavedValue. This would remove the need for this code completely.

But is there anything else wrong with the statement?

When you look at the value of an object and compare it to something, it's easy to get into the habit of only changing the initial value. If THIS.Value isn't empty, then you're going to do something but in the case of the statement above, what about the comparing value? (the one stored in THIS.oObject.SavedValue)

IF "Andrew"<>"andrew"
** This code will execute
ENDIF

IF "Andrew"<>""
** This code will NEVER execute
ENDIF

As a result, the original code (that updated the value) would never execute.

A small but good thing to look for on code reviews, especially when trying to find out why code in FoxPro isn't working the way you expect it to.

The Two Most Important Words in Blogging | Copyblogger

Originally noted by Bubba, I think you'll find this post valuable if you blog at all because it helps differentiate valuable content from mindless drivel.

Yes, you may read some drivel on here from time to time and sometimes, the best way of explaining a technical problem is to walk through the steps you've gone through to arrive at your conclusion, so I may lapse from time to time but the CopyBlogger is definitely right about delivering good content.

Is this something new? Absolutely not. Advisor Communications and FoxTalk have been recommending this approach for years (at least the first word).



The Two Most Important Words in Blogging | Copyblogger

Friday, April 21, 2006

The Transient Web

Great post by Steve Rubel about The Transient Web

His main point? "Only one site, eBay, seems to have retained users over the past ten years. And that's because they listened to their community and innovated. Google, so far, has done the same. But will they?"

If you read the comments, you'll see that some of his examples aren't as persuasive as others, but I think you'll get the point.

In the development world, the same could be said. Fifteen years ago, you programmed other MS applications with DDE. Now you do it with VBScript, COM or other tools. You used to write code with C, maybe C+, and Basic. Now you do it with C#, Java, VB.Net or any number of other languages. You used to swear by (or at) the Waterfall methodology, now everything is agile.

What's the same? Oh yeah - the power found in a FoxPro application.

I know there are other technologies that are still around (and in use) from 15 years ago. What are the ones you can think of?

Wonder what we'll be using 15 years from now.

Go to Sleep

Franlkin makes a note on how to go to
Franklin Sleep en VFP (Sleep in VFP)

It brings up a very important reminder of working with DLLs.

The code was this:
Declare integer Sleep in "kernel32" Long dwMilliseconds

Sleep(200)

The trick? VFP Developers get so used to being case-insensitive if you define it as

Declare integer sleep ...

It won't work. API calls are case-sensitive.

It was a handy post too - I was just getting ready to use

INKEY(5,"H")

What's that last "H" do? It hides the cursor.

A lot of older code coming from DOS days just used to say INKEY(2) - and you would see a cursor sitting there on the screen. UGLY!

With INKEY, you can set the second parameter to "S" - to show the cursor, H to hide it, M to wait for a mouseclick or E to expand a keyboard macro.

But with the Sleep call, you don't need to worry about it - and rely on the basic Windows API call.

Thanks Franklin!

NETGEAR Skype WiFi Phone

First noted over on FoxPro Catalyst, the
NETGEAR Skype WiFi Phone looks very cool.

Probably be a best seller in San Fran or any of those cities getting free wifi.

I know it says Open wifi - but it will be interesting to see how it works in areas where you have to "login" to get that free access.

Thursday, April 20, 2006

Welcome Rahul

As Craig noted, Rahul Desai is now blogging on VFP and other topics.

In one of his first posts, he notes the Martin(s) work on a project documentation tool.

Pet Peeves: _SCREEN.Activeform

While it's a great product, there are just times that FoxPro really drives me nuts.

A great example? _SCREEN.Activeform.

I know people have ranted about this for years so now it's my turn.

_SCREEN.Activeform returns a pointer to the current form object. But what if there's no current form?

Does it return NULL? An empty string?

No. It errors out.

Does anyone know what the reasoning was here?

Now, you can verify it by doing

IF TYPE("_SCREEN.Activeform")="U"
** Now you KNOW there's no form there.
ELSE
ENDIF

but then you still have to do a

IF NOT ISNULL(_SCREEN.Activeform)

ENDIF

Note that you can't use VARTYPE() because Activeform isn't a variable. (example : VARTYPE(_SCREEN.activeform)) - which is a shame because VARTYPE is the faster of the two.

In that blog post, if you read the comments, you'll hear things like "use PEMSTATUS" instead of Type for objects but the problem here is that ActiveForm IS a valid property for _SCREEN (unless you actually want to refer to it).

I thought I could be clever and maybe look at _SCREEN.FormCount but guess what? If a form is defined but hidden, the ActiveForm is still not there but FormCount is 1.

So the end result is you HAVE to use the slower, uglier type approach to get out of these annoying checks for _SCREEN.Activeform.

IF TYPE("_SCREEN.Activeform")<>"U"
** do something with it - _SCREEN.Activeform
ELSE
** don't do anything otherwise you'll error out.
ENDIF

Now will users notice the performance penalty? That's a tough call - but I do know that it adds three unnecessary lines of code which adds to the Refactorability of a program.

Putting Your Best FoxFace On

I've always been a bit troubled by "skins", the way that many consumer or hard-core geeky tools (WinAmp was one of the more popular ones) allow users to apply skins. Not to say I don't like them ( I like a good Star Trek Skin- but I can certainly understand how they can confuse other users.

That said, I'm intrigued by this new tool for Visual FoxPro 7 through 9.
FoxFace - skin VisualFoxPro (VFP) applications with our VCX class, VFP skin, Visual FoxPro skin, skin Visual FoxPro, skin VFP - the downloadable demo is unfortunately terrible (it only shows one skin and doesn't size properly on a 1024x800 resolution) - but they do have a nice presentation on how to use it here

For $59 US, if you wanted to let your users "skin" your app themselves, they can do so. Has anyone tried this out in a real application yet?

In looking at the demo, there appears to be a FOXFACE table that contains the skin ID, name, author and email and then a variety of fields that look like they point to image types and the actual binary file.

Adding skins to a project looks pretty easy. Add the FoxFace class library to the project and drop it onto a form (or base class).

Specify the path to the class (it defaults to LIB) and then specify the Skin ID. Then compile and run.

There is also a class to let you skin the FoxPro desktop.

Whoops? Does that mean I can't change skins on the fly? That's too bad. It's hard to tell from the demo because the Skin IDs are built in - but since it's a class, I'm sure you could simply recall a method.

Now the sample skins they provide only show color and bitmap changes - couldn't users get the same effect through Windows Themes? I suppose - although this way, you could offer it specifically for your application, a nice way of letting users add their own personal touch.

Hmmm...skins in business applications- is it a good idea? Personal expression aside, I'm still deciding...but it's good to know there's a VFP tool out there for it.

Wednesday, April 19, 2006

Express Yourself Freely

As Paul Mooney notes, Visual Studio Express Free Forever.

For developers, that's great news - certainly it helps Microsoft continue its push to get more developers using Visual Studio and DotNet technologies. Of course, they will need to pay for their large scale solutions but who doesn't.

Hmmm --- wonder if that will deal with Claudio's issue?

That stuff aside, Paul's post also notes some other very cool announcements including a Skype wrapper and a variety of initiatives and videos.

But good on you, Microsoft and the entire Coding4Fun group!

VFP causing hell to freeze over

As Craig notes here, we aren't the only ones noting the surge in VFP.

Woody's comment on this is great though:
"(VFP is) surely not a shiny buzzword-loaded tool, but a workhorse, which just does the job and which you can trust for lots of years to come. "

Hey Woody - where's your blog?

Tuesday, April 18, 2006

Restoring Work Areas: ALIAS() vs. SELECT()

Most programs like to save and restore the calling environment when they execute. The environment may include settings, work areas and more. This is something that is fairly unique to Visual FoxPro rather than VS environments that don't really have the concept of a work area. In Visual Basic for example, you retrieve your dataset object, execute your commands separately and basically treat it like an object (this isn't about VB so don't flame me on the basic description).

In Visual FoxPro however, you have the concept of work areas. So when you decide to work on the Customer file, you can say SELECT Customer and that becomes your main "area" that you are working with. This can be extremely handy for a variety of purposes. But coming back to the matter at hand, saving and restoring environments.

FoxPro provides you with a few functions that can tell you what you're working with. If you want to know what table you are currently working on, you can use DBF() to return the full file name or ALIAS() to return the alias of the currently selected table. If no table is open, ALIAS() returns blank. ALIAS() is often used when using temporary alias names as shown here:

lc = SYS(2015)
SELECT * FROM CUSTOMER INTO CURSOR &lc
SELECT CUSTOMER
SELECT &lc
...

Why would someone do that? Hard to say - a cursor is after all a temporary name (existing in memory only) but if you are having a rough time coming up with unique names, SYS(2015) always works well.

But Visual FoxPro also has a SELECT() function that returns the current work area. When you first start VFP, you are in work area 1. If you want to select the next unused area, you can say SELECT 0 or type in USE INVOICES IN 0.

So as with all things Fox, there are a number of ways you can accomplish a task, and often the most obvious way may not be quite what you want.

I was recently reviewing some code that was attempting to store and restore the environment. The code used the ALIAS() function.

lcSelect = ALIAS()
SELECT 0
USE xxxxx
** do some other stuff
SELECT &lcSelect

Works great, right? Wrong. This code assumes that lcSelect does have a value in it. If there was no table currently open, lcSelect would be empty. As a result, the final SELECT statement would say "SELECT " - which generates a syntax error.

The smarter approach is to use the SELECT() function. SELECT() returns a work area number and will always (?) give a value greater than 0 but even if it returned 0, SELECT 0 IS a valid function.

Update: As Colin Nicholls noted in the comments, if you use SET COMPATIBLE ON, SELECT() doesn't work the same. (it returns the number of the next unused area - kind of like saying SELECT 0) Instead, use SELECT(0) to be sure you're getting the correct result. Thanks Colin - shows how much I use SET COMPATIBLE.

lnArea = SELECT(0)
** do my code
SELECT (lnArea)

This code won't error out the same way the SELECT (lcArea) does .

It also returns code using the EVALUATION parentheses which is somewhat faster than the & approach.

For many experienced developers, this may seem obvious - but if you're just starting out working in FoxPro, the concepts of work areas may seem a little foreign and you feel better relying on the alias. Don't - work areas are your friends and SELECT() is a very handy function to keep in mind.

Monday, April 17, 2006

Big Continent, Small World Indeed

Ken's recent post does a great job of covering some history of names recently joining the Microsoft Live world (via FoxPro, xBase and by all strange coincidence, Antarctica.)

Hmmm....don't know why but I almost see a funny viral version of March of the Penguins in there somewhere...

Developer Abstraction: Read this article

Ted is talking about Joel Spolsky's latest article as is Jamie Osborn and there's no reason why every developer or manager involved in the software business today shouldn't.

Maybe standing meetings should be the way every meeting should be conducted.

Ted - I agree. Between Joel and Eric Sink, they have some of the most insightful articles on the web (for developers) today.

Thursday, April 13, 2006

Doug Bliss on Meetings

Doug Bliss has been doing a great job recently of coming up with posts all about the development PROCESS and how meetings, charts , and user stories can affect it.

His latest one is a short but effective read on Standing meetings, identifying that the meeting should be just that: short BUT effective.

Great reads.

Visionpace: A few thoughts on standing meetings

Wednesday, April 12, 2006

Basecamp API in XHTMLized

This is totally cool! I hadn't heard earlier of Campfire but was a huge fan of BaseCampHQ. This was originally noted on the BaseCamp site but I've linked to main version.

But the way it automates everything totally rocks.

One outside email creates the topic, the todo list for everyone to react to.

futuretrack5 | Basecamp API in XHTMLized

What Are You Doing on that computer?

Classic blogger quote:
Finally, a little story for you: At 11:00 pm a few weeks ago, my wife asked me, “What are you doing?” I wish I could have said, “Making money.” Instead I told her, “I'm changing the world, 15,000 people at a time.” To which she deadpanned, “Oh, you're blogging again...”

Bona tempora volvantur--by Guy Kawasaki: The First 100 Days: Observations of a Nouveau Blogger

No More FrontPage

"After nine years of being an award-winning Web authoring tool, FrontPage will be discontinued in late 2006. We will continue to serve the diverse needs of our existing FrontPage customers with the introduction of these three brand-new application building and Web authoring tools using the latest technologies, Microsoft® Office SharePoint® Designer 2007 for the enterprise information workers, Microsoft® Expression™ Web Designer for the professional Web designer and Microsoft® Visual Studio 2005 for the Web developer." Linked here

News Of Interest from AKSEL Solutions: The next generation of Microsoft Web authoring tools

The FoxShow Returns

The FoxShow returns from a 2 1/2 month(!!!) absence with an Intervie with Rod Miller.

Who's Rod Miller? He works at DBI Technologies who recently announced that they would be including some of their ActiveX components with Visual FoxPro Sedna.

The interview discusses the controls included in the update as well as how developers can start getting involved in using them (hint: the trial versions are unlimited with a nag screen).

I'll be covering some of the controls in a series of updated white papers on them. I covered them back in 1999 (wow - 7 years ago) for FoxPro Advisor (one summary article is here) but I'll put my new reviews on them into my white papers repository.

Monday, April 10, 2006

Beware of Using AutoComplete for everything

(note: Yes, I know the first version refered to using .T. - it's been updated)

VFP's AutoComplete feature totally rocks. You turn it on and you've immediately provided a valuable tool for any data entry application where repetition is almost always a way of life. So valuable that you might be tempted to turn it on in your base text box class. In a word (ok it's a contraction so maybe two words) , don't.

The reason? AutoComplete works with password fields.

Huh?

AutoComplete has several properties but the most common one is simply to set AutoComplete property to a value other than 0. When this happens, FoxPro "magically" remembers the previous entry and recalls them in a selectable list each time the user comes back into it and enters the same first letter.

This "magic" isn't all that special : default, the file AUTOCOMP (located in your application data folder or current folder for runtime) contains 7 fields: source (the object name), data (the value entered), count (number of times used), weight (if using the value of 4 for AutoComplete), Created timestamp, Updated timestamp and a custom user field. When you enter the key, FoxPro looks into this table (which you can change by specifying the AutoCompTable property) for the object name (which may be overridden with the AutoCompSource property) and then displays it.

The real problem? AutoComplete still runs even when the PasswordChar property is set.

PasswordChar is the property that changes all of the text entered into a text box into that character (typically a star). While you can still refer to the Value property to refer to what the user entered in, the user can't see it directly - it appears like a "password" would in "*****".

BUT if you have AutoComplete set to work (a value of 1,2,3,4) , FoxPro continues to think you want that extra feature turned on. So you have a form prompting for a password, and if your password was FoxPro, as soon as you enter F, FoxPro shows up in the list (not hidden behind the Password character).

Now, in most cases, a developer may have their own txtPassword class or something similar, but it may still be based on a common text class.

Does using AutoComplete make for a good User interface? It's hard to say - many users like it - while others may find it distracting. However, just "trying" it in your application will make this definitely unwanted effect appear.

Consider yourself warned.

I wonder if it's the same with other languages...

Rick: FoxPro Rocks Parsing Data

Oh yeah! I had a similar case recently only I had to create a database from about 5 different versions of the same catalog document. The time was a bit different due to manual checking and inconsistent terminology but I could only imagine how much time it would take for a non-VFP developer to do the same.

I wonder how many companies have documents that should really be databases? I'll bet that number is huge.

I know that once all data is saved as XML, it won't make THAT much of a difference, right? (at least that's what we keep getting told - nudge, nudge, wink, wink)

I think when that finally happens, a whole series of new tools wil be needed. I noticed on SednaX, someone was asking for something similar to the BizTalk Document Manager. That tool is very cool but, in my mind, still overly complicated for what some people want or need to do. Maybe there is a need for a lower-end VFP tool to do something similar - in effect, it becomes an automated XSL generator. I know there are some XML tools out there (XML Spy I believe or XML Studio) that do it - anyone have any success with them?

But until all documents are done in XML (which means everyone has to upgrade to a future version of Office or get off the Upgrade Train), there's really only one tool (that I know of) that totally rocks. Any ideas as to what that might be?

Shedding Some Light: FoxPro Rocks Parsing Data

Friday, April 07, 2006

CodeKeep: Snippet Repository

Saw this on Scoble originally linked by James.

It's funny - back 15 years ago, snippets were a term that was fairly unique to FoxPro (snippet editor was the one of the most commonly used terms in the 91 devcon). It's not just the technology and experts that have made their way through Microsoft - it's also the terms! (disclaimer: I'm sure snippets weren't just for VFP but they seem to have really found their way into VS in a big way with 2005)

It even has FEEDS! - where's the VFP feed? (I've asked for one - currently they don't have one - for shame!!)

Now where can this go? Imagine having an Intellisense script that reads the feed and allows you access to Web-based snippets, even better than those found in Visual Studio 2005 (one of my favorite features) - oops - they already have an add-in architecture for Visual Studio!

CodeKeep : Home

Thursday, April 06, 2006

How I Work (reduxe)

Hey, looks like Eric is trying one-up Bill. (I saw the Bill story via Robert as well but this one was easier to find).

All I can say is congratulations on getting rid of all the paper. I wish I could do that. My desks always seem to be covered with paper or MSDN dVDs.

Love the names of the servers. So who's next?

Eric den Doop : How I Work: Eric den Doop

The User Is Always...uh....

Great response to the "The User Is Always Right."

Maybe I would redefine this to say "The user always needs to be heard" or maybe "understood"

Great response.

Tuesday, April 04, 2006

VFP to UML

Hmm....Dave Ballard is proposing an opensource tool to analyze VFP projects and convert them into XMI, which is a fairly open UML standard.

This would be fairly cool - especially since very few that I know of use Visual Modeler, Visual UML and Rational Rose is just too darn expensive.

Importing an XMI into Visio would be very cool.

My question would be: why not include this into SednaX?

OpenTech :: View topic - VFP to UML

Monday, April 03, 2006

OK Rick - I'm a little envious

Rick Schummer recently did a TechSmith field trip and posted about it yesterday.

I'm a little envious - I am a big fan of Camtasia and loved learning about his little trip.

Only one thing, Rick - did you actually get to see Morae in use? I'm excited about trying it but I'm too far along on my own app right now to put it into the dev process but I would LOVE to hear about it in use.

What Happens when Analysts have too much time on their hands

BugBash is awesome.

Has this ever happened to you? I'm not discounting use-case scenarios and the like, but sometimes analysts and managers go way too far trying to "describe" the environment about their needs instead of actually defining the need itself.

These people need training in elevator speeches. Maybe a similar approach would work for better analysis: if you can't describe the problem or solution in 30 seconds or less, then maybe you need to rethink the issue.

As I weed through my various emails outlining problems and solutions, I keep on coming back to it. And lo and behold, Guy just posted something similar about the Executive Summary - no it's not 30 seconds and it's really about "selling" the solution but when you've got analysts and developers living in separate "houses", "selling" does become part of the landscape.

"I have a potential solution - can I convince you that my way is the right way to resolve it, or not?"

Let's not waste time about drawing up sketches and ideas with pretty pictures - if you can describe it, sketch it or give me one thing that explains it in less than a minute, chances are it can be built the way you described.

(and no, I'm not even touch the idea that what you described may not be what you wanted - that's a topic for another day).

Hans' comics do a great job of explaining this in so many ways.

Bug Bash » Archive » Judging by the Diorama

Saturday, April 01, 2006

Happy Birthday Apple

Well, I still haven't been able to switch back yet (due to my love for a certain database that USED to run on a Mac - and yes, I know I can do it with Virtual PC but that's not the same thing) but I still believe in the Macintosh Way and I still have my original Mac Plus sitting in my office ready to play Dark Castle whenever needed.

Funny to think about my first FoxBase+/Mac application. Back then, I had to rely on Compuserve to get online. Thirty years - if you look at the timeline, it actually ends up being only a few major product and innovation highlights and yet the mystique lives on.

I remember back in 1991 seeing how Apple was changing the world of architecture with Paul Wollstencraft (or something similar), showcasing virtual walk-throughs and more. Stuff we're just NOW starting to see come alive again on the web via stuff like Sketchup. Yes, it was still too hard but it was there.

I'm glad Steve is back and in control. When I first saw the Next OS, I drooled. When I saw it build an application, generating the code simply by dragging and dropping before ANY other tool had it - it was like watching magic. He makes Apple deliver innovation (even if the iPod Hi-fi is terribly un-innovative).

Congratulations on making a difference.