Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fox-ism...

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,828
JP
Anyone know why the VFP team (and prior to that, I know a number of these stem back to the 2.x if not earlier), but why have the SYS() functions been perpetuated? Why the use of such a cryptic method for returning these values?

It would make MUCH more sense to have a function like CHECKSUM() than SYS(2007). There is nothing mystical or specificaly "System focused" about creating a checksum out of a string of digits... I can see something like SYS(9) to get the internal serial number of VFP, but even then, why not a SHOWSERIAL() or SERIALNUMBER() funciton? These are just cryptic, and burried for no reason I can tell. Anyone know the history/logic behind these things?

And it seems that some have VFP alternatives in later versions from their creation, yet still new SYS() functions get added with every version...

Like SYS(100) can be shown with SET('CONSOLE') along with a host of other SET functions...

I just find it amusing, and wonder if anyone else does too, and knows the WHY behind this?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Scott,

Oh, come on now. What you are suggesting is far too logical. It's much more interesting to have cryptic SYS numbers rather than boring mnemonic names.

Next you'll be wanting to change CURSORSETPROP("Buffering")
to something sensible like SET BUFFERING.

Where would it end, I ask myself.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
But is there some "Hidden" internal thing to Fox that drives when/why a sys function could/should be created. I mean, talk about your overloaded opperator! Parsing a SYS must be INSANE. It would be the CASE from hell, I would invision.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Scott,

Maybe they just don't have the energy to think up meaningful function names.

After all, it's not immediate obvious what to call a function that returns a value indicating how automation an server method was invoked (SYS(2334)) or one that sets or returns the number of items to display in drop down list boxes (SYS2910)).

Just a thought (not a very serious one).

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I know why they were originally added, but not sure why the Fox team keeps adding new ones. You can solve the problem by writing your own wrapper class for them.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
But you could always create a header file

meaningful.h

with a content something like this:
Code:
#define ListBoxDDItems() sys(2910)
#define CheckSum()       sys(2007)
#define ShowSerial()     sys(9)

and include the damned thing in every piece of programming you create....

Rob
 
Hmmm as a long time VFPer, I'm not sure you'd be able to 'impress your friends' - mind you, perhaps, a chum of mine did suggest that watching me code was a spectator sport (then again he's a cricket fan - so there's really no accounting for that).

B-)

Regards

Griff
Keep [Smile]ing
 
On another topic I wondered why MS gave the import functionality of importing from individual worksheets in Excel yet exporting to worksheets requires COM functionality.

Why can Excel open a dBase .dbf yet fails to open a Foxpro .dbf?
 
BillPSU,

The issue of Excel opening a dBase .dbf but not Fox is not a Fox problem. It has to be addressed by the Excel team.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
dBase is a competitor's product and they're more than happy to help wean you from it. They'd like to sell you Foxpro. ;-)

As for why they continue to use SYS() functions, I believe there's a lengthy "language narc" approval process for language products. But they can slipstream a SYS() function at any time.

 
What the heck does REDUCE() do?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
I think it's a function that works out lowest common numerators and denominators for fractions...

Code:
e.g:
4/12 = 2/6 = 1/3

Reduce("4/12") && should return "1/3"

Very useful for 12345/123456789 I imagine!

Regards

Griff
Keep [Smile]ing
 
Griff,

In mathematics, yes. But, in Foxtools, not even close.

Regards,
Jim
 

Griff,

I think it's a function that works out lowest common numerators and denominators for fractions...

Not even close.

REDUCE() converts characters embedded in a string to a space, especially to convert multiple spaces to a single space.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Ah, you live and learn!

So that's another badly named one is it?

I was trying to work out why solving the fraction would be thought so useful!

B-)

Regards

Griff
Keep [Smile]ing
 

Griff,

Yes, you're right about the name. You'd never guess its purpose from its name.

I once wrote my own version of REDUCE() (before we had Foxtools), and I called it SQUASH(). Maybe not a brilliant name, but it seemed to express its purpose well enough.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Slightly off topic I know...

But wrt using your own version of things that later appear (or perhaps were already there) in VFP; do you update your applications and replace your functions with theirs?

I, personally, tend not to - for example I have a function called PathAbove() which returns the parent folder of a given filename, I know there is a VFP JustPath which does the same thing (pretty much) - but I've been using PathAbove() for so long I never think to use the native version.

Martin

Regards

Griff
Keep [Smile]ing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top