Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

CompaqCobol (VMS)
I have a screen layout coded in the SCREEN SECTION. This layout is
processed in the PROCEDURE DIVISION by "DISPLAY SCREEN-1" and by "ACCEPT
SCREEN-1".

After processing the operator's input, the program needs to reject
invalid entries. So I loop back to the DISPLAY and ACCEPT of the screen,
providing an error message explaining what value is inacceptable.

Is there any (easy) way to place the cursor in the field where the
inappropriate value was entered?

Thanks a lot in advance,

Volker


Report this thread to moderator Post Follow-up to this message
Old Post
Volker N. Englisch
04-26-05 01:55 PM


Re: CompaqCobol (VMS)
Hi,

I've never actually used it myself, but the CURSOR IS clause in the
Special-Names paragraph may be what you're looking for?

Regards Richard Maher

"Volker N. Englisch" <englisch.ahr@gmx.de> wrote in message
news:d4l7c0.1j8.1@ahr.rsli.de...
> I have a screen layout coded in the SCREEN SECTION. This layout is
> processed in the PROCEDURE DIVISION by "DISPLAY SCREEN-1" and by "ACCEPT
> SCREEN-1".
>
> After processing the operator's input, the program needs to reject
> invalid entries. So I loop back to the DISPLAY and ACCEPT of the screen,
> providing an error message explaining what value is inacceptable.
>
> Is there any (easy) way to place the cursor in the field where the
> inappropriate value was entered?
>
> Thanks a lot in advance,
>
> Volker
>



Report this thread to moderator Post Follow-up to this message
Old Post
Richard Maher
04-26-05 01:55 PM


Re: CompaqCobol (VMS)
In article <d4l7c0.1j8.1@ahr.rsli.de>,
Volker N. Englisch <englisch.ahr@gmx.de> wrote:

[snip]

>Is there any (easy) way to place the cursor in the field where the
>inappropriate value was entered?

Maybe.  Please post some of the code you have now that is failing to do
this.

DD
kk

Report this thread to moderator Post Follow-up to this message
Old Post
docdwarf@panix.com
04-26-05 08:55 PM


Re: CompaqCobol (VMS)
Richard Maher wrote:
 

> I've never actually used it myself, but the CURSOR IS clause in the
> Special-Names paragraph may be what you're looking for?

Unfortunately there seems to be no CURSOR IS clause in CompaqCobol - at
least the documentation doesn't mention it.

Volker


Report this thread to moderator Post Follow-up to this message
Old Post
Volker N. Englisch
04-26-05 08:55 PM


Re: CompaqCobol (VMS)
docdwarf@panix.com wrote:
> Volker N. Englisch <englisch.ahr@gmx.de> wrote:
> 
>
> Maybe.  Please post some of the code you have now that is failing to
> do this.

Here comes an entire test code. When the user enters something in the
NAME field, but leaves the CITY field empty, the message shows the
mistake, but the cursor is again placed in the NAME field. I'd like the
cursor to be in the (erroneous) CITY field.

Please pardon the upper case only, the terminal I used recently for
entering the code was a very ancient one :-)

Volker

IDENTIFICATION DIVISION.
PROGRAM-ID.      T1.
AUTHOR.          EH41.
DATE-WRITTEN.    26-APR-2005.
DATE-COMPILED.
SECURITY.        EDP.
*
DATA DIVISION.
WORKING-STORAGE SECTION.
77  W-OK                        PIC X(01).
77  W-MESSAGE                   PIC X(79).
01  W-DAT-NAME                  PIC X(30).
01  W-DAT-CITY                  PIC X(30).
*
SCREEN SECTION.
01  SCREEN-1 BLANK SCREEN.
03 FILLER  LINE 03 COLUMN 01 PIC X(79) FROM W-MESSAGE.
03 FILLER  LINE 10 COLUMN 01 VALUE "NAME:".
03 FILLER  LINE 12 COLUMN 01 VALUE "CITY:".
03 S1-NAME LINE 10 COLUMN 07 PIC X(30) USING W-DAT-NAME
HIGHLIGHT UNDERLINE AUTO.
03 S1-CITY LINE 12 COLUMN 07 PIC X(30) USING W-DAT-CITY
HIGHLIGHT UNDERLINE AUTO.
*
PROCEDURE DIVISION.
T1-1000.
MOVE SPACES TO W-MESSAGE.
MOVE SPACES TO W-DAT-NAME.
MOVE SPACES TO W-DAT-CITY.
T1-1100.
MOVE "J" TO W-OK.
DISPLAY SCREEN-1.
ACCEPT  SCREEN-1.
MOVE SPACES TO W-MESSAGE.
IF W-DAT-NAME EQUAL SPACES THEN
MOVE "NAME MUST NOT BE BLANK" TO W-MESSAGE
MOVE "N" TO W-OK
END-IF.
IF W-OK EQUAL "J" THEN
IF W-DAT-CITY EQUAL SPACES THEN
MOVE "CITY MUST NOT BE BLANK" TO W-MESSAGE
MOVE "N" TO W-OK
END-IF
END-IF.
IF W-OK EQUAL "N" THEN GO TO T1-1100.
STOP RUN.


Report this thread to moderator Post Follow-up to this message
Old Post
Volker N. Englisch
04-26-05 08:55 PM


Re: CompaqCobol (VMS)
In article <d4llkc.2pk.1@ahr.rsli.de>,
Volker N. Englisch <englisch.ahr@gmx.de> wrote:
>docdwarf@panix.com wrote: 
>
>Here comes an entire test code.

Hmmmmm... smells like homework to me.

>When the user enters something in the
>NAME field, but leaves the CITY field empty, the message shows the
>mistake, but the cursor is again placed in the NAME field. I'd like the
>cursor to be in the (erroneous) CITY field.

I'll take a guess and say the difficulty is in ACCEPTing the entire screen
again here:

[snip]

>       T1-1100.
>           MOVE "J" TO W-OK.
>           DISPLAY SCREEN-1.
>           ACCEPT  SCREEN-1.

... instead of addressing the field you need.

DD


Report this thread to moderator Post Follow-up to this message
Old Post
docdwarf@panix.com
04-26-05 08:55 PM


Re: CompaqCobol (VMS)
Volker,

you need a simple trick to solve this problem  ---- when you display
the error
message that pertains to the Name-field, then you must ACCEPT that
field
after displaying the message. Likewise, when you display an error
message
for the City-field, then you must ACCEPT that field after displaying
the message.

case in point:

display "You must enter the name to proceed" at 2301
accept S1-name with beep

OR

display "You must enter the city name to proceed" at 2301
accept S1-city with beep

hope these information helps.

Kellie.


Report this thread to moderator Post Follow-up to this message
Old Post
Kellie Fitton
04-26-05 08:55 PM


Re: CompaqCobol (VMS)
Hi,

thank you very much, that was it. I didn't find that statement while
searching the language guide, but I was wrong and obviously unable to
find it.

Volker

"Richard Maher" <maher_rj@hotspamnotmail.com> schrieb im Newsbeitrag
news:d4l703$pb5$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
> Hi,
>
> I've never actually used it myself, but the CURSOR IS clause in the
> Special-Names paragraph may be what you're looking for?
>
> Regards Richard Maher
>
> "Volker N. Englisch" <englisch.ahr@gmx.de> wrote in message
> news:d4l7c0.1j8.1@ahr.rsli.de... 
"ACCEPT 
screen, 
>
>


Report this thread to moderator Post Follow-up to this message
Old Post
Volker N. Englisch
04-26-05 08:55 PM


Re: CompaqCobol (VMS)
docdwarf@panix.com> wrote:
> Volker N. Englisch <englisch.ahr@gmx.de> wrote: 
at 
>
>
http://h71000.www7.hp.com/DOC/73fin...obol_refman.pdf
> http://h71000.www7.hp.com/DOC/73fin...df/cobol_um.pdf
> http://www.google.com/search?hl=en&...q+cobol&spell=1
>
> ... all seem to disagree.

Indeed they do. I had a search over the HTML version, and it wasn't
found. Sorry.

Volker


Report this thread to moderator Post Follow-up to this message
Old Post
Volker N. Englisch
04-26-05 08:55 PM


Re: CompaqCobol (VMS)
docdwarf@panix.com wrote:
> Volker N. Englisch <englisch.ahr@gmx.de> wrote: 
> Hmmmmm... smells like homework to me.

No, it isn't. That was about 30 years ago :-)
 
the 
>
> I'll take a guess and say the difficulty is in ACCEPTing the entire
screen
> again here:
>
> ... instead of addressing the field you need.

Thanks, I will check that out.

Volker


Report this thread to moderator Post Follow-up to this message
Old Post
Volker N. Englisch
04-26-05 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:27 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.