General information
Category:
Coding, syntax & commands
Hi Simon,
It *may* be that you are remembering some shop programming standard.
I know that *my* personal coding standard for DO CASE is to (almost) always limit all case statements to the same variable(s) or whatever 'set'. The exception is a condition where different handling is required depending on some external variables in which case an IF or DO CASE might establish the prime condition then a series of testing-different-memvars/values CASE statements will follow. Positioning is often also important is such cases.
The fact that VFP lets me code whatever conditions I want in any CASE condition does not mean that I have to use it that way, and I choose not to in 99% of cases.
I am definitely not a fan of a sequence of DO CASE statements that are deliberately coded to "do work" (in the conditions themselves) and to ALL run in the sequence coded. To me that 'style' is a pure corruption of the intention of DO CASE.
I just think that confining CASEs to same variable(s) adds to clarity/readability for the next guy who has to maintain the code.
cheers
>Perhaps my mind is playing tricks again, perhaps we have to go back to DOS or something. However, technical issues aside, the thing I find with this that is so complicated is that it makes the code hard to read. Say you're going down a DO CASE, find the one that matches your problem and re-code it, but then you have to check the others in case they are implicated as well...
>
>Thanks anyway,
>Simon
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only