Tuesday, January 25, 2005

EMS Professional Software and Specialty Services

Looking for a copy of old software manuals, or the install disks themselves? Check out EMS Old Software Exchange from here.

Also links to shareware, IQ testing, survival publishiing and build-it-yourself reading primer templates.

A golden find, thanks to Dave Bernard via the ProFox list.

Friday, January 21, 2005

Sleep Fox

Put VFP in a minimum resource wait state, but still pay attention to the internal event loop:

LOCAL lnSeconds
DECLARE Sleep IN WIN32API integer

lnSeconds = SECONDS()
DO WHILE SECONDS() - m.lnSeconds <> m.tnSeconds

Thanks to late night buddy
Garrett who has a recent post on using SourceGear Vault with VFP Project Manager. The single user version is free (as in beer).

Thursday, January 20, 2005

Named References in VFP-SQL

VFP allows us to use named references for fieldnames, tablenames, filenames, etc with its various commands. But, not always with the SQL sub-language...

This works:

REPLACE ALL (crsUpdates.FieldName) ;
    WITH (crsUpdates.NewValue);
    FOR PrimaryKey = (crsUpdates.PK)

but not this:

UPDATE table1;
    SET (crsUpdates.FieldName) = (crsUpdates.NewValue) ;
    WHERE table1.PrimaryKey = (crsUpdates.PK)

or any of these...

UPDATE table1 ;
    SET &crsUpdates..FieldName = (crsUpdates.NewValue) ;
    WHERE table1.PrimaryKey = (crsUpdates.pk)

UPDATE table1 ;
    SET EVALUATE(crsUpdates.FieldName) = (crsUpdates.NewValue) ;
    WHERE table1.PrimaryKey = (crsUpdates.pk)

However, if you hard-code the SET field, it works:

UPDATE table1 ;
    SET MyField = (crsUpdates.NewValue) ;
    WHERE table1.PrimaryKey = (crsUpdates.pk)

I'm sure it's been this way forever -- I've just don't recall running across it before.

Thursday, January 13, 2005

Joel on Software at Crossroads, Tues Jan 18th

Joel on Software Dinner: Bellevue WA Jan 18th

"I'm planning to come to Seattle in January to speak at an Amazon.com developer's conference. While I'm there, I thought it would be fun to meet some readers over dinner, so if you're going to be in the area, I hope you will be able to come!

I suggest we meet at the food court at the Crossroads Mall, at 7:30 PM Tuesday, January 18th, 2005."

Monday, January 10, 2005

Automating Telnet with Expect

As long as Telnet has been around, I was suprised to find that there is no native way to automate it.

I need a process on a Wintel box to access a TSX system remotely and kick off a process. Manually I can Telnet to the box, provide user/pass and then start the process. But when trying to automate the process I find there is no native way to respond to a password prompt from Telnet.

Enter "Expect". Written for *nix in TCL there is a port that runs on Wintel. The documentation is a bit sketchy, but I got it to work.

You can call Expect with -f and provide an input file. The input file for the whole process looks like this:

spawn telnet
expect "Logon please:"
send "myusername\r"
expect "Password:"
send "mypassword\r"
expect "32sys>"
set timeout 1000
send "c:\\bin\\myscript\r"
expect "32sys"

The \r is the return control, notice double back-slash for the directory name. The package comes with TCL source and its own version of telnet. The expect "32sys" lines have expect looking for the command line prompt.

Whatever you are calling on the remote side should have limited output, when working with TSX I get a minimum of 2 lines of control characters that look like garbage. Originally the remote process was reporting progress on exporting data... this made for too much information for Expect to ... well, expect.

Wednesday, January 05, 2005

Execscript kicks the Lama's ass

Andrew Ross-MacNeil turned me on to some interesting ideas with EXECSCRIPT at Devcon this year. I've always had a little program to set hot keys to clear my environment , build a project, ala Tom Rettig's CA.prg.

Writing conditional code from execution in a hotkey was always a bit limiting, but with EXECSCRIPT this is no longer true!

( ;
[ CLOSE ALL ] + CHR(10) + ;
[ CLEAR ALL ] + CHR(10) + ;
[ CLEAR ] + CHR(10) + ;
[ BUILD APP myapp FROM myapp RECOMPILE ] + CHR(10) + ;
[ IF FILE("myapp.err") ] + CHR(10) + ;
[ MODIFY FILE myapp.err NOWAIT ] + CHR(10) + ;
[ ELSE ] + CHR(10) + ;
[ DO myapp ] + CHR(10) + ;
[ ENDIF ] ;

Tuesday, January 04, 2005

Visual FoxPro 9 Goes Gold / BetaNews babbles on incoherently...

A weak article with bad information about VFP9 release here.

Some mention of the extended report writer and …
“…FoxPro 9.0… embeds SQL in the FoxPro language, and is more extensible, allowing developers to introduce code that benefits their end user applications.”

How about the *native* SQL syntax has been extended to include virtually unlimited tables, joins, sub-queries and unions; projections, derived tables and enhanced correlation support?

How about new data types, new index types, enhanced data adaptors for cursors and xml?

How about more granular control on how tables are opened, records are refreshed, transactions are implemented?

How about Rushmore enhancements (especially the late breaking improvements to query optimization)?

How about language additions like CAST() and ICASE()?

If you’re gonna try to write an article based on a press release, at least get it fact checked.

Of course, the comments add salt to the wounds…1 Comment on the article entitled "Fox is Dead", then 4 comments on that comment defending the product.