Re: Productivity



Pete Dashwood<dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> 12/27/06 3:40 AM >>>
"Frank Swarbrick" <infocat@xxxxxxxxxxxxx> wrote in message
news:dElkh.4094$yx6.3439@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Pete Dashwood wrote:

Here's the C# code:

private void button1_Click(object sender, EventArgs e) //provided by

VS2005
{ //provided by VS2005

/* User clicks "Browse for database" button. Open the standard dialog
* and put the selected file and path into the current form.
*
* This is only for MS ACCESS... other databases and ODBC have other
selections.
*
*/

openFileDialog1.InitialDirectory = "C:\\"; // start at the
beginning...
openFileDialog1.ShowDialog();
textBox1.Text = openFileDialog1.FileName;

} //provided by VS2005

How about this?

method-id. "button1_Click" final private.
linkage section.
01 sender object.
01 e System-EventArgs.
procedure division using by value sender e.

*> everything above here generated
move "C:\\"
to self::"openFileDialog1"::"InitialDirectory"
invoke self::"openFileDialog1"::"ShowDialog"()
move self::"openFileDialog1"::"FileName"
to self::"textBox1"::"Text"
*> everything below here generated

end method "button1_Click".

:-)


OK, but what's your point?

You don't specifiy what the above actually is, so I can only speculate...

Point? :-)

Only that I used NetExpress COBOL within Visual Studio 2005 to create the
above, just like you used C# within Visual Studio 2005 to create your
example.

Though I have to be honest, the "Intellisense" was somewhat flakey and
didn't "lead me" as well as it apparently did for you. Not sure if that's a
"product issue" or a "user issue". :-)

That looks very much like what I would expect DotNET COBOL to look like.
(As this runs in the VS2005 environment, the questions below would not
apply.)


If it is MicroFocus you will pay run time fees for it as well as the
compiler cost.

If it is either of the above, it cost several thousand dollars (hardly
competitive with the FREE C# solution); if it isn't, then I have some
questions...

We'll, again, I got the"University Edition", which was under $200, but is
still not free and not for 'production use'. Now I'm not being a Micro
Focus apologist here. I totally agree that they care little to nothing
about the little guy. I was just pointing out that it is, and I think
you'll agree, Visual Studio itself that makes this so easy, and not any
particular language. I have nothing against C#, and for Windows development
I think I'd probably agree that it's a much better answer than any form of
COBOL.

How does openFileDialog1 get instantiated?

Umm, how does it in your example? I only posted the COBOL corresponding to
your C# example.

Anyway, the instantiation of openFileDialog1 is generated by VS, just like
I'm sure it was in your example. I can't remember exactly (I only have it
at home), but I believe it was something like...

set openFileDialog1 = System-Windows-Forms-OpenFileDialog::"NEW"()

How do you know what library is required?

I have no idea.

What happens if no file is selected?

Dunno, but I believe that's a function of the .NET runtime. I will try it
and see what happens.

Suppose the selected file is deleted moments after you select it?

I am no where near proficient in WinForms or any kind of event driven
program. The fact that I could even come up with the code above is only
thanks to the ease of use of VS2005!

I'm also still waiting for your comments on the nested perform I posted
sample code for, in response to your comment about that...

Am I wasting my time here? :-)

Umm, maybe. I didn't know I was supposed to respond. I was only commenting
that I had never used it; not that it was not a useful thing to have.

Frank




---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
.