| 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 | 
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.R | Title | User | Personal Name | Date | Lines | 
|---|---|---|---|---|---|
| 298.1 | This works for me | FDCV01::LEVASSEUR | Barking Pumpkin Software Inc | Fri Jan 12 1990 12:06 | 34 | 
|     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.2 | re: .1 | FDCV01::LEVASSEUR | Barking Pumpkin Software Inc | Fri Jan 12 1990 12:32 | 7 | 
|     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
 | |||||