[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ilbbak::ibi_focus

Title:FOCUS, from INFORMATION BUILDERS
Moderator:ZAYIUS::BROUILLETTE
Created:Thu Feb 19 1987
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:615
Total number of notes:1779

298.0. "Trapping null response with prompt" by AYOV27::MCONNELLY () Mon Jan 08 1990 12:34

I have a FOCUS menu focexec. I am trying to trap incorrect responses
from user. The focexec works fine EXCEPT if response is carriage return
- in which case FOCUS drops to next line in exec with :-

EXEC    :
> 

  How can I trap a null return as an invalid one.

  I have enclosed the focexec below.
 
  Any help will be appreciated.
     
      Martin.




-STARTPGM
-CRTCLEAR
-TYPE                               MENU HEADING 
-TYPE                               ------------
-TYPE
-TYPE                    1. REPORT 1 
-TYPE                    2. REPORT 2 
-TYPE                    3. REPORT 3 
-TYPE           
-TYPE                    E. Exit 
-TYPE
-TYPE
-PROMPT &SELECT.Please choose option: . 
-TYPE
-IF &SELECT EQ '1' GOTO OPTION1;
-IF &SELECT EQ '2' GOTO OPTION2;
-IF &SELECT EQ '3' GOTO OPTION3;
-IF &SELECT EQ 'E' GOTO OPTIONE;
-TYPE *** SELECTION MUST BE 1,2,3 or E; 
VMS WAIT 00:00:01 
-RUN
-GOTO STARTPGM
-**********************************************************************
-OPTION1
-**********************************************************************
.
.
.   rest of exec
T.RTitleUserPersonal
Name
DateLines
298.1This works for meFDCV01::LEVASSEURBarking Pumpkin Software IncFri Jan 12 1990 12:0634
    In my fex's I trap null responses in 2 ways. If user prompt options
    are A, B, or C. Rather thasn using prompt I use CRTFORM and set
    variables EG:
    
    -SET &ASK = ' ';
    -MUMBLE
    -CRTFORM
    -" Select from below"
    -""
    -" A. Mumble 1"
    -" B. Mumble 2"
    -" C. Mumble 3"
    -""
    -"    ENTER A,B, or C: <&ASK"
    -""
    -IF &ASK NE A OR B OR C THEN GOTO MUMBLE;
    -IF &ASK EQ ' ' THEN GOTO MUMBLE;
    -IF &ASK EQ A THEN GOTO RPTA;
    . 
    .
    .
      If response does not equal any of those offered or is a null, then
    user is returned to a label. You can also include a set message to
    display the error and ask for re-input. Hope this helps
    
    Ray
    
    -
    -NULLBL
    -.
     .
     Menu again
    
    -If 
298.2re: .1FDCV01::LEVASSEURBarking Pumpkin Software IncFri Jan 12 1990 12:327
    I forgot in .1 to mention that I had this same problem with PROMPT.
    If I responded with a valis option to the > then it ran, but this
    confused users. The dialogue manager variables with CTRFORM work
    fine. If you want to tlak more offline regarding error trapping
    send mail, I can send you examples.
    
    Ray