Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot, bind-address mysql multiple, sanibleone xxxx, ftp://192.168.100.100/, www.xxxcon

Links

XODOX
Impressum

#1: Where"s the -1 go? (Not another troll question)

Posted on 2011-08-05 15:34:23 by Deane.Rothenmaier

--===============1840543100==
Content-Type: multipart/alternative;
boundary="_000_115007D93766724DAE9F518846E121DE93873BDMSS8MP 2MBwagreso_"
Content-Language: en-US

--_000_115007D93766724DAE9F518846E121DE93873BDMSS8MP2MBwagre so_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="us-ascii"

Geniuses, Gurus, Wizards, et. al...

I'm working on some Win32::GUI code, with no formal training, and just enou=
gh 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:

#===============3D
sub Exit_Click {
#===============3D
MainWindow_Terminate();
}

#===================3D=3 D=====
=3D
sub MainWindow_Terminate {
#===================3D=3 D=====
=3D
print LOG "=3D"x80 . "\n";
close( LOG );
return( -1 );
}

And here's the questions:
First, when Exit_Click (E_C) calls MainWindow_Terminate (MW_T), it does not=
hing 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 behin=
d-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.

Second: Is there some GUI-related requirement behind E_C calling MW_T inste=
ad of doing, in its own code, the stuff MW_T does? That is, is there someth=
ing in the murky depths of Win32::GUI that's expecting a "thing" called Exi=
t_Click to call another "thing" called MainWindow_Terminate?

Thanks for sharing your wisdom.

Deane Rothenmaier
Programmer/Analyst - IT-StdCfg
Walgreens Corp.
2 Overlook Point #N51022D
MS 6515
Lincolnshire, IL 60069
224-542-5150

Vincit qui patitur. -- Persius


--_000_115007D93766724DAE9F518846E121DE93873BDMSS8MP2MBwagre so_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="us-ascii"

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Geniuses, Gurus, Wizards, et. al&#8230;<o:p></o:p></=
p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I&#8217;m working on some Win32::GUI code, with no f=
ormal training, and just enough OTJ to be really dangerous.&nbsp; I&#8217;v=
e come up against a couple of questions that I cannot find answers to in my=
books.&nbsp; Here&#8217;s the code:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">#===============3D<o:p></o:p><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">sub Exit_Click {<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">#===============3D<o:p></o:p><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">&nbsp;&nbsp; MainWindow_Terminate();<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">}<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot; ">#===================3D =
======<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">sub MainWindow_Terminate {<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot; ">#===================3D =
======<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">&nbsp;&nbsp; print LOG &quot;=3D&quot;x80 . &quot;\n&quot;=
;<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">&nbsp;&nbsp; close( LOG );<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">&nbsp;&nbsp; return( -1 );<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">}<o:p></o:p></span></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">And here&#8217;s the questions:<o:p></o:p></p>
<p class=3D"MsoNormal">First, when Exit_Click (E_C) calls MainWindow_Termin=
ate (MW_T), it does nothing with the -1 that MW_T returns&#8212;or at least=
it looks that way (it
<b>is</b> GUI, after all, and I&#8217;m learning that GUI does a lot of, um=
, &#8220;invisible&#8221; stuff). So where does that -1 go? Into the bit bu=
cket? Or does GUI do some behind-the-curtain prestidigitation with it?&nbsp=
; If this wasn&#8217;t GUI code, I&#8217;d feel confident believing
that it&#8217;s just ignored. But it is. So I don&#8217;t.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Second: Is there some GUI-related requirement behind=
E_C calling MW_T instead of doing, in its own code, the stuff MW_T does? T=
hat is, is there something in the murky depths of Win32::GUI that&#8217;s e=
xpecting a &#8220;thing&#8221; called Exit_Click to
call another &#8220;thing&#8221; called MainWindow_Terminate?<o:p></o:p></=
p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Thanks for sharing your wisdom.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Deane Rothenmaier<o:p></o:p></p>
<p class=3D"MsoNormal">Programmer/Analyst &#8211; IT-StdCfg<o:p></o:p></p>
<p class=3D"MsoNormal">Walgreens Corp.<o:p></o:p></p>
<p class=3D"MsoNormal">2 Overlook Point #N51022D<o:p></o:p></p>
<p class=3D"MsoNormal">MS 6515<o:p></o:p></p>
<p class=3D"MsoNormal">Lincolnshire, IL 60069<o:p></o:p></p>
<p class=3D"MsoNormal">224-542-5150<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><i>Vincit qui patitur.</i> -- Persius<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>

--_000_115007D93766724DAE9F518846E121DE93873BDMSS8MP2MBwagre so_--


--===============1840543100==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1840543100==--

Report this message

#2: Re: Where"s the -1 go? (Not another troll question)

Posted on 2011-08-05 16:08:13 by Christian Walde

On Fri, 05 Aug 2011 15:34:23 +0200, Rothenmaier, Deane C. <deane.rothenmaier@walgreens.com> 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
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Report this message

#3: RE: Where"s the -1 go? (Not another troll question)

Posted on 2011-08-05 16:14:56 by Deane.Rothenmaier

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:mithaldu@yahoo.de]
Sent: Friday, August 05, 2011 9:08 AM
To: activeperl@listserv.ActiveState.com; 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. <deane.rothenmaier@walgreens.com> 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
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Report this message

#4: Re: Where"s the -1 go? (Not another troll question)

Posted on 2011-08-05 17:44:34 by Bill Luebkert

On 8/5/2011 7:14 AM, Rothenmaier, Deane C. wrote:
> 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?

Kinda depends on who called Exit_Click and how. I assume it's a
callback for a menu item, button or some such - so if so, it would most
likely just be ignored unless it was expecting a return from the
callback in which case it could do any number of things including a
possible exit. One would need to know more context to determine the
real answer by looking at the code. Always supply complete but tiny
test cases instead of just little snippets of code and you have a
better chance at a real world answer.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Report this message