Bill,
I take it you want you want to put this rule onto the table with the 'check' clause.
Can't you just pass in the name of the field into your field_valid?
For example:
*--Apply the check clasue
ALTER TABLE myTable
ALTER COLUMN myColumn SET CHECK Field_Valid(myColumn)
PROCEDURE Field_Valid
LPARAMETERS tcFieldName
DO CASE..
Personally, I don't favour this approach as I like to separate business logic out of the database. This makes it easier to port your application onto other databases etc.
Mace
>I would like my field-level rules to all be identical "Field-Valid()".
>
>Procedure Field_Valid()
> local lcField
> lcField = FieldBeingValidated()
> do Case
> Case lcField = 'F1'
> .....
> Case lcField = 'F2'
> .....
> .....
> EndCase
>EndProc
>
>Procedure FieldBeingVAlidated()
> ?????
>EndProc
>
>Does anyone have any ideas on the code for FieldBeingValidated()?
>
>TIA