HP3000-L Archives

February 2005, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Matthew Perdue <[log in to unmask]>
Reply To:
Matthew Perdue <[log in to unmask]>
Date:
Fri, 11 Feb 2005 16:53:41 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (95 lines)
Quoting Peter Smithson <[log in to unmask]>:

> In article <[log in to unmask]>, [log in to unmask]
> says...
>
> > The screen buffer is not read if a function key is pressed, only if enter
> > is pressed. If the user pressed a function key, and you want to know the
> > contents of the screen buffer, you have to force a read with VGETBUFFER.
>
> Thanks for the replies - I know there isn't much point in running the
> VFIELDEDITS when no buffer is present (as they hit a function key).
>
> I'm trying to figure out how some customers code is working.  In the
> code sample I gave, you can see that there is no conditinal execution of
> code.  I think they do this is it's a generic library of calls but I
> wrote a simple example program showing the behaviour.
>
> Without the VSETERROR and without setting numerrs, I get an error from
> VREADFIELDS (due to the required fields) whether I hit a function key or
> enter.
>
> With the VSETERROR and setting numerrs, I only get an error from
> VREADFIELDS if enter is pressed.
>
> Anyone know why?
>
> Cheers
>
> Peter

This is a code snippet of what I use:

 MOVE SPACES        TO MBR-MSTR-SPACES.
 MOVE HOLD-MEMB-ID  TO S-MM-MBR-KEY.
 MOVE "MEMBER_MAST" TO COM-NFNAME.

 CALL "VGETNEXTFORM" USING COMAREA.
 IF COM-STATUS NOT = 0
    MOVE 0 TO COM-STATUS
    CALL "VCLOSETERM" USING COMAREA
...etc....

 CALL "VPUTBUFFER" USING COMAREA MBR-MSTR-SCREEN
                                 MBR-MSTR-BUFFER.
 MOVE SPACES TO ERR-MSG.
 MOVE "Enter member number, press enter"   TO ERR-MSG.
 MOVE 2 TO FIELD-NUM.
 CALL "VSETERROR" USING COMAREA FIELD-NUM ERR-MSG MSG-LEN.
 CALL "VSHOWFORM" USING COMAREA.
*
110-PROCESS-MBR-MSTR-SCREEN.

 MOVE 0 TO COM-STATUS COM-NUMERRS.
 CALL "VREADFIELDS" USING COMAREA.

 IF ENTER-TIME-OUT GO TO 010-SETUP-MAIN-SCREEN.

 CALL "VGETBUFFER"  USING COMAREA MBR-MSTR-SCREEN
 IF ENTER-KEY GO TO 120-PROCESS-FIELD-EDITS.
 IF           F1 GO TO  010-SETUP-MAIN-SCREEN
      ELSE IF F2 GO TO 100A-MEMBER-ADDRESS
      ELSE IF F3 GO TO 100F-MEMBER-FINANCIAL
      ELSE IF F4 GO TO 100I-MEMBER-INQUIRIES
      ELSE IF F5 MOVE SPACES TO HOLD-MEMB-ID
                 GO TO  100-MEMBER-MASTER
      ELSE IF F6 GO TO
      ELSE IF F7 GO TO
      ELSE IF F8 GO TO  010-SETUP-MAIN-SCREEN
      ELSE
        MOVE SPACES TO ERR-MSG
        MOVE "INVALID KEY SELECTED"  TO ERR-MSG
        CALL "VPUTWINDOW" USING COMAREA ERR-MSG MSG-LEN
        CALL "VSHOWFORM"  USING COMAREA
        GO TO 110-PROCESS-MBR-MSTR-SCREEN.
*
120-PROCESS-FIELD-EDITS.

 CALL "VFIELDEDITS" USING COMAREA.
 IF COM-NUMERRS NOT = 0
    MOVE SPACES TO ERR-MSG
    CALL "VERRMSG"    USING COMAREA ERR-MSG MSG-LEN R-LEN
    CALL "VPUTWINDOW" USING COMAREA ERR-MSG MSG-LEN
    CALL "VSHOWFORM"  USING COMAREA
    GO TO 110-PROCESS-MBR-MSTR-SCREEN.
*
130-PROCESS-DATA.

 CALL "VGETBUFFER" USING COMAREA MBR-MSTR-SCREEN
                                 MBR-MSTR-BUFFER.

...etc....

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2