ͫFU " <nUB Lll * * * *footnote continues next pagecontinued footnotePanasonic KX-P1124i `LRx x 420 F:\EN450 163rm  xed x x xb8-R-A:5 -_LRrJj+TNX^ZzC.:;^|\/()<>[]{}IA1ai023456789  4 ,   // ::7L-T-T-+-R-!xXxx#7L-T-T-+&-R-(%X%CH Footer F#=3 @7L-T-T-+&-R-(%X%ENABLE'S .POPUP COMMANDMIn the late 1991, Enable introduced (in version 4.0, maint. release 19.0) a Rnew, undocumented Procedural Language command: .popup an advanced command Pdesigned to provide scrolling pick lists (pointnshoot lookup windows). Both Minput forms and report forms can use these popup pick lists to simplify and Pexpedite user lookups and selection of desired options from lists of unlimited Moptions. These operate with much less RAM overhead and considerably faster P(around 2X) than alternative methods of providing lookups for an Enable user.MUsers of .popup should be moderately familiar with the structure and use of PEnable's DBMS or very familiar with database theory in general. It is assumed Min this discussion that the reader is knowledgeable with these DB concepts: Qexternal fields, derived fields, primary key, indices, secondary database, link <field, record pointer, literals, and indirect addressing. NThe .popup command can use up to 18 parameters and display up to 38 fields. NThe parameters set the size, shape and location of the scrolling pick list. LThey also determine the sequence and selection criteria for the records or Poptions that are displayed. They specify whether the proximity search feature Mwill be used, which record the cursor will be on when the pick list is next Odisplayed, and more. The fields displayed can include shortened fields (e.g. Oan initial in lieu of a first name), concatenated fields and derived fields. LUsing the .popup command with the primary database is dangerous because it Jmoves the record pointer. This should only be done if you are expert at Hrepositioning the pointer when you are finished with the .popup window.OBecause of the great number of parameters and fields, you may have difficulty Ofitting all of them on a single line. For this reason, or simply to view the Oentire string without the need for lateral scrolling, you may wish to use the O.begin command (the format will be .begin popup.); remember to use a single Nsemi-colon (;) to terminate any string that starts with the .begin command. AFor clarity, you may want to put each parameter on its own line./͸ In the example here, we will display a<Albany 8.00 popup pick list with a list of sales tax>Allegany8.00 localities and rates for New York state.?Amsterdam7.00 In this instance, we will use a vertical:Batavia 7.00 window that occupies roughly the left'Bronx 8.25 third of the screen.\Broome 7.00@Canandaigua7.00 At left is the look of the desired pickCattaraugus8.00 list.Cayuga 8.00>Chatauqua7.00 Before listing the code that was used<Chemung 7.00 produce this pick list, let's examine<Chenango7.00 the purpose of each of the parameters =Chenango7.00 used to control the look and behavior;Clinton 7.00 of the pick lists in general. The box<Columbia7.00 below will be used as a reference for 2Corning 7.00 explaining the 18 parameters.Cortland, City 8.00Cortland, County8.00Delaware6.00͵Locality:;,HPage Break (User Defined)  ba͸c$kk< Title Line (optional)h͵j< i< Data display (each column is a field)  dd h͵j-k i k< Selector prompt (optional) e;g f<P01 - POP:Box_Title .Optional title at top of popup window(P02 - POP:Box_Row .Starting row (0-23)+P03 - POP:Box_Col .Starting column (0-79):P04 - POP:Box_Height .Box height in rows (maximum is 25);P05 - POP:Box_Width .Box width in columns (maximum is 80)P06 - POP:Box_Set .No blanks1a) top, left cornerg) bottom, right corner9b) top, horiz. lineh) under title bar, left corner>c) top, right corneri) under title bar, horizontal line;d) side, vert. linesj) under title bar, right corner=e) bottom, left corner k) title bar and selector prompt,1 f) bottom, horiz. linevertical side lines=P07 - POP:DB_Name* .Database file name for popup windowQP08 - POP:DB_Index_Field*.Field to determine sequence of displayed recordsPP09 - POP:First_Index_Value*.Determines what record cursor will be on firstQP10 - POP:Selector_Info*.Character 0 or " for numeric or text index promptRP11 - POP:Index_Condition*.E.G. LNAME >= "B" and LNAME <= "D" for B-D namesIP12 - POP:Where_Clause*.E.G. TRANDATE < "92/01/01" and NOT TAXABLEKP13 - POP:Cursor_Start.Use with SysRec_Start to re-enter window at last exit positionJP14 - POP:SysRec_Start.Set to 0 (or 1 if no index criteria); on return 1from window, will contain DB_Name.SYS:RECORDH Comment9NFFGM- I find that if 1, popup box is blank. If zero, it give a correct indexedHFread, but cursor will rolodex down (but not back up) unless the zero isQFin the strtsysrec field. If the latter it works properly. TIn fact this fieldHFTalone requires the use of the POP database because it seems to move theMFTpointer to Sys:Record = 0 (or whatever other number you feed it) which loses BTthe link to the current record. @mU>P15 - POP:Selector_Prompt.Prompt label for proximity searchDP16 - POP:Special_Flag."A" Add mode. Blank line at end to take a.input(x,y) command5"C" Clear mode. Blanks screen area under window3"D" Display one shot. Displays & returns; no input option 5"M" Menu selector. One key must complete index 5key uniquely; alpha/num will go to nearest lineand end the popupEP17 - POP:Box_Refresh."R" Redraws box and background at each popup5"O" Omits redrawing box and unchanged backgroundLP18 - POP:Field_Separator.Character between field columns; may be a spaceNF01 - F16 - Field_List*.Sixteen of a possible 96 fields to be displayedNIf the title option is omitted, no title area will be provided. The default Nposition for the title is centered. The quoted string can include an align- 8ment character (<,^, or >) such as "="D" and COMPANY<="G$" will select all companies that begin with D, E, BF, or G. This field can use indirect addressing and is optional.LThe POP:Where_Clause operates like the POP:Index_Condition or the database NWhere: clause to restrict the records displayed. It is used for fields that Oare not indexed or where a compound condition is required. Example: ACTIVE= QYes and DATELOGD<="92/12/31" will select records of active people entered prior Bto 1993. This field can use indirect addressing and is optional.PThe POP:Cursor_Start can be used with POP:SysRec_Start (see below) to re-enter Nthe popup window where you last left it. When you leave the popup window, a Nfield can be set to the row the cursor bar was on as the window closed. The Ltop line of the popup window is row 1. Rather than use a literal for this 6parameter, use a field name or indirect addressing. OThe POP:SysRec_Start can be used with POP:Cursor_Start to control the look of Qthe popup window when re-entering it. When you leave the popup window, a field Qcan be set to the SYS:RECORD number from the selected record in the POP:DB_Name Jtable. Re-entry will set the window to this record number. Setting the Minitial value of either this parameter or POP:Cursor_Start to a value other 2than 0 will override the POP:First_Index_Value.,HPage Break (User Defined) PTo designate a prompt for the POP:Selector_Info (above), use the POP:Selector_ QPrompt. This parameter is ignored if POP:Selector_Info is not used. It is NOT Nrequired to use the POP:Selector_Info parameter. Indirect addressing can be used for this parameter.QThe POP:Special_Flag is a text expression to designate the mode of operation of Jthe popup window. For most operations this parameter can be left blankQ1 or "A" - ADD. The popup window will provide a blank line at the end to allow H .input (X,Y) for data entry by the user into the display box. The H display will be drawn on the screen and then the popup window will ; close without doing any selection or keyboard input.M2 or "C" - CLEAR. This will blank out the section of the screen that would 7 have otherwise been covered with the popup window.N3 or "D" - DISPLAY ONE-SHOT. This will draw the popup window and then close J the window without displaying the cursor bar and without waiting for  keyboard entry.N4 or "M" - MENU. A single key must complete the index key (uniquely) and if E entered will not need an Enter key to continue. Similar to how H Enable menus work. The caller must still validate the selection. F Any alpha-numeric selection will go to the nearest selection and  close the popup window.,This parameter can use indirect addressing.EThe POP:Box_Refresh is normally set to Yes and operates like this:Q"R" or "1" or "Yes" or "True" - Draws the box surrounding the popup window and2 erases any area within the box that doesn't+ get overwritten with POP:DB_Name data.N"" or "0" or "No" or "False" - Re-enters a box already drawn on the screen 0 and only fills in new data values. Skips / erasing the background area and re-drawing the borders.,This parameter can use indirect addressing.NThe divider characters between columns of data is in the POP:Field_Separator Oparameter. These may include | or or or or any other desired character #including " " for a blank space. OThe POP:FieldList is a comma-separated list of field names to be displayed in Pthe popup window. If a field is to contain commas (such as @max(FLD1,FLD2) or Lany other function with arguments) then it must be in the form of a square !bracketed indirect field name.LNote: to exit the scrolling list in the popup window, choose a terminating Okeystroke (any not used by .popup) or double click your mouse. Upon exiting, Ethe item under the cursor bar is considered to have been selected. ,HPage Break (User Defined) OIf ANY parameters are omitted, a comma must still be used to hold its place. +Example: P01,P02,P07,P08,P11,P12, etc.KSet colors via profile options; the .color command is NOT active in popup windows.NDeleted records will be displayed unless excluded by the POP:Index_Condition +or the POP:Where_Clause described above. NTo refresh the screen for the primary file after closing a popup window, use 3the following line: .macro {Voff}{&Home}{Esc}{Von}MTo simplify copying popup code from one file to another and to expedite the Kchanges after renaming a field or making a similar change, ADE recommends Pstoring the parameters in a special database table. ADE uses POP.DBF for this Hpurpose. The key for the field names is on page 2 above. Here is the Nstructure and example data for one of the records (used to produce the sales tax pick list above). Database Structure Sample Data#Field Field Field For Sales TaxNameTypeSize P01C78 P02N20 P03N20P04N225P05N227 P06C11P07C8SALESTAXP08C10LOCALITY P09C16P10C16" P11C78 P12C78 P13N21 P14N71P15C16Locality: P16C1 P17C1Y P18C1"F01C23SALESTAX.LOCALITY{16}F02C23SALESTAX.RATE{4} F03C23 F04C23 F05C23 F06C23 F07C23 F08C23 F09C23 F10C23 F11C23 F12C23 F13C23 F14C23 F15C23 F16C23,HPage Break (User Defined) QHere is the actual code used in an Enable Procedural Language data entry screen .to provide for the popup window shown above: .input (13,9) TAXCODEL (.read SALESTAX index TAXCODE = TAXCODEL.if TAXCODEL = 0 #.read POP index SYS:RECORD = 4B.begin popup POP.P01,POP.P02,POP.P03,POP.P04,POP.P05,POP.P06,A[POP.P07],[POP.P08],[POP.P09],[POP.P10],[POP.P11],[POP.P12],6POP.P13,POP.P14,POP.P15,POP.P16,POP.P17,POP.P18, [POP.F01],[POP.F02];9.if SYS:LCHAR = 7181;; Scan code for Enter key+.let TAXCODEL = SALESTAX.TAXCODE".let TAXRATEL = SALESTAX.RATE .endif #.macro {Voff}{&Home}{Esc}{Von}.endif .update POPQThe last line writes to disk the values in the two fields: POP:Cursor_Start and LPOP:SysRec_Start. This will control the look and re-entry point when this )popup window is entered the next time.PNote: The .popup command is a preliminary function and is NOT YET SUPPORTED by MEnable Software, Inc. If you or your clients need support, it is available Mfrom ADE as an option. Please direct any questions or comments to Randy E. NBrinson (518-356-1970) or Denys Foley (315-462-3154) at American Development Enterprises.