Calvin Hsia's WebLog
thoughts from a professional developer
Do you know this feature of the Document View Window?
Open a PRG file with several procedures, functions or methods in the VFP editor. Open the Document...
Author: CalvinH Date: 01/04/2006
What's the difference between Vartype and Type
Happy New Year… I took some time off to spend with my family. To get the type of variable “MyVar”,...
Author: CalvinH Date: 01/03/2006
Open a file that's already opened in the editor
In versions prior to VFP7, if you open a file in the VFP editor, you couldn’t do anything else with...
Author: CalvinH Date: 12/18/2005
Collection as Rowsource in Listbox
Here’s some sample code for a new feature in VFP9: the Listbox Rowsource can be a collection, and...
Author: CalvinH Date: 12/16/2005
Inspect your memory image and see fragmentation
The VirtualQueryEx function can help to inspect the memory of a particular process. It returns...
Author: CalvinH Date: 12/13/2005
GetEnv Environment Variable question
I received a question: Can you explain me the internal behavior of VFP's GetEnv() function. It's...
Author: CalvinH Date: 12/09/2005
What's the greatest invention of all time?
I read this from Raymond, which prompted this post. To qualify for greatness, an invention would...
Author: CalvinH Date: 12/07/2005
Use Named Pipes to communicate between processes or machines
Pipes have been useful for decades for interprocess communication. At a Windows Command prompt, you...
Author: CalvinH Date: 12/06/2005
What is a Microsoft MVP? Calvin's List updated for the new century
In this definition of Microsoft MVP on the Wikipedia is a description of a list that I maintained...
Author: CalvinH Date: 12/02/2005
Using the Databar feature with real data
I received an email with some sales figures in a table. I just pasted it into a new VFP program,...
Author: CalvinH Date: 12/02/2005
SQL Select helps tune a car engine
In this post: Fox helps drag racer win Microsoft Start Something Amazing Award, I wrote about an...
Author: CalvinH Date: 12/01/2005
Recompress your digital pictures to save space
I have 23,000 digital pictures and movies taking many gigabytes of storage from the past decade or...
Author: CalvinH Date: 11/29/2005
DECLARE DLL allows OBJECT type
Before VFP7, it was very difficult to get an object back from a DECLARE DLL call. I added the...
Author: CalvinH Date: 11/28/2005
Are water and salt the only inorganics we consume?
Of all the naturally occurring foods/drinks that humans normally ingest, is it true that all but two...
Author: CalvinH Date: 11/25/2005
Use Regular Expressions to get hyperlinks in blogs
At Southwest Fox conference I presented a sample calling a VB.NET server to do regular expression...
Author: CalvinH Date: 11/22/2005
Eliminating Fire Alarm sound at Chess Tournament Awards Ceremony
My daughter earned a 4th place trophy out of 100 competitors in her division at a chess tournament,...
Author: CalvinH Date: 11/21/2005
Excel's new gradient Data Bar feature is cool: you can do it too!
I’ve seen demos of Excel 12 and it’s conditional formatting Data Bar and thought it was cool. In...
Author: CalvinH Date: 11/21/2005
Fox helps drag racer win Microsoft Start Something Amazing Award
It was very impressive to see a computer using FoxPro helping a 15 year old drag racer win...
Author: CalvinH Date: 11/18/2005
What happens if external code throws an exception?
In VFP, there are many features to call external code, such as ActiveX controls, COM servers,...
Author: CalvinH Date: 11/17/2005
Intentionally crash your program
When developing the Watson error reporting features (see Dr. Watson: Please send in your error...
Author: CalvinH Date: 11/16/2005
Is this a bug in the View Parent Code button?
We received a bug report Steps to Reproduce : 1) Create MyButtonClass1 class of MyButtonLibrary1....
Author: CalvinH Date: 11/15/2005
Collecting pictures for yearbook, Ektaflex
Not even three months of school have passed, and I’ve already received a request for school photos...
Author: CalvinH Date: 11/14/2005
How old is your computer?
You can determine the last time your Administrator password was changed, which could have been the...
Author: CalvinH Date: 11/11/2005
Windows Security and how it affects running generated code
Here I described how VFP generates executable code and runs it for early and late binding COM...
Author: CalvinH Date: 11/10/2005
Load, Call, Character Generators, and "Letter Quality" printers
I remember early versions of FoxPro had the LOAD and CALL commands (try typing them in the command...
Author: CalvinH Date: 11/09/2005
The vTable name is __vfptr in the debugger
When I’m at a breakpoint debugging some C++ code, sometimes I drill down into members of variables...
Author: CalvinH Date: 11/07/2005
What to do with the Bindevent return value?
The BINDEVENT( ) Function allows you to attach code to run when other code is executed. It’s sort of...
Author: CalvinH Date: 11/04/2005
Quiz: Infinite Continued fractions
At the SouthWest Fox speaker dinner we were talking about continued (or infinite) fractions. I posed...
Author: CalvinH Date: 11/02/2005
How does Task Manager determine if an Application is Not Responding?
If you start Task Manager (Ctrl-Shift-Esc) and display the Applications tab, you will see a list of...
Author: CalvinH Date: 11/01/2005
Local vs Private variables
I received a question: As you know most of variables in methods and procedures are local, not...
Author: CalvinH Date: 10/31/2005
My toys over the years
At the Southwest Fox conference, I showed a slide titled “My Toys” I showed the computer, the...
Author: CalvinH Date: 10/30/2005
Customer question: detectan F10 keypress
I received this question: Is there any way to detect an F10 keypress in the KeyPress() event? It...
Author: CalvinH Date: 10/28/2005
Tools->Options->Dump out settings changed
Try this: ACTIVATE WINDOW "debug output" Now choose Tools->Options. Shift-Click on OK You’ll see...
Author: CalvinH Date: 10/27/2005
Why did I get an error while publishing Photos?
I was publishing some photos/movies of my 27 month old son taking ski lessons (see Sharing Digital...
Author: CalvinH Date: 10/26/2005
Database Events in Stored Procedures can have default code
Try running this code: CLOSE DATABASES all CREATE DATABASE test MODIFY DATABASE nowait Now choose...
Author: CalvinH Date: 10/25/2005
Do you know everything about Factorials?
When I was in 7th grade at Amity Junior High School in Orange Connecticut, I gave a presentation on...
Author: CalvinH Date: 10/24/2005
Optimization question from a reader
I received a question: …I've always been curious about code like this: IF wParam=ASC("a")...
Author: CalvinH Date: 10/21/2005
How to hook command window keystrokes
A customer asked how to hook events for the command window. The sample below uses BINDEVENT to hook...
Author: CalvinH Date: 10/20/2005
A Visual Basic COM object is simple to create, call and debug from Excel
At the SouthWest Fox conference in Phoenix I asked “How many people have Visual Studio?” Almost...
Author: CalvinH Date: 10/19/2005
Replace VFP Native dialogs with your own
I wrote a sample while developing the MENUHIT feature that shows how to replace a native VFP dialog....
Author: CalvinH Date: 10/17/2005
Ctrl-C to capture MessageBox and dialogs
There was a tip at SouthWest Fox conference attributed to Drew Speedie. Ctrl-C on an error dialog...
Author: CalvinH Date: 10/17/2005
Run the wizards modelessly
Most of the wizards that are shipped with FoxPro are modal forms. You can run them Modelessly, which...
Author: CalvinH Date: 10/11/2005
Why can't I browse my table?
You can open a table with a UNC path in it, such as USE \myserver\myshare\path\table or USE...
Author: CalvinH Date: 10/07/2005
That was the worst natural disaster to hit the US
A coworker’s family was hit hard by Katrina. She’s collecting donations in our cafeteria today and...
Author: CalvinH Date: 10/06/2005
Find out when your password expires
I didn’t like to get the warning that my password expires 14 days before. I like to wait til the...
Author: CalvinH Date: 10/06/2005
What is the workarea alias when a trigger is executed?
When a trigger fires, VFP code is executed. What is the workarea while executing that code? CREATE...
Author: CalvinH Date: 10/05/2005
DynamicBackColor
A customer asked about how to change the colors in a grid dynamically. The code below changes the...
Author: CalvinH Date: 10/04/2005
String Optimization: More detail
In the prior post (String Optimization. How does it work?) I described an optimization of how the...
Author: CalvinH Date: 10/03/2005