Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting field presence in dbf
Message
From
30/07/2007 09:21:00
 
 
To
29/07/2007 20:10:38
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01244177
Message ID:
01244538
Views:
23
Mike,
>It would be fantastic to have some better kind of pre-processor.

Yeah - especially as vfp function overhead is gigantic compared to machine-code compiled languages.

>FieldNumInAlias should just return the field number. I've taken to generating an error when the passed alias doesn't exist.

In most cases an error from the issue will be coming IAC - I sprinkle asserts all over the code but stopped generating special errors. This may be an overreaction to working on a team where they tried to anticipate *every* error and generate handled errors with a nice descriptive text. They did not get much real work done...

>I ask you to consider that if you needed to check for a field's existence and act on that in some way, you would be better off having a IsFieldInAlias because calling FieldNumInAlias would take longer and do things not required by the need.

No argument from me - the base implementation came from Russell. See my answer there

>Having both let's programmers decide which function to call as appropriate.

As these are "near-system-level" I totally agree. Having a function do more than one thing should be an exeption with clear reasons why this path was taken.

regards

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform