For Programmers: Free Programming Magazines  


Home > Archive > Cobol > July 2006 > How to ...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to ...
Daniele F.

2006-07-08, 7:55 am

Hi to all the users,
i'm a very very new cobol user and i'm moving first steps with this
language using acucobol-gt 6.0

The first problem i have is how to display a second screen (in delphi is a
form) when click on the button.
I know that for you this is a very annoing question ... but is not so easy
for me !!!

If you know some link with severals example, source code ecc.. for acucobol,
please let me know (something like torry page for dephi) because i've a lot
of question to do (but before i want to try to understand the matter
alone!!!!!).

Thank's for your help.

Daniele


2006-07-08, 7:55 am

In article <44af54cc$0$3118$4fafbaef@reader1.news.tin.it>,
Daniele F. <daniele.fare@libero.it> wrote:
>Hi to all the users,
> i'm a very very new cobol user and i'm moving first steps with this
>language using acucobol-gt 6.0


Do not worry... we were *all* virgins, once.

>
>The first problem i have is how to display a second screen (in delphi is a
>form) when click on the button.
>I know that for you this is a very annoing question ... but is not so easy
>for me !!!


It must be very difficult for you, yes... please post some of the work you
have done on this problem. That way we can avoid making any of the
mistakes you have already tried... and avoid doing your homework for you,
as well.

DD

Daniele F.

2006-07-08, 7:55 am

Hi DD,
thank's for your very quick reply ...

> It must be very difficult for you, yes... please post some of the work you
> have done on this problem. That way we can avoid making any of the
> mistakes you have already tried...


At the moment i've created 3 screens called screen1 (main), screen2 &
screen3.
On screen1 i putted 2 buttons, the first one for exiting the program (if i
click on it i call stop run)
here the code

Screen1-Pb-1-Ev-Cmd-Clicked.
stop run

2006-07-08, 6:55 pm

In article <44afa684$0$3113$4fafbaef@reader1.news.tin.it>,
Daniele F. <daniele.fare@libero.it> wrote:
>Hi DD,
> thank's for your very quick reply ...


I can be that, at times... and women have complained about it, too.

>
>
>At the moment i've created 3 screens called screen1 (main), screen2 &
>screen3.


How did you create these screens? Most of my experience is with CICS
(command level) and maybe the definitions in your BMS macros could use a
bit of polishing.

>On screen1 i putted 2 buttons, the first one for exiting the program (if i
>click on it i call stop run)
>here the code
>
>Screen1-Pb-1-Ev-Cmd-Clicked.
> stop run
> .


That is rather... simple code, it is a paragraph name and a reserved word.

>On the second button the action i tried to get is to display the second
>screen .... but i don't know the correct keyword.
>
> Screen1-Pb-2-Link.
> * i don't know what to write here to show second screen (screen2)
>i.e. in deplhim is form.showmodal.
> .


That's rather simple, as well... just the paragraph name and nothing else.

>
>You're rigth, if you have any link that is able to give me some help with
>source code please tell me !!!!!


Your textbook might have something to say about that... which one are you
using?

>At the moment i'm moving the second steep (the first one, hello world, was
>reached).


That first one was, most likely, a simple DISPLAY. There's a bit more to
the language, as you are learning.

>
>Please be patient .....


Any good hunter has to learn that, sure.

DD
Richard

2006-07-08, 6:55 pm


docdwarf@panix.com wrote:
>
> How did you create these screens? Most of my experience is with CICS
> (command level) and maybe the definitions in your BMS macros could use a
> bit of polishing.


You are quite out of your depth, doc. You missed where it was
acucobol-gt 6.0 being used. It is not CICS, not ansi displays, not some
novice trying to do homework.

>
> That is rather... simple code, it is a paragraph name and a reserved word.


Yes. That is all that is needed for that particular part. It is event
driven code with the paragraph linked to the control.

> That first one was, most likely, a simple DISPLAY. There's a bit more to
> the language, as you are learning.


Do try to not put down others, especially when it is so far out of
anything that you actually know about.

Unfortunately I cannot provide an answer to the question, but at least
I do understand what the question was.

2006-07-08, 6:55 pm

In article <1152385565.377192.163080@s13g2000cwa.googlegroups.com>,
Richard <riplin@Azonic.co.nz> wrote:
>
>docdwarf@panix.com wrote:
>
>You are quite out of your depth, doc. You missed where it was
>acucobol-gt 6.0 being used.


It would not be the first time I missed something, no.

>It is not CICS, not ansi displays, not some
>novice trying to do homework.


It may not be CICS, certainly, and it may not be ANSI displays... but it
certainly needs something done, even from the view of the original poster.

>
>
>Yes. That is all that is needed for that particular part. It is event
>driven code with the paragraph linked to the control.


Well, then, if that is all that is needed then there's little help to be
offered... on to the next!

>
>
>Do try to not put down others, especially when it is so far out of
>anything that you actually know about.


Mr Plinston, if you see a simple statement of fact as an attempt 'to put
down others' then you might find that the world is full of insult. One of
the ways I try to find out more than what I believe I 'actually know
about' is by asking questions; this technique might, possibly, be
unfamiliar to a know-it-all or one of similar ilk or bent.

>
>Unfortunately I cannot provide an answer to the question, but at least
>I do understand what the question was.


Outside of your assertion, Mr Plinston, there seems to be little here to
demonstrate that... but have no fear, someone might take your word for it.

DD

Richard

2006-07-08, 6:55 pm


Daniele F. wrote:

> The first problem i have is how to display a second screen (in delphi is a
> form) when click on the button.
> I know that for you this is a very annoing question ... but is not so easy
> for me !!!


You may try to find something at:

http://www.acucorp.com/support/publ...grams/index.php

in particular:

http://www.acucorp.com/support/publ...es/Threadds.zip

James J. Gavan

2006-07-08, 6:55 pm

Richard wrote:
> Daniele F. wrote:
>
>
>
>
> You may try to find something at:
>
> http://www.acucorp.com/support/publ...grams/index.php
>
> in particular:
>
> http://www.acucorp.com/support/publ...es/Threadds.zip
>


Daniele,

There should be sufficient in the zip files Richard shows in the first
reference to get you going.

Do you understand the concept of Windows events - if not then browse the
Acu documentation. Briefly, given a Screen/Window/Dialog you can CREATE
and DISPLAY. But then logically nothing happens until you click the
Mouse or enter Keystrokes. (Windows performs a 'circular cycle' between
your application and other applications currently active, (even though
their 'screens' may be hidden, because you have used their minimize
button (top-right with the dash '-'), by checking if an event has been
triggered by each application in the queued cycle.

I haven't, but you should, look at the Acu coding for their examples. As
you create Dialogs (sub-windows) you should register events so they can
be accessed for further action from Mouse/Keyboard action. Do a search
on Acu for "register events", "callbacks", "iterations", "buttons",
"windows events", "show", "hide" etc.

There's no easy route when it comes to Windoze - pick on the simplest
Acu example you can and try and follow the program logic. Hopefully Acu
provides some sort of debugging tool that lets you step through a
program, line-by-line to see visually what is happening.

Just one quick tip - if you have three dialogs as you stated, each one
is subordinate to a PARENT - which will either be the Desktop "Screen"
or in a menu driven application - would be your Master Menu.

Unfortunately this GUI bit is somewhat unique to whichever COBOL GUI
tool you use - although they all eventually call Windows APIs to perform
their actions.

Jimmy
epc8@juno.com

2006-07-08, 9:55 pm

James J. Gavan wrote:
> Richard wrote:
>
> Daniele,
>
> There should be sufficient in the zip files Richard shows in the first
> reference to get you going.
>
> Do you understand the concept of Windows events - if not then browse the
> Acu documentation.


The OP refers to Delphi and in particular to "form.showmodal" so I
suspect he(she) has some grasp of Windows, controls, events.

If AcuCobol GT is as easy as Visual Basic or Delphi then it's merely a
matter of finding the right object and invoking one of its methods
...... translating this into COBOLese, of course. [Sorry, not my area of
expertise.]

Pete Dashwood

2006-07-09, 3:55 am


<docdwarf@panix.com> wrote in message news:e8oapp$l6l$1@reader2.panix.com...
> In article <44afa684$0$3113$4fafbaef@reader1.news.tin.it>,
> Daniele F. <daniele.fare@libero.it> wrote:
>
> I can be that, at times... and women have complained about it, too.


Maybe we know the same women... :-)
[color=darkred]
>
>
> How did you create these screens? Most of my experience is with CICS
> (command level) and maybe the definitions in your BMS macros could use a
> bit of polishing.
>

2006-07-09, 7:55 am

In article <4hbli8F1qeo98U1@individual.net>,
Pete Dashwood <dashwood@enternet.co.nz> wrote:
>
><docdwarf@panix.com> wrote in message news:e8oapp$l6l$1@reader2.panix.com...
>
>Maybe we know the same women... :-)
>
> .
>This may be a case where your commendable desire to help, has caused you to
>overreach your knowledge boundary, Doc.


That might be, Mr Dashwood... and that might be a reason for my asking to
see more of the code involved.

>
>I was going to explain what this is about, but I see from Richard's post he
>has already done so.


Mr Plinston's attempts were worthy of response, I believed... but they've
not, to the best of my ability to determine, brought forward any new data
from the original poster.

>
>Sometimes it is best to make like Brer Rabbit... :-)


At other times one might hope to learn a bit, aye.

DD

sgbojo@gmail.com

2006-07-10, 6:55 pm

You need to be careful when using events. In the example that you want
(3 screens) you can do this using exception values versus events.
Events can be used but they are usually used when doing the handling of
a control (such as a grid). I will attach a zip file with an ACUCOBOL
type of handling of display and accepting three screens.

sgbojo@gmail.com

2006-07-10, 6:55 pm

Here is an example program that should compile and run with ACUCOBOL-GT
version 6.
IDENTIFICATION DIVISION.
PROGRAM-ID. Program6.
AUTHOR.
DATE-WRITTEN. Monday, July 10, 2006 7:58:08 AM.
REMARKS.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
WORKING-STORAGE SECTION.
COPY "acugui.def".
COPY "acucobol.def".
COPY "crtvars.def".
COPY "showmsg.def".
77 Quit-Mode-Flag PIC S9(5) COMP-1 VALUE 0.
77 Key-Status IS SPECIAL-NAMES CRT STATUS PIC 9(4) VALUE 0.
88 Exit-Pushed VALUE 27.
88 Message-Received VALUE 95.
88 Event-Occurred VALUE 96.
88 Screen-No-Input-Field VALUE 97.
88 Screen-Time-Out VALUE 99.
77 Form1-Handle
USAGE IS HANDLE OF WINDOW.
77 Form2-Handle
USAGE IS HANDLE OF WINDOW.
77 Form3-Handle
USAGE IS HANDLE OF WINDOW.
SCREEN SECTION.
01 Form1.
03 Form1-Pb-1, Push-Button,
COL 4.00, LINE 5.00, LINES 3.00 CELLS, SIZE 14.00 CELLS,
EXCEPTION-VALUE 22, ID IS 1, SELF-ACT,
TITLE "Screen 2".
03 Form1-Pb-2, Push-Button,
COL 30.00, LINE 5.00, LINES 3.00 CELLS, SIZE 12.00 CELLS,

EXCEPTION-VALUE 27, ID IS 2, SELF-ACT, ESCAPE-BUTTON,
TITLE "Exit".
01 Form2.
03 Form2-Pb-1, Push-Button,
COL 5.00, LINE 5.00, LINES 5.00 CELLS, SIZE 17.00 CELLS,
EXCEPTION-VALUE 33, ID IS 1, SELF-ACT,
TITLE "Screen 3".
03 Form2-Pb-2, Push-Button,
COL 40.00, LINE 5.00, LINES 5.00 CELLS, SIZE 19.00 CELLS,

ID IS 2, SELF-ACT, CANCEL-BUTTON,
TITLE "Cancel".
01 Form3.
03 Form3-Pb-1, Push-Button,
COL 17.00, LINE 4.00, LINES 5.00 CELLS, SIZE 21.00 CELLS,

ID IS 1, SELF-ACT, CANCEL-BUTTON,
PROCEDURE DIVISION.
Acu-Main-Logic.
PERFORM Acu-Initial-Routine
PERFORM Acu-Form1-Routine
PERFORM Acu-Exit-Rtn .
COPY "showmsg.cpy".

Acu-Initial-Routine.

ACCEPT System-Information FROM System-Info
ACCEPT Terminal-Abilities FROM Terminal-Info .

Acu-Exit-Rtn.
EXIT PROGRAM
STOP RUN .

Acu-Form1-Routine.
PERFORM Acu-Form1-Scrn
PERFORM Acu-Form1-Proc.

Acu-Form2-Routine.
PERFORM Acu-Form2-Scrn
PERFORM Acu-Form2-Proc .

Acu-Form3-Routine.
PERFORM Acu-Form3-Scrn
PERFORM Acu-Form3-Proc .

Acu-Form1-Scrn.
PERFORM Acu-Form1-Create-Win .

Acu-Form2-Scrn.
PERFORM Acu-Form2-Create-Win.

Acu-Form3-Scrn.
PERFORM Acu-Form3-Create-Win .

Acu-Form1-Create-Win.
DISPLAY Standard GRAPHICAL WINDOW
LINES 13.00, SIZE 47.00, CELL HEIGHT 10,
CELL WIDTH 10, COLOR IS 65793, LABEL-OFFSET 0,
LINK TO THREAD, MODELESS, NO SCROLL, WITH SYSTEM MENU,

TITLE "Screen", TITLE-BAR, NO WRAP,
HANDLE IS Form1-Handle

DISPLAY Form1 UPON Form1-Handle .

Acu-Form2-Create-Win.
DISPLAY Floating GRAPHICAL WINDOW
LINES 14.00, SIZE 64.00, CELL HEIGHT 10,
CELL WIDTH 10, COLOR IS 65793, LABEL-OFFSET 0,
LINK TO THREAD, MODELESS, NO SCROLL, WITH SYSTEM MENU,

TITLE "Screen 2", TITLE-BAR, NO WRAP,
HANDLE IS Form2-Handle

DISPLAY Form2 UPON Form2-Handle .

Acu-Form3-Create-Win.
DISPLAY Floating GRAPHICAL WINDOW
LINES 11.00, SIZE 64.00, CELL HEIGHT 10,
CELL WIDTH 10, COLOR IS 65793, LABEL-OFFSET 0,
LINK TO THREAD, MODELESS, NO SCROLL, WITH SYSTEM MENU,

TITLE "Screen 3", TITLE-BAR, NO WRAP,
HANDLE IS Form3-Handle

DISPLAY Form3 UPON Form3-Handle .

Acu-Form1-Proc.
PERFORM UNTIL Exit-Pushed
ACCEPT Form1
ON EXCEPTION PERFORM Acu-Form1-Evaluate-Func
END-ACCEPT
END-PERFORM
DESTROY Form1-Handle
INITIALIZE Key-Status .

Acu-Form2-Proc.
PERFORM UNTIL Exit-Pushed
ACCEPT Form2
ON EXCEPTION PERFORM Acu-Form2-Evaluate-Func
END-ACCEPT
END-PERFORM
DESTROY Form2-Handle
INITIALIZE Key-Status .

Acu-Form3-Proc.
PERFORM UNTIL Exit-Pushed
ACCEPT Form3
ON EXCEPTION PERFORM Acu-Form3-Evaluate-Func
END-ACCEPT
END-PERFORM
DESTROY Form3-Handle
INITIALIZE Key-Status .

Acu-Form1-Evaluate-Func.
EVALUATE TRUE
WHEN Exit-Pushed
PERFORM Acu-Form1-Exit
WHEN Event-Occurred
IF Event-Type = Cmd-Close
PERFORM Acu-Form1-Exit
END-IF
WHEN Key-Status = 22
PERFORM go-to-screen-2
END-EVALUATE
MOVE 1 TO Accept-Control .

Acu-Form2-Evaluate-Func.
EVALUATE TRUE
WHEN Exit-Pushed
PERFORM Acu-Form2-Exit
WHEN Event-Occurred
IF Event-Type = Cmd-Close
PERFORM Acu-Form2-Exit
END-IF
WHEN Key-Status = 33
PERFORM go-to-screen3
END-EVALUATE
MOVE 1 TO Accept-Control.

Acu-Form3-Evaluate-Func.
EVALUATE TRUE
WHEN Exit-Pushed
PERFORM Acu-Form3-Exit
WHEN Event-Occurred
IF Event-Type = Cmd-Close
PERFORM Acu-Form3-Exit
END-IF
END-EVALUATE
MOVE 1 TO Accept-Control .

Acu-Form1-Exit.
SET Exit-Pushed TO TRUE .

Acu-Form2-Exit.
SET Exit-Pushed TO TRUE .

Acu-Form3-Exit.
SET Exit-Pushed TO TRUE .

Acu-Form1-Event-Extra.
EVALUATE Event-Type
WHEN Msg-Close
PERFORM Acu-Form1-Msg-Close
END-EVALUATE .

Acu-Form1-Msg-Close.
ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
IF Quit-Mode-Flag = ZERO
PERFORM Acu-Form1-Exit
PERFORM Acu-Exit-Rtn
END-IF .


go-to-screen-2.
perform Acu-Form2-Routine .
go-to-screen3.

perform Acu-Form3-Routine .

2006-07-10, 6:55 pm

In article <1152544585.627880.228970@p79g2000cwp.googlegroups.com>,
<sgbojo@gmail.com> wrote:

[snip]

> Acu-Form1-Create-Win.
> DISPLAY Standard GRAPHICAL WINDOW
> LINES 13.00, SIZE 47.00, CELL HEIGHT 10,
> CELL WIDTH 10, COLOR IS 65793, LABEL-OFFSET 0,
> LINK TO THREAD, MODELESS, NO SCROLL, WITH SYSTEM MENU,
>
> TITLE "Screen", TITLE-BAR, NO WRAP,
> HANDLE IS Form1-Handle
>
> DISPLAY Form1 UPON Form1-Handle .


Oh, look... DISPLAYs! Didn't someone say that something might include,
most likely, a 'simple DISPLAY'?

DD

Pete Dashwood

2006-07-11, 3:55 am


<docdwarf@panix.com> wrote in message news:e8trum$5mf$1@reader2.panix.com...
> In article <1152544585.627880.228970@p79g2000cwp.googlegroups.com>,
> <sgbojo@gmail.com> wrote:
>
> [snip]
>
>
> Oh, look... DISPLAYs! Didn't someone say that something might include,
> most likely, a 'simple DISPLAY'?
>
> DD
>

Er... I believe it was the same person who suggested that BMS macros might
need revision.... :-)

Personally, I wouldn't believe a word that particular poster said... :-)

Pete.


2006-07-11, 7:55 am

In article <4hhapvF1rlon7U1@individual.net>,
Pete Dashwood <dashwood@enternet.co.nz> wrote:
>
><docdwarf@panix.com> wrote in message news:e8trum$5mf$1@reader2.panix.com...
>Er... I believe it was the same person who suggested that BMS macros might
>need revision.... :-)


That might be, Mr Dashwood... and it might be that such a suggestion could
have been an attempt - perhaps successful, perhaps failed - to get the
original poster to be a bit more forward with such things as compiler and
platform.

>
>Personally, I wouldn't believe a word that particular poster said... :-)


Even such an assertion were along the lines of 'This statement is a lie'?

DD

Pete Dashwood

2006-07-11, 7:55 am


<docdwarf@panix.com> wrote in message news:e8vt3c$9i6$1@reader2.panix.com...
> In article <4hhapvF1rlon7U1@individual.net>,
> Pete Dashwood <dashwood@enternet.co.nz> wrote:
>
> That might be, Mr Dashwood... and it might be that such a suggestion could
> have been an attempt - perhaps successful, perhaps failed - to get the
> original poster to be a bit more forward with such things as compiler and
> platform.
>
>
> Even such an assertion were along the lines of 'This statement is a lie'?
>
> DD
>

Not even if family members, now sleeping with the angels, moved the Brooklyn
Bridge to the farm where his Grandpappy dispensed homilies about never using
oneself as a comparative because of the inevitable disappointment, and a
corner office idiot ruled that answering a question with a question is no
answer at all.

Not even if Burnham wood be moved to Dunsinane.

In short, "no".

On the other hand... one shouldn't live in a fixed condition, it's good to
change your mind occasionally, review things, try a different angle, taking
it by and large, at the end of the day, when all's said and done, ....maybe.
:-)

Pete.



2006-07-11, 7:55 am

In article <4hhj21F1q450hU1@individual.net>,
Pete Dashwood <dashwood@enternet.co.nz> wrote:
>
><docdwarf@panix.com> wrote in message news:e8vt3c$9i6$1@reader2.panix.com...

[snip]
[color=darkred]

[snip]
[color=darkred]
>In short, "no".


Well... nice to see that possibility covered, as well.

>
>On the other hand... one shouldn't live in a fixed condition, it's good to
>change your mind occasionally, review things, try a different angle, taking
>it by and large, at the end of the day, when all's said and done, ....maybe.
>:-)


It is a wonderful world that has such uncertainties in it, aye.

DD

Richard

2006-07-11, 6:55 pm


docdwarf@panix.com wrote:

> That might be, Mr Dashwood... and it might be that such a suggestion could
> have been an attempt - perhaps successful, perhaps failed - to get the
> original poster to be a bit more forward with such things as compiler and
> platform.


Yet she had previously clearly stated: "using acucobol-gt 6.0"

How much more forward was needed ?

2006-07-11, 6:55 pm

In article <1152645596.262109.195920@m73g2000cwd.googlegroups.com>,
Richard <riplin@Azonic.co.nz> wrote:
>
>docdwarf@panix.com wrote:
>
>
>Yet she had previously clearly stated: "using acucobol-gt 6.0"
>
>How much more forward was needed ?


Perhaps enough to get the other half of 'compiler and platform', Mr
Plinston... or, hope beyond hope, a sign that something had been done
other than what appeared to be stub routines.

The choice, of course, to do other peoples' jobs/homework for them is an
individual one... if that's how one wishes to spend one's time then well
and good.

DD

Richard

2006-07-11, 6:55 pm


docdwarf@panix.com wrote:

>
> Perhaps enough to get the other half of 'compiler and platform',


Then you show the depth of your lack of understanding. There is no
'other half' where Acucobol is involved, Acu runs identically from a
single source wherever it runs. In fact Acu started when a large
corporate RM Cobol user found that it was necessary to compile and/or
test their programs on each platform that they wanted to distribute to.
They wrote their own system that was a complete VM (just like Java's)
that isolated the program from the platform.

So the 'other half' is also 'using acucobol-gt 6.0'.

> or, hope beyond hope, a sign that something had been done
> other than what appeared to be stub routines.


There again, that was not a stub routine but was complete for the
function required.

> The choice, of course, to do other peoples' jobs/homework for them is an


It seemed to me to be neither job nor homework.

> individual one... if that's how one wishes to spend one's time then well
> and good.


Whereas you seem to prefer to spend your time doing ... something else
entirely.

2006-07-11, 6:55 pm

In article <1152648766.601348.3780@35g2000cwc.googlegroups.com>,
Richard <riplin@Azonic.co.nz> wrote:
>
>docdwarf@panix.com wrote:
>
>
>Then you show the depth of your lack of understanding.


It took you this long to find *that* out? I've had that on display for
e'er-so-long, or so I've been told... and with little need for me to make
midsentence interruptions, unlike others.

[snip]

>
>It seemed to me to be neither job nor homework.


What appears one way to you, Mr Plinston, just might possible appear
another way to someone else... and be intended yet another way by the
originator.

>
>
>Whereas you seem to prefer to spend your time doing ... something else
>entirely.


How *very* profound, Mr Plinston... I hope you've not strained something
there.

DD

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com