Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WITH ENDWITH question
Message
From
21/08/2003 14:02:46
 
 
To
21/08/2003 12:02:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00822119
Message ID:
00822285
Views:
13
I must say that I agree with you Cetin, that a RETURN can and should go where it makes the most sense, and that includes aiding readability.

To me it is more readable/useful for a code READER to see immediately that a RETURN is done rather than to have to continue to read yet more code, possibly with added IF structures just to exclude (again) the specific RETURN condition anyway.

I will admit that, since about a year now, I have included a long comment in such lines, like the following, to help readers identify such occurrences
* a method
lparameters p1,p2,p3
with this
 if !.Something(p1,p2,p3)
    return .f.          && <----------------------- RETURN
 endif
....
cheers


>>Hi
>>
>>if you are using with endwith should you never jump out of the middle.
>>
>>ie
>>
>>WITH
>>
>>return
>>ENDWITH
>>
>>I can see it looks like a bad thing to do but whats the actual impact.
>>
>>Thanks
>>
>>Nick Mason
>
>I don't like to strictly follow the general practices and on this subject I certainly do not follow :)
>I think it's up to the programmer to have a return in the middle of a proc/loop/check etc. If I can control it why wouldn't I do that. ie:
>
>
>* a method
>lparameters p1,p2,p3
>with this
> if !.Something(p1,p2,p3)
>    return .f.
> endif
>....
>
>Only impact IMHO is if you can't control your coding, IOW readability maybe.
>Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform