Thanks, Christian. So, If I'm understanding you correctly, Exit_Click just passes the -1 from MW_T back up the chain to whatever called *it*? So it ends up somewhere in a black GUI box?
Deane Rothenmaier Programmer/Analyst - IT-StdCfg Walgreens Corp. 2 Overlook Point #N51022D MS 6515 Lincolnshire, IL 60069 224-542-5150 Vincit qui patitur. -- Persius -----Original Message----- From: Christian Walde [mailto:[email protected]] Sent: Friday, August 05, 2011 9:08 AM To: [email protected]; Rothenmaier, Deane C. Subject: Re: Where's the -1 go? (Not another troll question) 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
