Re: Productivity




"Frank Swarbrick" <infocat@xxxxxxxxxxxxx> wrote in message
news:dElkh.4094$yx6.3439@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Pete Dashwood wrote:
I remember battling to get the standard directory/file selection dialog
included in an OO COBOL (PowerCOBOL)application. It was difficult and
non-intuitive. There was no documentation provided by Fujitsu and I had
no idea what the component was even called or where it lived. I had to
use an Object Browser to locate it amongst thousands of Operating System
components, and then try and figure out what its methods, properties,
events, and interfaces were and provide the correct format for them in
COBOL. Finally got it working, but it took a day. In C#/DotNET I did the
same job in literally 5 minutes, dragging the component from the toolbar
directly into my codeview. And it displays in the Windows XP theme
automatically, so the program does not look "alien" to the user. I
actually wrote 9 lines of code to support this, and 6 of those are
comments...:

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...

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...

How does openFileDialog1 get instantiated?
How do you know what library is required?
What happens if no file is selected?
Suppose the selected file is deleted moments after you select it?

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? :-)

Pete.



.


Quantcast