Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ingrid Problem
Message
From
18/07/1998 10:13:06
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
17/07/1998 13:21:47
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00116648
Message ID:
00118968
Views:
25
>>Hiding the Thisform.Release in the ThisIngrid.ActionOnEnter is equal to jumping out of the loop. Since we must have it anyway (though I'd rather use Esc as the key to trigger it), we've actually just changed the way we write it. We don't jump out of the loop, we call jump out method. I still have a feeling that jumping of the loop wasn't that bad and dirty in the first place. Sure needs to be obvious in the code and well documented, else we're in for some heavy debugging - and finding that ActionOnEnter releases the form is equally hard to discover as is premature end of loop. Should we get back to the Coding Standards over this?
>
>
>I don't feel that calling thisform.release is jumping out of the loop any more than RETURN is. They are both incarnations of of a GOTO, which is almost universally regarded as bad coding practice, but RETURN is a _tame_ version and has grown vital to our routine architectures.

Could read that issuing Return in the middle of a method (or within a loop within it ;) is equally dirty (it is, IMHO) but taming is the word. The beast can be tamed by some standards, i.e. readable and obvious "WATCH OUT I'M PREMATURELY EXITING HERE" friendly notice.

>I wasn't necessarily implying that Alex should put a thisform.release in his Ingrid code, only instructing him on a more object way to handle it, if he deemed necessary.

Alex put it in the first place, AFAIR, but I actually took it as a pretext to talk about this. I know, Rules of Conduct - I should have started a new thread, but then I'd probably lose what I had in mind. It evaporates easily :)

>Getting back to the specific situation, however, if the call to ActioOnEnter is within a DO CASE construct, this isn't really jumping out of the loop, unless there is other code in the method that executes after DO CASE.

Ingrid and other Inkey loops (or any .KeyPress methods in general) are the places where we really expect such things to happen. It's the interface, and all the possible behavior requests are surely reflected there. Putting thisform.release (or any call to ThisForm.Suicide method) into a keypress, or cmdQuit.click or in .QueryUnload or Form.KeyPress for ESC and such places is kind of a natural and wouldn't confuse the next developer. Putting it somewhere else would be tricky, specially if there was no comment on it in the usual places.

Hey, what _are_ the usual places in form's method code to write the general comments? The form.comment property is (practically) limited to 255, user field of the .scx is not accessible from the designer, code is scattered around the method snippets, and any non-empty snipped is to be run, even if it contains just comments. Where do we put global comments and warnings in form code, really?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform