<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">David Fung</title><subtitle type="html" /><id>http://weblogs.foxite.com/davidfung/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.foxite.com/davidfung/atom.aspx" /><generator uri="http://communityserver.org" version="2.0.60217.2664">Community Server</generator><updated>2006-07-28T13:55:00Z</updated><entry><title>FarPoint Spread 7</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2008/06/28/6344.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2008/06/28/6344.aspx</id><published>2008-06-28T11:53:00Z</published><updated>2008-06-28T11:53:00Z</updated><content type="html">Recently I have a project which
requires a grid more powerful than the one comes with VFP.  So I
begin to research on 3rd party ActiveX COM grid controls. 
Eventually I purchased a copy of FarPoint Spread 7
(http://www.fpoint.com/products/spread/spread.aspx).

How I know of FarPoint Spread 7?  A
while back while I was taking up the task of maintaining an existing
VB6 project, I found out the original programmer used an old version
of FarPoint Spread.  My client doesn't have the source disk...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2008/06/28/6344.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=6344" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Excel 2007 and DBF</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2007/11/28/5434.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2007/11/28/5434.aspx</id><published>2007-11-28T19:21:00Z</published><updated>2007-11-28T19:21:00Z</updated><content type="html">To continue the saga from my previous post (Excel Event Binding), the custom application I wrote for my client is now running happily with Excel 2003 after implementing those new event handlers to satisfy Excel 2003.&amp;nbsp; So far so good.&amp;nbsp; But that is not the end of the story.New computers at my client site come with Office 2007.&amp;nbsp; (I don't know where you can buy Office 2003 anymore.)&amp;nbsp; Excel 2007 again has some new events that need to be handled:WorkbookRowsetCompleted()AfterCalculate()After...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2007/11/28/5434.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=5434" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Excel Event Binding</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2007/11/12/5398.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2007/11/12/5398.aspx</id><published>2007-11-13T06:43:00Z</published><updated>2007-11-13T06:43:00Z</updated><content type="html">I do a fair amount of Excel Automation work for my client.&amp;nbsp; This time I would like to use Excel as an external editor to compliment the VFP built in grid, i.e. instead of using the grid to edit data, the user can say click a button to start up Excel and use Excel to edit the data, when they close Excel after editing, somehow the edited data will be wrriten back to the grid.&amp;nbsp; This way the user can use the multi-cell copy and paste feature of Excel among other useful features of Excel.In...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2007/11/12/5398.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=5398" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>The Language C</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2007/09/05/4860.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2007/09/05/4860.aspx</id><published>2007-09-05T23:14:00Z</published><updated>2007-09-05T23:14:00Z</updated><content type="html">The language C is behind a lot of fundamental technologies such as Linux, apache, device drivers, internet protocols, etc.&amp;nbsp; The first version of BitTorrent is written in Python and Python is written in C.&amp;nbsp; Ruby on Rails is written in Ruby and Ruby is written in C.&amp;nbsp; Yet most of us is not concerned when will be the next major version upgrade of the Language C.&amp;nbsp; Why? What makes C so powerful is that we can write libraries (in C) to extend C.&amp;nbsp; Similarly in the case of Perl, it...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2007/09/05/4860.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=4860" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Disappearing Excel Data Validation</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2007/05/25/3858.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2007/05/25/3858.aspx</id><published>2007-05-26T06:54:00Z</published><updated>2007-05-26T06:54:00Z</updated><content type="html">The other day I have some records from a DBF that need to be exported to an Excel file.&amp;nbsp; I also need to add some list-based data validation in Excel via automation.&amp;nbsp; I am using VFP9 and Excel 2002.&amp;nbsp; Below is basically what I do.
export to c:\sheet.xls type xl5loExcel = createobject('Excel.Application')loExcel.Workbooks.Open("c:\sheet.xls")loExcel.Columns("H").Validation.Add(xlValidateList, xlValidAlertStop, ...)loExcel.Activeworkbook.Save()loExcel.Quit()
I had verified the above...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2007/05/25/3858.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=3858" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Passing a parameter object to a form</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2007/03/29/3579.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2007/03/29/3579.aspx</id><published>2007-03-30T02:34:00Z</published><updated>2007-03-30T02:34:00Z</updated><content type="html">We can pass info to and retrieve info from a form like this:
&amp;nbsp;&amp;nbsp; DO FORM WITH arg1,arg2 TO result
which is similar to calling a function:
&amp;nbsp;&amp;nbsp; result = FORM(arg1,arg2)
When I am developing a form, I often need to change the number of input and output arguments, which means I need to constantly adjust the form calling interface.&amp;nbsp; 
By using a parameter object as an input/output mechanism simplifies it like below:
local loParamloParam = createobject('empty')addproperty(loParam,'input',"input_value")addproperty(loParam,'output')do...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2007/03/29/3579.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=3579" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>A class to encapsulate ON ESCAPE</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2007/03/15/3453.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2007/03/15/3453.aspx</id><published>2007-03-16T06:13:00Z</published><updated>2007-03-16T06:13:00Z</updated><content type="html">Often times I need to break out from a loop if user hit the escape key.&amp;nbsp; In order to do that, will have to:

Save the existing state of the SET ESCAPE 
Set up ON ESCAPE 
Restore SET ESCAPE afterward
To those not familiar with VFP commands and how VFP does things, it may be difficult to figure this logic out.&amp;nbsp; I have&amp;nbsp;encapulated all this into a class to make it easier to&amp;nbsp;understand what is happening.
&amp;nbsp;loEscToAbort = createobject('syEscToAbort')&amp;nbsp;for i = 1 TO infinity&amp;nbsp;&amp;nbsp;&amp;nbsp;...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2007/03/15/3453.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=3453" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Automating Installer Build Process</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2007/03/01/3390.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2007/03/01/3390.aspx</id><published>2007-03-02T00:34:00Z</published><updated>2007-03-02T00:34:00Z</updated><content type="html">I use INNO Setup to build the installer for my app.&amp;nbsp; I like to show the version number (from the version resource in the compiled EXE) and the built date in the installer as show below:
 
Since INNO Setup is script based, that can easily be done as below:
 
But I don't want to manually update the INNO script every time I have a new build, so I automate it.&amp;nbsp; I already have a make.prg which I run to build my project, all I have to do is to enhance it to update the version and timestamp...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2007/03/01/3390.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=3390" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Backward Compatible</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2007/02/05/3244.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2007/02/05/3244.aspx</id><published>2007-02-06T04:41:00Z</published><updated>2007-02-06T04:41:00Z</updated><content type="html">I am always fascinated by the backward compatibility of VFP, and that really helps me to do my job with much less headache.&amp;nbsp; I am a solo developer who not only have to build the app, but also have&amp;nbsp;to support it.&amp;nbsp; Being backward compatible make it possible for me to gradually "upgrade" my app at a pace that my client and I can afford.&amp;nbsp; SET BEHAVOIR allows you to control the feature globally, where as individual commands such as REPORT FORM allows fine-grained control.&amp;nbsp; 
I&amp;nbsp;"re-use"...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2007/02/05/3244.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=3244" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Two faces of an application</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2006/10/28/2770.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2006/10/28/2770.aspx</id><published>2006-10-28T20:43:00Z</published><updated>2006-10-28T20:43:00Z</updated><content type="html">
I have two different VFP apps running at a client site.&amp;nbsp; One is a frontend desktop app that the
end-users use, and the other one is a backend maintenance app.&amp;nbsp; The maintenance app runs at night to do a set
of system maintenance jobs.&amp;nbsp; It has no
frontend and if there is anything needing attention, it will email the
technical support personnel for further investigation.





I developed these two apps separately, i.e. they belong to
two different projects.&amp;nbsp; In the...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2006/10/28/2770.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=2770" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Use Excel to repair DBF</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2006/10/03/2577.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2006/10/03/2577.aspx</id><published>2006-10-03T23:55:00Z</published><updated>2006-10-03T23:55:00Z</updated><content type="html">My app has to deal with a lot of DBF which sometimes get
corrupted.&amp;nbsp; Upon checking, the corruption is most likely due to
some additional bytes after the logical end of the file.&amp;nbsp; The
problem is VFP9 refuses to open it with error 2091:

Table "name" has become corrupted. The table will need to be repaired before using again.

It always puzzle me why VFP does not any built-in DBF repair command
(not even the simple one) although it has a native DBF engine.

Lately the frequency...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2006/10/03/2577.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=2577" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>When a report is printed</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2006/09/13/2462.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2006/09/13/2462.aspx</id><published>2006-09-13T18:24:00Z</published><updated>2006-09-13T18:24:00Z</updated><content type="html">I would like to do something (update a table) when a report is printed from the preview windows.The old way of setting a variable in the report and checking it afterward does not work with an object-assisted report because sys(2040) is not designed to work with the new behavior of the new reporting mechanism of VFP9.llPrinted = .f.REPORT FORM xxx TO PRINTER PROMPT OBJECT TYPE 1IF llPrinted&amp;nbsp;&amp;nbsp; ? "Printed"ENDIFand in the report set llPrinted to .t. if sys(2040)="2".&amp;nbsp; llPrinted is always...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2006/09/13/2462.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=2462" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Data Explorer and Sorting</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2006/08/19/2275.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2006/08/19/2275.aspx</id><published>2006-08-19T13:57:00Z</published><updated>2006-08-19T13:57:00Z</updated><content type="html">I use Data Explorer (DX) to browse a SQL Server 2000 database in a project.&amp;nbsp; If I don’t select Sort Objects in the SQL Connection Properties dialog, then I get a list of all the SPROC in random order when I expand the stored procedure node.
&amp;nbsp;

&amp;nbsp;
If I select Sort Objects, then I get an empty list!
&amp;nbsp;

&amp;nbsp;
Northwind does not have this problem.&amp;nbsp; Only my database has this problem.&amp;nbsp; So I dig into XSource and narrow down the problem to this line of code in SQLDatabaseMgmt.OnGetStoredProcedures()...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2006/08/19/2275.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=2275" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>Distributable Command Window</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2006/07/30/2141.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2006/07/30/2141.aspx</id><published>2006-07-30T08:13:00Z</published><updated>2006-07-30T08:13:00Z</updated><content type="html">Adel Gharib has submit a tip of the month in Advisor Guide to Visual FoxPro July 2006 issue to create a distributable command window which can be embedded into a compiled VFP exe.&amp;nbsp; I have worked on Adel's tip and package the code into a class (commandprompt of sysadmin.vcx).
I use the ACCEPT command instead&amp;nbsp;of&amp;nbsp;the INPUTBOX command suggested by Ceil because it acts more like a command window that way.&amp;nbsp; And a form is used as the input/output service.&amp;nbsp; 
To open the command...(&lt;a href="http://weblogs.foxite.comhttp://weblogs.foxite.com/davidfung/archive/2006/07/30/2141.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=2141" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry><entry><title>MySQL GUI frontends</title><link rel="alternate" type="text/html" href="http://weblogs.foxite.com/davidfung/archive/2006/07/28/2130.aspx" /><id>http://weblogs.foxite.com/davidfung/archive/2006/07/28/2130.aspx</id><published>2006-07-28T12:55:00Z</published><updated>2006-07-28T12:55:00Z</updated><content type="html">&lt;P&gt;I haven't done any client/server work with VFP yet but plan to do so.&amp;nbsp; I am thinking of should I use MSDE or MySQL.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;MySQL now has GUI frontends similar to Enterprise Manager and Query Analyser.&lt;BR&gt;&lt;BR&gt;MySQL Admin&lt;BR&gt;http://www.mysql.com/products/tools/administrator/&lt;BR&gt;&lt;BR&gt;MySQL Query Browser&lt;BR&gt;http://www.mysql.com/products/tools/query-browser/&lt;BR&gt;&lt;BR&gt;I haven't tried them yet but their screenshots look promising.&amp;nbsp; With these tools, it would be easier to do ad-hoc maintenance job at the client site.&amp;nbsp; This is a plus for MySQL.&amp;nbsp; On the other hand, MSDE does not come with any&amp;nbsp;GUI front end, so it will be more difficult to manage it at the client's site, which is a factor that I will consider which one to pick.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://weblogs.foxite.com/aggbug.aspx?PostID=2130" width="1" height="1"&gt;</content><author><name>davidfung</name><uri>http://weblogs.foxite.com/members/davidfung.aspx</uri></author></entry></feed>