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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call a Sub by Name 3

Status
Not open for further replies.

rvBasic

Programmer
Oct 22, 2000
414
0
0
BE
I have to validate a somewhat 300 data fields. In principle each field can have a different data validation routine. A nested if, 300 levels deep seems to me not the ideal solution. So I hit upon the idea of constructing a hash with matching FieldName (key) / SubName (data = Name of sub to call for validation).

But can I call a function this way?

_________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
 
you suppose that the field names will be known at the time the program is written
Good point...

I'm not a fan of soft references, for the reasons others have already mentioned - but this does seem to be an ideal use for them.

Mike

When working on any project the value of other people is exactly that - they are other people. The mismatch between their views and the view you've been contentedly assuming is right, is where that value lies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top