DO CASE CASE nStatus = 1 * It's in cart ... process it thusly process_in_cart() CASE nStatus = 2 * It's ordered ... process it thusly process_ordered() CASE nStatus = 3 * It's shipped ... process it thusly process_shipped() OTHERWISE * Should never happen ... ENDCASEIs the OTHERWISE clause needed there? Is it only needed if there's logic below that depends on the state?
lnValue = 1 && Should only ever be 1, 2, or 3 DO CASE CASE lnValue = 1 * Process as 1 CASE lnValue = 2 * Process as 2 CASE lnValue = 3 * Process as 3 OTHERWISE * Should never happen ENDCASEDo you need an OTHERWISE here? It's been explicitly set to a value that's known to be in the range of testing values. I always err on the side of caution. The extra OTHERWISE clause should never be hit, but if it is ... it will catch unexpected conditions. I usually put a function call in there called silentError(), which will trap through to a single handler allowing me to catch errors that should never happen, and record their code location, etc., during development, and log the same during production.