On Fri, 05 Aug 2011 15:34:23 +0200, Rothenmaier, Deane C.
<[email protected]> wrote:
> Geniuses, Gurus, Wizards, et. al...
>
> I'm working on some Win32::GUI code, with no formal training, and just enough
> OTJ to be really dangerous. I've come up against a couple of questions that
> I cannot find answers to in my books. Here's the code:
>
> #===============
> sub Exit_Click {
> #===============
> MainWindow_Terminate();
> }
>
> #=========================
> sub MainWindow_Terminate {
> #=========================
> print LOG "="x80 . "\n";
> close( LOG );
> return( -1 );
> }
>
> And here's the questions:
> First, when Exit_Click (E_C) calls MainWindow_Terminate (MW_T), it does
> nothing with the -1 that MW_T returns-or at least it looks that way (it is
> GUI, after all, and I'm learning that GUI does a lot of, um, "invisible"
> stuff). So where does that -1 go? Into the bit bucket? Or does GUI do some
> behind-the-curtain prestidigitation with it? If this wasn't GUI code, I'd
> feel confident believing that it's just ignored. But it is. So I don't.
Strictly speaking the -1 is returned by Exit_Click, since the result of the
last line executed in a sub is always returned by that sub. So if whatever
calls E_C does something with its return value, then you cannot assume it's
being ignored.
--
With regards,
Christian Walde
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs