TLC Tools and Utilities

Filed Under (Visual FoxPro) by WildFire on 12-08-2004

TLC: Foxpro Tools and Utilities

Some old-school-ic filterin’ code

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

Early dawn-worm-code snippet:

if .chkMonth.value != 0 .and. !isblank(.cmbMonth.value)
cFilterDate = upper(alltrim(.cmbMonth.value))
cFilterYear = "(year(DATAAMPM.DATE) == year(date()))"
cFilter = "(upper(alltrim(cmonth(DATAAMPM.DATE))) == cFilterDate)"
cFilter = cFilter + " .and. " + cFilterYear
**' cFileName = cFilterDate + alltrim(str(year(date())))

dDate = cFilterDate + alltrim(str(year(date())))
report form Report_AMPM preview for &cFilter
else
cMess = 'Please specify the month first' + chr(13) + ;
'and check the Monthly Report filter'
messagebox(cMess)
endif

One… the above code is not ‘extremely optimized’ and was done around 2:16AM. So get over it.

Two… I’m just testing the preformatted tag and the colors. I recall someone blogging about a tool that ‘autocolorizes’ code in blogs, but I just can’t remember the URL. At two in the morning I don’t want to be involve in any searches.

Three it’s nice to know that the ELSE statement functions as ‘Everything Else’ in most programming language. Foxpro included.

In the above code, given lCondition_01 = .chkMonth.value != 0 and lCondition_02 = !isblank(.cmbMonth.value), the ELSE clause would execute when:

A. lCondition_01 == .F. and lCondition_02 == .F.
B. lCondition_01 == .T. and lCondition_02 == .F.
C. lCondition_01 == .F. and lCondition_02 == .T.

… and not just when A is satisfied. Which if this was done in one of our Math subjects (Automata-related) back in college will be the only basis for the output.

The cFileName line has been weeded out in comments just for the sake of this post. It has been my practice to save and export some filtered queries (‘native Foxpro filter’ and SQL queries) generated by the program to an .xls file.

SMAG visit – 2004.0806

Filed Under (Random.links, Visual FoxPro, work.BLOG) by WildFire on 07-08-2004

Visited a client in Guagua, Pampanga today. Fixed a database corruption on one unit. Installed some ILS module updates. Meet W95.spaces.1445 (I’ve been cataloguing those kinds of meetings and it seems each company I visit cultivates their own ‘pets’).

cEntity = ‘pets’
cSimilarEntity = substr(cEntity, 1, 2) + ReverseString(substr(cEntity, 3, 2))

Introduced OpenOffice.org since they could afford to buy only one licensed copy of Microsoft Office 2003 this school year. Introduced MajorGeeks.com and explained OfficeXP’s save as old format capabilities.

Yes… one of the many advantages of ‘freelancing’ is having more room to educate people… the ‘normal users’ who need more enlightenment. Something you don’t have that much if you’re one of those ‘in-house-type-of-programmers’ here in this country.

Of course I’m not generalizing here. I’ve known some good in-house programmers who do not only excel in what they’re doing, but passionately ‘evangelize’ technological matters as well.

But recently I’ve seen too much work-related grumbling from them. Quite sad.

I am also an ‘in-house programmer’ in my regular job and I tell you there is a big difference.

Freelancers don’t have a boss… or at least we don’t call them ‘boss’ we call them ‘clients’, our time is flexible (or at least we think it is) and we can work in pajamas (not naked… contrary to popular belief, programmers don’t work naked).

You, my friend, are always welcome to the other side of the fence.

Later… 12:31AM and I still have to finish one report for tomorrow’s MILD.client visit.

···

Calvin Hsia shares an overview (and even some codes) on how to catalog and share digital pictures using Visual Foxpro, SQL and .NET. Very informative if you’d ask me. Makes you want to say Kenshin’s ‘There’s nothing I can’t do with this sword’ line.

Replace(LineAbove, ‘this sword’, ‘Foxpro’).

Fine-Tune Your Web Site for Windows XP Service Pack 2.

.NET linkwarp: Hyatt.lu

Ada Lovelace started her blogs. Keep it up, Leigh. Can we expect techblogs from Dennis and Exander too?

Gapingvoid.com is an insightful site. I added it in my aggregator a couple of days ago when I read the How to be Creative post. Number 13 is applicable in the field of software development:

Never compare your inside with somebody else’s outside.

Netcrucible: Sex and Cash

More Sex and Cash theories… probably I’ll post mine in the future.

IMCS.CPanel.DataTransfer Module

Filed Under (Visual FoxPro, work.BLOG) by WildFire on 05-08-2004

02:08AM.

Unholy hour for some… but for me this is the holiest of holy hours. Every thing’s calm and at peace and I can code the way I want. Of course there are those times (especially when the sun is up) when I would prefer coding when U2, Paul Oakenfold, Enigma, NIN or even the soulful music of ColdPlay pounds in my ears… but when the sun decides to dream, I prefer silence.

Ah… enough of these things. I did promise myself to concentrate on work blogs once more. To discuss more programming/freelancing/system-analysis-related issues and insights would be the priority. The info-links you used to see will still be there, probably underneath each ‘work blog’.

So what have I been working on for the past few hours?

IMCS.CPanel.DataTransferModule

What in wakahalarovha’s name is that?

IMCS stands for Integrated Media Center System and CPanel for Control Panel. Like most control panels you see in this world, this module aims to give the user the ‘lowest level access’ to some core parts of the program. Most settings and configuration are in there.

One of my measurements on how ‘good’ a program/system is, lies on how it can stand alone independent of the programmer who created it. If it can run for 7 years or more without my intervention, the hacker-part of this soul would be lust-ified.

That is why the CPanel is there.

Of course certain ‘outside factors’ like operating system variables, upgrades, environment, meteorites, non-thinking management and millions of other factors, pose a great challenge to that ‘independence’. Include some marketing related factors too. But, that would be another blog for now.

It has been my practice too, to make the database systems I develop compatible with a certain client’s other existing database applications. And since the Registrar and Cashiering (which involves different student information-related modules) are already handled in four of my clients by another software development company years before me, I made the Transfer Module as a means to export their databases to my database applications.

Of course I could make use of their database directly inside their own folders, but I prefer using my own re-structured database for a number of reasons.

One’s to be safe. If something happens on their part of the application, the database applications I am maintaining would not be affected. Same holds true the other way around. If corruption or any variation of those things happen, their system would not suffer.

And trust me when I say I don’t want a fellow Foxpro programmer to suffer… especially in my own hands.

Second reason is I am very particular with how I name the fields, the name formats and such. If you maintain several programs, it would be good for you if you’re using your own easy-to-remember conventions which would be hassle-free for you to recall once you switch on your development process to and fro from within your tasks pool.

Third reason involves the way I normalize fields and records. Fields such as Relative01, Relative02, Relative03 and so on is a big no no for me. Well, at least most of the time. This would be a different story though if it is a RelativeGivingOutiPodsandG5sToDevelopers. If this is the case… the more the merrier applies instead.

But following a database system that is not yours is not that easy. Even if both systems are developed in Visual Foxpro and you’re only scratching the database parts.

For one, the other database programmer can change the structure of the database at any point, and you, like me, find yourself re-coding some parts of your program, which in my case, the Data Transfer module.

These occur too especially if the other software development company has more than one programmer who seems to juggle with their field naming convention. CLIENT_01 uses MTELNO and FTELNO for their parent’s phone numbers. CLIENT_02 on the other hand uses MBTELNO and FBTELNO where I suppose ‘B’ stands for Business. Client_01 don’t have equivalent names for those fields. And in this digital world, one bit makes a BIG difference.

Last June, I also found myself in a position where another database structure was change and I cannot even edit it until I open the database exclusively. A feature which I should be adding on the Database Utility Module (equivalent to Clipper’s DBU) I made.

A utility which I will discuss further in another blog… in another time.

���

Good luck, Arctic Team… may you find what you’ve been looking for. Same shout outs to Cassini and the Mercury Messenger as well (472 million dollars for 7.9 billion kilometer journey eh?).

Aloe vera may treat battle wounds. Nah… I prefer peace, unity and discussion. Deal with things the way ‘good’ programmers handle problems. War was never a solution… and never will it be. How come we never learn from the past?

Make way for Doom’s Day instead.

Mark Anthony Panizales is now bloggin’… and Ceazar Ryan Sealana too. If you could remember they were part of the first call-to-blog post of mine. I’ll be posting a second batch of roll calls within the week.

Looks like SCO gets it.

I don’t get it.

Nevermind.

Happy birthday, Neil Armstrong.

Foxpro and CSharp

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

One more cyber-info-data-hoppin’ trail before I fire up some work:

Sometimes I do wonder what the reactions are inside Microsoft everytime pro-Foxpro comments are unleashed. But I’ll be most happy to see more data-centric capabilities inside C Sharp in the future… and happier if its syntax clarity is as good as the Foxpro/xBase models.

Article . Using VFP to call .NET web services

Filed Under (Visual FoxPro) by WildFire on 28-07-2004

Using Visual FoxPro to call .NET Web Services for Data Access (Rick Strahl).

Newsletter . VFUG July 2004 Newsletter

Filed Under (Visual FoxPro) by WildFire on 28-07-2004

The July 2004 VFUG Newsletter is out.

BLOG . css.bcom

Filed Under (SoftDev (non-VFP), Visual FoxPro) by WildFire on 27-07-2004

From Visual-Foxpro-to-.NET-programming-related blogs. (via Aleksoft)

And here’s the link to the RSS feed of the blog above. I presume that most Blogger.com/Blogspot accounts has this default atom.xml feed attached to their ‘home url’.

I am not a hundred percent sure though. But I tried it a couple of times already… and it’s working fine.

Article . VFP and .NET the best of both worlds

Filed Under (Visual FoxPro) by WildFire on 23-07-2004

VFP and .NET: The Best of Both Worlds

There’s a ‘Will There Be a VFP .NET?’ part of that article that is worth delving into.

BLOGS . MFK

Filed Under (Visual FoxPro) by WildFire on 22-07-2004

Here are some Foxpro-powered blogs: Paul McNett, Alex Feldstein and Chan Kot Kiet. I’m still finalizing the blog roll I’ll be placing on the right side of the screen.

workBLOGS . SMAH visit

Filed Under (Visual FoxPro, work.BLOG) by WildFire on 19-07-2004

Against heavy afternoon rains after the morning heat and recovering from last week’s fever and wicked.cough-problems, I visited a client at Hagonoy Bulacan this day. Armed with a printed copy of a _databasestructures-updates.txt I have created which holds the program and database changes by date, I updated the ILS module in that environment.

This file serves as one of my log reference that helps keep my sanity intact. It is a little difficult monitoring database and program updates when you’re maintaining a program with seven core modules in four different clients each with their own requested features, formats, ‘moods’ and countless outside factors.

Things were lighter this time as compared to the rough visit last May 2004 when a new administration was not able to recognize me. In freelance-related quests, facing a new administration is one of the toughest tasks. I’ve been to this experience twice already. Patience have always been a key… and of course, charm.

Yes Earthling… charm is one factor a freelance programmer/developer/system analyst needs. You can partially acquire this by growing your hair long. Nose hair and armpit hair included.

I get to meet too, for the first time the FoxPro programmer who’s working on the Registrar and Cashier applications. They hold the core system of almost every school I ‘freelance’ and the ILS application imports their databases. This was the first time after almost three years of me following their trail of DBCs and DBFs and sometimes leftover PRGs. The programmer was friendly and helpful and even stopped his programming task in that place to create a Novell account for me so that I can access his database. I guess Foxpro programmers just have this inherent respect for each other.

Same holds true probably for VB programmers meeting another like-minded VB dude, Java developers sharing coffee with another Java developer, Delphi-powered minds bumping into one another and so on.

Even assembly programmers probably talking in a cafe with no one else in a five mile radius understanding the things they’re discussing.

I saw him using the VF6 IDE there. Something I seldom do. I can’t seem to work on a computer that is not fully customized, tweaked and morphed according to my preference. But of course sometimes the need forces me to fire up VisualFoxpro and code in a computer which feels alien to me. In one case, I was even faced with a desktop displaying Taiwanese male celebrities. Quite scary if you’d ask me.

I could’ve run my database conversion module on site but it seems that some fields in the database in this school are different from the other schools I have followed. Just one letter differences in seven or more fields, but in this world of binary, one bit of a byte makes a big difference.

VFP Newsletter July 2004

Filed Under (Visual FoxPro) by WildFire on 18-07-2004

Ken Levy fires up a new Visual Foxpro newsletter for the month of July. It includes Visual Foxpro 9 Beta Samples.

Articles . VFP RSS and XML

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

Ted Roche posted online two Foxpro+RSS/XML-related articles previously written for FoxTalk April 2004 and May 2004 issues.

In case you have missed that reproduced VFP Automates OpenOffice.org article from Ted Roche I’m posting the link too. More articles, speaker’s note and whitepapers can be viewed and downloaded here.

BLOG . VisualFoxpro and Feedback Center

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

When Microsoft released that MSDN Product Feedback Center (aka LadyBug) weeks ago, I was there in that site figuring out if there is something wrong with the combo box since I can’t seem to find Visual Foxpro in it. I even tried using FireFox thinking something is wrong with the browser. After fifteen minutes I gave up and was in that ‘here-we-go-again-microsoft’ mindset once again.

Even my pet tiger that’s beginning to develop this affection for VisualFoxpro started scratching my Logitech mouse. I was beginning to fear that the peace talk agreement between this tiger and the mouse was starting to expire.

So I decided to type ‘Foxpro’ instead in that textbox and found this post from a certain JimN. One of the lines I like most in that post is this:

Users of Visual FoxPro essentially PIONEERED this current feedback mechanism by virtue of its online widely available and WIDELY USED “Wish List” hosted on the Universal Thread web site. Releases 8 and 9 of Visual FoxPro demonstrated in spades the value of a feedback mechanism for both the product users AND the product’s development team.

I heard my pet tiger hooting in the background.

Today John Koziol posted the reasons why VisualFoxpro was not included.

Now I’m sure I swear I saw my pet tiger licking the Logitech mouse moments ago. He haven’t done that since he first saw that Feedback Center.

I’d probably buy some pizza later tonight. No not for me… but for this renewed peace.

workBLOGS . PIR

Filed Under (THIS.site.matters, Visual FoxPro) by WildFire on 16-07-2004

This serves as a test post. I’m fixing CGI-related problems on a different server and I’m wondering if it’s IE or some misconfiguration that is causing the problem. This serves as a part of the problem isolation routine.

Here to compensate this off topic thread: Atomic9.NET

workBLOGS . oTimeTotal

Filed Under (Visual FoxPro, work.BLOG) by WildFire on 14-07-2004

A little something something.

It’s already 2:40AM, I’m done with a couple of Reports and I’m still online trying to annoy a VB6-lovin’-former classmate of mine.

To give you an overview of this late-night-to-early-morning little quest of mine, I’ll start with the target task. The objective is to add those TimeTotal and FeeTotal amounts in the reports that deals on the usage of the internet/computer.

So it’s something like this:

 NAME
TIME IN
TIME OUT
TIME TOTAL
TOTAL FEE
         
 Richelle
09:19:03
11:05:45
01:46:42
44.17
 Marv
17:32:25
18:57:49
01:25:24
35.42
 Teresa
20:27:22
21:15:05
00:47:43
19.58
         
     
cTotalTime
nTotalFee

This is just part of the data and at 2AM I’m not sure if they’re the right numbers so tone down that meticulous geek in you, I just want to present an overview.

Generating nTotalFee is easy using VisualFoxpro’s Report Tool/Designer. You simply create a variable, let’s say oTotalFee, store the value of the database field (USAGE.FeeTotal), set the initial value to 0 and click the SUM part on the Calculate frame. You can set the variable to reset at the end of the page or at the end of the report. Just that and hardworkin’ VFP will do the things automatically for you in the background while your report is being generated.

The trickier part is the cTotalTime since it is a character (well I made it that way months ago probably to make things harder for me in the future). ‘01:00:00‘ + ‘00:00:25‘ is equal to ‘01:00:0000:00:25‘ and not ‘01:00:25‘. I tried another couple of barfed-out-rushed patch solutions which in the end didn’t work.

That was when I remembered that there’s a CTOT() function. But CTOT() needs additional characters such as CTOT(“2000-10-24T13:30:00“) and the other time/date-related functions I found were of no use, well at least in this situation. Besides I was secretly praying that none of these reserved functions would work so that I can have an excuse to do things the ‘old school’ way.

But before that I was even considering the lame approach of simply dividing nTotalFee with the RatePerHour and a little TimeConversion() algorithm to derive cTotalTime… a sort of a short circuit cheat. But that my friend, is not the way things are done especially when I’m in the mood to punish myself.

So choosing the ‘right’ path, I entered the following manipulation inside the variable part:

(val(substr(usage.timetotal, 1, 2))*3600) +
(val(substr(usage.timetotal, 4, 2))*60) +
(val(substr(usage.timetotal, 7, 2)))

In the report, a field control is added to store this code:

NUMTOSTR(alltrim(str(int(oTotalTime/3600))), 2) + ‘:’ +
NUMTOSTR(alltrim(str(int((oTotalTime%3600)/60))), 2) + ‘:’ +
NUMTOSTR(alltrim(str((oTotalTime%3600)%60)), 2)

NumToStr is a function I use to convert a number to a character field with additional ‘pads’. Something like NumToStr(97, 5) would yield ‘00097‘. It is quite useful too in IDNumber/Code formatting and other related functions.

So with that… the quest was completed.

Perhaps there are better solutions for this but for now this will do, donkey. It gives you a little taste of how things are done the ‘good-old-school’ way. Ah well at least a step above the older assembly/machine code approach.

Articles . FoxTalk 2.0 July 2004

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

FoxTalk 2.0 July 2004 released.

Articles . Foxpro Advisor

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

Almost every VisualFoxpro developer who has a ‘net connection visits FoxproAdvisor.com, but if you’re one of those I-dwell-in-my-own-world type of coder, it’s about time to… well, at least uncloak yourself for a moment move your arse and absorb some materials on that site. Some articles may be weeks or even more-than-three-months-old already but they’re very much applicable still. That’s what FoxPro is all about… time certified.

Here are direct links to some articles inside FoxproAdvisor:

There are also non-Foxpro but ‘programming attitude’ related articles as well:

There are even .NET-related articles too such as:

There’s even more but some of the articles are subscription-based which I don’t have as of the moment.

Dear FoxproAdvisor Staff:

I know the articles defy time and all, but how about adding a date under the author’s name just to indicate when those articles were written or published? Or was I just too sleepy last night to find where those dates are being placed?

Articles . VFP White Papers Directory

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

Fox.wikis.com listed a good amount of VisualFoxpro related whitepapers. Fox.wikis.com updated their RSS feed too in case you haven’t noticed it yet. That’s the XML… here’s the Wiki RSS Documentation for more ‘flavors’.