12.07.2015 Views

JYACC FORMAKER C Programmer's Guide Contents 1 ... - Prolifics

JYACC FORMAKER C Programmer's Guide Contents 1 ... - Prolifics

JYACC FORMAKER C Programmer's Guide Contents 1 ... - Prolifics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NAMESYNOPSISsm_menu_proc - get a menu selection#include "smdefs.h"int sm_menu_proc (type)int type;DESCRIPTIONAllows you to tab, backtab, arrow, and scroll through a menu screen, and selectan item from it. The entry under the cursor is displayed in reverse video. Theroutine returns to the calling program when you hit EXIT or a function key (PF,SPF, or APP), or make a selection. A selection is made when you hit the TRANSMITkey, or a sequence of characters that uniquely match a menu entry (seemp_string).Hitting a key that matches the first character of a menu entry on the screencauses the cursor to be positioned to that entry. If type is UPPER (or LOWER),any alphabetic keyboard entry is translated to upper (or lower) case before amatch is attempted. If type contains both UPPER and LOWER, both translations aretried; the search is totally insensitive to case. Any other value yields acase-sensitive search. The search always starts at the beginning of the menu,and ignores off-screen data; to see off-screen menu items you must use thescrolling keys.Each menu selection must be defined as initial data in a tab-unprotected menufield. Furthermore, unless you change the default setting by calling mp_string,each selection must begin with a unique character.( You can define arbitraryreturn codes for each field using xform; the default is to use the firstcharacter of the menu entry itself. See the <strong>JYACC</strong> <strong>FORMAKER</strong> Author's <strong>Guide</strong> for adetailed discussion of menu creation and return values.Two auxiliary functions, mp_options and mp_string, can alter the behavior of thecursor; refer to their definitions.RETURNSEXAMPLEIf the cursor is not within a field, returns 0. The translated value (seesmkeys.h ) of EXIT, or of any other function key except TRANSMIT. If aselection is made with TRANSMIT or a menu character, the menu returncode defined in xform, or the first character of the selected entry ifthere is no return code.See sm_mp_string for an example.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!