Hi

I was thinking of the following:

1. A compiler option to declare a data dictionary declaration so that statements of the form:
        workarea->fieldname
could be validated.

In the case where a DBF exists it could be used as a kind of "include" file, and there would need to be an alias mapping:
        WORKAREA "acc101.dbf" ALIAS accounts
and:
        accounts->name
would be validated, and:
        accounts->nane
would cause a compile time error. As would:
        ackounts->name

In the case where no dbf exists (perhaps a SQL database or the new "mem:" files), or it is not practical to read a dbf then some syntax like:
        WORKAREA accounts
        FIELD accounts->name         
        FIELD accounts->address ...  

If we ever introduce strong typing, then something like this will be needed 
anyway.

2. I have come to think of all global state as "evil", and would like to be able to declare work areas with local scope, and to be able to pass them as parameters, and to treat global work areas as undefined unless declared. The same "WORKAREA" keyword and FIELD extension might allow this, depending on whether it is placed within a procedure/function, or globally.

Anyone like this idea? I always program with full warnings and /es2 but Harbour does not help me with my field names at all.

Regards
Alex



_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to