Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To iif or not to iif = .t.
Message
 
To
31/05/2001 14:42:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00513276
Message ID:
00513371
Views:
18
>I agree entirely. I consider EXIT and LOOP to be bugs until proven otherwise :-) Almost without exception, it's an indication that the coder hasn't thought the logic through clearly, making the entire structure suspect.

I consider them the VFP equivalent of < shudder > GOTO...:-)

>Personally, I also consider an IF statement without an ELSE in the same class.

Sometimes, I think that this is ok consider:
FUNCTION SomeFunc
  
  LOCAL lnresult
  lnresult = 0
  IF < Some logical expression >
    lnresult = 99
  ENDIF
  RETURN lnresult
ENDFUNC
I tend to initialize my return variables almost immediately. Add ing an ELSE here might be overkill. Normally, most of my methods are around 20 lines so it's easy to see what's going on.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform