Run your code in response to a new drive being inserted

Filed Under (Visual FoxPro) by WildFire on 17-11-2004

Run your code in response to a new drive being inserted.

More FoxPro WebRAD Tools

Filed Under (Visual FoxPro) by WildFire on 15-11-2004

Almost two weeks ago, I mentioned about how VisualFoxpro is ‘powering up’ the back end of some online sites. Today, Chan Kot Kiet points out more FoxPro WebRAD Tools.

Craig articles and Kevin McNeish

Filed Under (Visual FoxPro) by WildFire on 14-11-2004

Craig Berntson uploaded two articles from his Southwest Fox sessions: Introduction to Object Oriented Programming and Using the Windows Event Log from Visual FoxPro (pdf format).

Kevin McNeish enters the blogosphere. The ‘Did You Know’ section looks informative.

Saturday Foxpro Links

Filed Under (Visual FoxPro) by WildFire on 06-11-2004

F1 Technologies, creators of Visual FoxExpress (here’s a what’s new in VFE8 overview (remember that coder with a fox tail image..?)) supports Active Foxpro Pages.

Here’s the press release.

F1 Technologies also sponsored Code Focus Magazine which highlights the new features/enhancements in Visual Foxpro 9. If you haven’t downloaded it yet, or you are a non-Foxpro user, this free PDF download is a good read for you to discover a little or so about Visual Foxpro.

Using File Mapping to enumerate files opened by Visual FoxPro from News2news.com/VFP. If you’re planning to use Win32 APIs on your application, this is the site to go. (via Alex Feldstein)

More Win32 API on VFP information. (Source: Fox.wikis)

From the creator of TaskPane Central, OpenTech Forums, ProFox Mailing List and the co-creator of DaboDev comes the ReportListener HQ from Ed Leafe.

West Wind Web Connection 4.60 released… and a Web Configuration Utility that comes along with it.

Recursion in VFP, Low Level File Functions, How the SECONDS() function works and more Visual FoxPro Links.

The lack of posts…

Filed Under (Random.scribbles, Visual FoxPro, work.BLOG) by WildFire on 03-11-2004

Beakman was wondering why I was not posting for the past three days before yesterday.

And just recently, I received a related inquiry from someone in India.

Aside from the fact that I refrain from posting those I’ll-be-out-in-N-days/weeks-no-blogs-blah-blah(who-cares-who-fsckin’-cares) type of scribbles in here, I am also finishing up modules for two of my projects… HRAEI and SJH.

(HRAEI is an employee-related databanking system (201) for education-type institutions and companies while SJH involves medical history and records.)

HRAEI, in the future will probably be used in some places in this country separated by islands, so making things ‘archipelago-ready’ is something I am planning in advance. I’ll discuss that one later.

For those three days, I’ve been extending the working hours to 4:45AM instead of the usual 3AM limit… which was really 5:30AM since it was only yesterday that I discovered that the clock in this computer is 45 minutes late.

No wonder I’m beginning to see things.

But I created and posted a one-time blog at TheSpoke.NET. The reasons are there so I won’t bother re-posting things in here. If I’ll do that, we’ll have this spaghetti-type of codes already.

Blogs are like Procedures and Functions you know. Well at least that’s how I see it sometimes. Instead of answering queries again and again, I fire up this blog, post some info and link the one questioning to a certain part of this blog that answers his questions.

OK… it is 3:33AM already… I need to crash.

But before that, allow me to leave you one snippet of the dawn:

   do while not eof() 
for i = 1 to nCount
cSTAT = 'PERSPOGR.STATUS' + NUMTOSTR(i, 2)
cSTAL = 'PERSPOGR.STATUS_' + NUMTOSTR(i, 2)
aSTAT(i) = &cSTAT
lStat = iif(aSTAT(i) != '00000', .T., .F.)
replace &cSTAL with lStat
endfor
skip
enddo

One of those little macro hacks of the night. (Storing the values in the array has some purpose which is not included anymore in the above snippet.)

I’m just showing here how an nCount*N lines of code can be squeezed into a factor of nCount by using macro substitution and by having good naming conventions in your field names, object names and variables.

WildFire here… over and out.

A FUNNY mac video

Filed Under (Random.links, Visual FoxPro) by WildFire on 02-11-2004

Here’s a funny Mac video. (Sorry Apple-lovers (via Rod Paddock’s Blogs))

Foxpro and the net

Filed Under (Visual FoxPro) by WildFire on 02-11-2004

Calvin Hsia: Creating, Parsing, Graphing Web Hit Log Files or Other Temporal Data.

Yes… VisualFoxpro can do web-related stuff. Foxite.com, UniversalThread.com, West-wind.com and Calvin Hsia‘s site are a few examples that use VFP as part of their backends.

Also, from the limited test I made, the fox-powered sites are even faster than those sites powered by ASP.NET (Again, stress on the ‘limited test’).

Plus there’s Active Foxpro Pages too.

I must admit though… some PHP-powered sites and forum I’ve been to, load faster than their .asp and even .cgi/perl counterparts. But then again there are a lot of factors to consider here.

Southwest Fox Conference

Filed Under (Visual FoxPro) by WildFire on 27-10-2004

Southwest Fox Conference information at UniversalThread and FoxBlog.

It’s about time the Filipino Foxpro developers should start organizing one. There are still a lot of big companies including malls, supermarkets, telephone companies and government offices that rely on Visual Foxpro here in this country of ours.

How To Synchronize Data Displayed on Two Different Forms

Filed Under (Visual FoxPro) by WildFire on 25-10-2004

How To Synchronize Data Displayed on Two Different Forms.

Joel Spolsky talks… Microsoft listens.

Filed Under (SoftDev (non-VFP), Visual FoxPro) by WildFire on 25-10-2004

Here’s an advanced debugging approach from Calvin Hsia.

I don’t know… during my first job after college we were trained in the hardcore-cool-iold-schoolic approach of debugging things sans the debugging tools and watch windows. Just plain source code tracing and… cursing.

Of course you’ve heard already of that now-a-classic ‘How Microsoft Lost the API War‘ blog/essay from Joel Spolsky. Now here’s another Joel Spolsky interview from Microsoft-Watch.com.

For free lance programmers like me, reading information that tackles the ‘behind the scenes’ and/or politics of software company helps in a lot of ways.

Combo Box Filter Issues

Filed Under (Visual FoxPro, work.BLOG) by WildFire on 18-10-2004

Imagine you have a combo box.

This combo box holds (and displays) the ‘NAME values’ which are records in database F but returns the ‘IDNO values’. (I’ll explain the logic behind this on a different post… later.)

Database F contains only those two fields: the ‘NAME values’ which are mostly items/descriptions and its corresponding ‘IDNO values’ (or CODE or CODENUMBER whatever you prefer, lovely-lady-of-mount-lithsoma).

Now you ‘morph’ your combo box so that the text part would accept manual character entries and automatically filters the DropDown Items after its InteractiveChange event is triggered.

Now here’s the question…

If the user types, let’s say… the characters ‘CHART’, would you filter all the records having the string ‘CHART’ in it or just the records starting with the ‘CHART’ string?

In other words would you:

set filter to cBUFFER $ (upper(alltrim(DBASE.NAMEVALUE)))

… or would you:

set filter to cBUFFER $ substr(DBASE.NAMEVALUE, 1, nLEN)

… given that:

cBUFFER = upper(alltrim(this.Text))
nLEN = len(alltrim(cBUFFER))

Just some little issues I’m pondering on at 2:30 in the morning.

(And I am so tempted already to activate the comments feature of this blog.)

Saturday VisualFoxpro Links

Filed Under (Visual FoxPro) by WildFire on 16-10-2004

Almost every VisualFoxpro RSS feeds in my aggregator are pointing here. It is the Visual FoxPro 9.0 Beta Help Refresh, an update to Visual Foxpro 9.0 Beta which was released 0100 months ago.

Here are some VFP9 Beta Samples and .NET Samples for Visual FoxPro Developers to fire you up.

And while you’re there do check Ken Levy’s October 2004 – Letter From the Editor.

Interested to see more Foxpro DevCon 2004 pics? There’s more here and here. (Photos courtesy of Igor Vit and Alex Feldstein)

Andrew MacNeill discusses a cool new feature from VFP9: MAKETRANSACTABLE() while Doug Hennig mines gold in XSource (a must read for serious VFP developers).

Proof-12091.0297644588

Filed Under (Visual FoxPro) by WildFire on 13-10-2004

Proof-12091.0297644588 that the Fox is still very much alive.

That’s CrimeStar. I would refrain from mentioning that ‘The Military’ is also using Visual Foxpro until I can find the article link here in this vault archive of mine.

A number of high profile companies that use VisualFoxpro are listed here. (DOD was mentioned)

And here’s a longer list from inside Fox.wikis.

Here in the Philippines I know a handful of respected companies/institutions that are using VisualFoxpro.

Quite sad though that the academe seldom include this legendary and elegant+fast+data-centric PL in their curriculum.

Even our National Bookstore don’t have Foxpro books in their shelves.

Still… no worries, dude.

Foxpro links and being ‘normal’

Filed Under (Random.scribbles, Visual FoxPro) by WildFire on 11-10-2004

Your daily dose of VisualFoxpro articles:

Beakman and I once in a while talk on Y!IM about programming concepts, nationalis-tech principles, alien abductions, VB versus VFP stuff, old school programming versus programming approaches of the future, changing RP through techblogs, computer science education and a lot more.

Tonight we were discussing about programming moods. Particularly about me not being ‘in the zone’.

You know those type of days where you can’t pull your arse to code. The not-in-the-mood-to-code moments. And I was asking Beakman how he handles these kinds of situations.

Of course being the athletic person that he is, he recommended jogging, playing basketball… even badminton… getting some rest and gym (ewrk!)

Yes he is more disciplined than I am.

The talk was enlightening until he scribbled out these words:

‘Try to act as a normal person.’

Damn. That must have been the best advice I had in months.

You | Post a comment

Video Capture API (VFP with source code)

Filed Under (Visual FoxPro) by WildFire on 10-10-2004

Video Capture API (using Visual Foxpro)

This set of API functions provides applications with a simple, message-based interface to access video and waveform-audio acquisition hardware and to control the process of streaming video capture to disk.

In other words, it takes few lines of code to preview video from PC video camera on FoxPro form as well as get single frames or stream video into AVI file.

Link (with Source Code)

And here’s a more in-depth Video Capture Reference from inside the MSDN Library.

Foxpro Devcon 2004 Blog Summary Links

Filed Under (Visual FoxPro) by WildFire on 09-10-2004

One of the highlights from last week was the Visual Foxpro DevCon 2004 which was held in Las Vegas, Nevada from September 29 to October 3, 2004. I’ve collected some Foxpro DevCon-related blogs from this rss aggregator of mine.

As you can see, our beloved robust and data-centric tool is still pretty much alive. Ah yes… Foxpro, the last XBase standing and its legendary Rushmore technology.

VFP SQL verus DO WHILE

Filed Under (Visual FoxPro, work.BLOG) by WildFire on 30-09-2004

172 bugs-to-squash+features-to-code down… 1,161,017 to go. I’ll break from the task for a while and blog a little.

I visited a client yesterday confident that I had tweaked the ILS program to make things faster. I ended up realizing ‘on site’ that things got slower by 1560 folds.

Bad. Too bad really.

Because of some server folder/file-security-related issues, I have to separate the directories that are used for the ILS module (the main library system) and SASM (the book+author+subject+callnum+isbn searching) module that is being used by the students/faculty members in a given library.

Because the tables are normalized (UGH I still have an unfinished discussion blog about normalization), I have to use some VFP SQL queries to gather all the data needed from three separate tables. VFP SQL ((sans the JOIN…. yup using that makes the querying of data turtle-fast (no offense to the turtles)) is still slow.

(More than 30 seconds of query-ing is slow by Foxpro standards (we’re so used to Rushmore’s legendary lightning speed technology)).

For those who are not used to Visual Foxpro, VFP has it’s own ‘native’ SQL functions which can be used without relying on ADODB, OLEDB, ODBC and whatever ODODODODO-database-related-technologies proliferating around.

So to tighten up things a little bit I decided to make a separate ‘gatherer module’ which will be executed on the server/admin part and will be thrown to the student/users PC used for searching instead of slowing down things every time the user ‘SASMs’.

I tried using the VIEWS approach on this one (which apparently uses VFP SQL commands too) but have to withdraw at the last minute since there are some incompatibility issues with some table formats that I’m using and I don’t want to completely dive in without testing things further.

So I decided to just create a different ‘buffer table’ that will hold the fields gathered from these three databases… using the native VFP SQL command. Here’s the code:

cDATABASE = 'BOOKSASM'
set safety OFF
select BOOKS.ACCESSNO, BOOKS.CALLNUM, BOOKS.TITLE, BOOKS.ISBN, ;
BOOKS.BORROWED, min(AUTHORS.NAME) as [NAME], ;
LOCATION.LOCATION ;
from BOOKS, AUTHORS, LOCATION ;
into dbf &cDATABASE ;
group by BOOKS.ACCESSNO, BOOKS.CALLNUM, BOOKS.TITLE, ;
BOOKS.ISBN, BOOKS.BORROWED, LOCATION.LOCATION ;
where ((BOOKS.ACCESSNO == AUTHORS.ACCESSNO) or ;
BOOKS.NUM_AUTHOR == 0) ;
and BOOKS.LIBSECTION == LOCATION.ID
set safety ON

select BOOKSASM
if !file('BOOKSASM.cdx')
index on alltrim(ACCESSNO) tag CBOOIDNO
index on upper(alltrim(CALLNUM)) tag CBOOCALL
index on upper(alltrim(TITLE)) tag CBOOTITL
index on alltrim(LOCATION) tag CBOOLIBS
index on alltrim(ISBN) tag CBOOISBN
index on upper(alltrim(NAME)) tag CBOONAME
endif

close databases
close all

Guess how long it took for that piece of code to process 2224 records in BOOKS.dbf, 2856 records in AUTHORS.dbf and 15 records in LOCATION.dbf?

Well long enough for me to visit another office and install a newly updated AVRCOM module, discuss that module with the user, return and discuss (with the librarians this time) another set of topics from their lovelife to the difference between computer science and other courses with the ‘IT’ letters in it to topics which made me retrieve the baby pictures I have in my wallet.

52 minutes… for that code… for that number of records.

And I did not even include the instances where a conflict with the screensaver crashed the query process that I have to start things all over again, and that I copied the files outside the arms of a burdened Novell Netware 6 server and transferred it to the local drive for faster processing.

52 whoopin’ minutes!

So when I got home. I re-configured the code using a reliable old school approach… DO WHILE/FOR LOOPS + SET FILTER TO.

Here…

select BOOKS	
nCountTotal = reccount()
nCounter = 0
set filter to
set order to CBOOIDNO
go top
do while not eof()
nCounter = nCounter + 1

cAccessNo = BOOKS.ACCESSNO
cCallNum = BOOKS.CALLNUM
cBookTitle = BOOKS.TITLE
cISBN = BOOKS.ISBN
lBorrowed = BOOKS.BORROWED
cLibSection = BOOKS.LIBSECTION

select AUTHORS
set filter to (AUTHORS.ACCESSNO == cAccessNo)
go top
cAuthor = AUTHORS.NAME
set filter to
cLocation = ''

select LOCATION
set filter to
set order to CLOCIDNO
go top
seek cLibSection
if found()
cLocation = LOCATION.LOCATION
endif

select BOOKSASM
append blank
replace BOOKSASM.ACCESSNO with cAccessNo
replace BOOKSASM.CALLNUM with cCallNum
replace BOOKSASM.TITLE with cBookTitle
replace BOOKSASM.ISBN with cISBN
replace BOOKSASM.BORROWED with lBorrowed
replace BOOKSASM.NAME with cAuthor
replace BOOKSASM.LOCATION with cLocation

.cStatusCounter.value = str(nCounter) + '/' + str(nCountTotal)

select BOOKS
skip
enddo

Now guess how long this code processed those 2224*2856*15 (Yes * not + : figure that out).

Less than 15 seconds.

I was even tempted to write an exact time counter after an initial test run but things were so fast that writing that part was not needed anymore.

OK… let me write a code to grab the exact time… wait.

TimeStart: 20:48:46
TimeEnd: 20:48:54

It is even less than 10 seconds!

So tell me… what am I missing here?

(Well aside from the fact that VisualFoxpro is fast and it rocks… everyone knows that already… including VB-lovin’ humans [GRIN])

Repairing Tables and Manual Garbage Collection

Filed Under (SoftDev (non-VFP), Visual FoxPro) by WildFire on 28-09-2004

Wikis-warp: Directions how to repair tables after getting the ‘Not a table’ error messages and Manual Garbage Collection.

CHESTYSOFT has this simple GUI front end for registering DLL and OCX files with REGSVR32.

Hmm… ‘chesty soft’… me likes how it sounds.

Meet Microsoft’s Ken Levy

Filed Under (Visual FoxPro) by WildFire on 26-09-2004

This article about Ken Levy, although quite old already (December 2001), still is a good read and explains a lot of things about Ken Levy and the Fox.