Download SEDIT User`s Guide - Alpha Microsystems
Transcript
RIGHT. FROM THE START. RIGHT. FROM THE START. RIGHT. FROM THE START. RIGHT. FROM THE START. RIGHT. FROM THE START. RIGHT. FROM THE START. SEDIT User’s Guide RIGHT. FROM THE START. RIGHT. FROM THE START. RIGHT. FROM THE START. RIGHT. FROM THE START. RIGHT. FROM THE START. RIGHT. FROM THE START. RIGHT. FROM THE START. DSM-00178-03 A00 © 1995 Alpha Microsystems REVISIONS INCORPORATED REVISION DATE 00 March 1988 02 June 1992 03 September 1995 SEDIT User’s Guide To re-order this document, request part number DSO-00178-00 This Document applies to ESP versions 2.1 and later The information contained in this manual is believed to be accurate and reliable. However, no responsibility for the accuracy, completeness or use of this information is assumed by Alpha Microsystems. This document was written by Robert Shelton. This document may contain references to products covered under U.S. Patent Number 4,530,048. The following are registered trademarks of Alpha Microsystems, Santa Ana, CA 92799: AMIGOS AlphaBASIC AlphaFORTRAN 77 AlphaMATE AlphaWRITE VIDEOTRAX AMOS AlphaCALC AlphaLAN AlphaNET CASELODE Alpha Micro AlphaCOBOL AlphaLEDGER AlphaPASCAL OmniBASIC AlphaACCOUNTING AlphaDDE AlphaMAIL AlphaRJE VER-A-TEL The following are trademarks of Alpha Microsystems, Santa Ana, CA 92799: AlphaBASIC PLUS DART inFront/am AlphaVUE ESP AM-PC MULTI All other copyrights and trademarks are the property of their respective holders. ALPHA MICROSYSTEMS 2722 S. Fairview St. P.O. Box 25059 Santa Ana, CA 92799 AMTEC inSight/am TABLE OF CONTENTS CHAPTER ONE - INTRODUCTION...............................................................................1-1 WHAT IS SEDIT? .............................................................................................. 1-1 HOW THIS BOOK IS ORGANIZED ...................................................................1-1 GRAPHIC CONVENTIONS ............................................................................... 1-2 REFERENCE MATERIAL ..................................................................................1-3 CHAPTER TWO - USING SEDIT...................................................................................2-1 OPERATION OVERVIEW ..................................................................................2-1 THE SEDIT COMMAND .................................................................................... 2-1 ESP Main Menu Commands ..................................................................2-3 Viewing Help Information........................................................................ 2-4 The Screen Editor................................................................................... 2-4 The Field Editor.......................................................................................2-4 CHAPTER THREE - THE SCREEN EDITOR................................................................ 3-1 DESIGNING SCREENS .................................................................................... 3-1 MOVING THE CURSOR ................................................................................... 3-1 THE FUNCTION KEYS ..................................................................................... 3-2 The FIELD EDIT Key.............................................................................. 3-2 The MENU Key....................................................................................... 3-2 The HELP Key........................................................................................ 3-2 Function Key Summary Table................................................................. 3-3 SLASH COMMANDS..........................................................................................3-3 CREATING FIELDS ...........................................................................................3-3 Text Fields...............................................................................................3-4 Appearance Fields.................................................................................. 3-4 Creating a Line ...........................................................................3-4 Drawing a Box.............................................................................3-5 Overlapping Fields.................................................................................. 3-5 EDITING EXISTING FIELDS .............................................................................3-5 Positioning the Cursor for Editing Operations.........................................3-5 Marking a Field....................................................................................... 3-6 Modifying a Field.....................................................................................3-6 Copying a Field....................................................................................... 3-6 Moving a Field.........................................................................................3-7 Centering a Field.........................................................................3-7 Rearranging the Screen..........................................................................3-7 Deleting a Field....................................................................................... 3-8 SEDIT User’s Guide, Rev. 03 Page ii Table of Contents CHAPTER FOUR - THE FIELD EDITOR.......................................................................4-1 USING THE FIELD EDITOR ............................................................................. 4-1 Moving the Cursor ..................................................................................4-1 Changing Entries.................................................................................... 4-2 Displaying Help Information.................................................................... 4-2 Pull-down Menus ................................................................................... 4-2 Leaving the Field Editor.......................................................................... 4-3 THE FIELD EDITOR FIELDS ............................................................................ 4-3 Field Number.......................................................................................... 4-3 Field Renumbering......................................................................4-4 Field Max Size........................................................................................ 4-4 Field Min Size......................................................................................... 4-4 Window Size........................................................................................... 4-5 Field Flags.............................................................................................. 4-5 Field Class.............................................................................................. 4-7 Field Type............................................................................................... 4-7 Field Modifiers.........................................................................................4-7 Special Field Modifiers..........................................................................4-10 Read & Write Security...........................................................................4-11 Start & End Display Format ................................................................. 4-11 Background and Foreground Color ......................................................4-12 Field Buffer............................................................................................4-13 Field Default .........................................................................................4-13 Field Expression .................................................................................. 4-13 Pop-up Menu Selections ......................................................................4-13 Field Prompt .........................................................................................4-14 On-line Help .........................................................................................4-14 CHAPTER FIVE - FIELD EXPRESSIONS.....................................................................5-1 USES OF FIELD EXPRESSIONS ..................................................................... 5-1 GENERAL FORMAT ..........................................................................................5-1 Numbers................................................................................................. 5-2 Field Values.............................................................................................5-2 Glossary Items........................................................................................ 5-2 Operators................................................................................................ 5-3 Precedence................................................................................. 5-4 Mathematical Functions.......................................................................... 5-4 The IF Function........................................................................... 5-5 The SET Function....................................................................... 5-5 Field Functions........................................................................................5-6 Accumulators.......................................................................................... 5-9 SAMPLE FIELD EXPRESSIONS .................................................................... 5-10 CHAPTER SIX - PRINTING ESP SCREENS................................................................ 6-1 THE PRINT KEY.................................................................................................6-1 THE LIST COMMAND ....................................................................................... 6-1 PRINT DESTINATIONS .....................................................................................6-3 THE SEDIT /L OPTION...................................................................................... 6-3 SEDIT User’s Guide, Rev. 03 Table of Contents DOCUMENT HISTORY INDEX READER’S COMMENTS SEDIT User’s Guide, Rev. 03 Page iii CHAPTER ONE INTRODUCTION The Executive Screen Processor (ESP) is a software development tool. With ESP, you can rapidly create and maintain display screens, reports and menus, with very little programming. ESP makes it easy for you to provide consistent screen operation and offers tremendous flexibility. For more information about what ESP can do for your application software, see the Overview of ESP document. WHAT IS SEDIT? SEDIT is an AlphaVUE-like screen processor with which you can develop and maintain screens. Using a "what you see is what you get" editor, you create and position fields on the screen. You define parameters and attributes for each field that determine the field’s characteristics when a user accesses the screen through your application. With SEDIT you can quickly change display colors, field lengths, field formats, default entries, display attributes, security requirements, or help messages without changing your application’s source code. HOW THIS BOOK IS ORGANIZED This book contains six chapters: Chapter 1, "Introduction," briefly describes SEDIT and explains the graphic conventions used throughout the manual. Chapter 2, "Using SEDIT," describes how to call up and exit SEDIT and gives you an overview of its operation. Chapter 3, "The Screen Editor," discusses how to create and position screen fields using SEDIT. Chapter 4, "The Field Editor," describes how to define the characteristics and parameters for each field you create. Chapter 5, "Field Expressions," explains how you can use flexible expressions to set defaults and other characteristics of a field based on the formulas you choose. SEDIT User’s Guide, Rev. 03 Page 1-2 Chapter One Chapter 6, "Printing ESP Screens," describes the ways you can print while using SEDIT. GRAPHIC CONVENTIONS In order to make this document as easy as possible to understand, we use several conventions in layout and type style, so you can recognize whether we are talking about a command or key, when you’re to type an entry, and so on. CONVENTION EXPLANATION FILE.EXT AMOS command names and file names, such as TOOLBX.SYS, are shown in all capitals. Screen Editor ESP screen names are printed in the same type face as regular text, with initial capitals. What You Type Text you are expected to type is shown in a bold Courier typeface. Text you should type exactly as shown is in all capitals; variable responses or parts of commands, such as file names, are in lower case. What ESP Displays Text AMOS or ESP displays on your screen is shown in Courier typeface. LIST ESP command names are shown in small, bold capitals. KEY Keys you need to press are shown in a keycap box. KEY 1 / KEY 2 Two keys separated by a slash, like this, means you need to press them at the same time. Hold down the first key and press the second one. The halt symbol marks important information you should read carefully before continuing. This often indicates something you MUST or MUST NOT do, so read carefully. The hint symbol marks a helpful bit of information. It often points out a short cut which may save you time or trouble. The remember symbol marks information you need to keep in mind while you are following a set of instructions. SEDIT User’s Guide, Rev. 03 Introduction Page 1-3 REFERENCE MATERIAL This book assumes you have a certain amount of knowledge about AMOS in general and AlphaVUE in particular. If you need more information about a topic in these areas, you can refer to these other manuals published by Alpha Micro: AMOS System Commands Reference Manual AlphaVUE User’s Manual SEDIT User’s Guide, Rev. 03 CHAPTER TWO USING SEDIT This chapter discusses: The overall flow of work when using SEDIT. Using the SEDIT command. The ESP Main Menu and its options. How to get help information while using SEDIT. The Screen Editor and Field Editor displays. OPERATION OVERVIEW There are three principal screen displays associated with the creation and maintenance of your ESP screens. The first is the ESP Main Menu, the second is the Screen Editor, and the third is the Field Editor. The first screen you see when you use SEDIT is the ESP Main Menu. The ESP Main Menu is where you start an editing session to create a new screen or modify an existing one. It also lets you print and save screens and exit ESP when you are finished. From the ESP Main Menu you can access the Screen Editor. The Screen Editor is where you position the fields you want on your screen. From here you may call up the Field Editor or return to the ESP Main Menu. You define individual field parameters and characteristics on the Field Editor screen. When you exit the Field Editor you return to the Screen Editor. If you use the DART data base manager, you can also use the Screen Editor from the DART Maintenance Menu. When you do this, you do not see the ESP Main Menu. The Screen Editor and Field Editor work in the same way whether you access them from DART or through the ESP Main Menu. THE SEDIT COMMAND Before beginning an editing session, log to the account where you want to create and store your ESP screens. To call up the ESP Main Menu, from AMOS command level, use this command format: SEDIT filename SEDIT User’s Guide, Rev. 03 RETURN Page 2-2 Chapter Two filename is the name of the screen file you want to create or modify. Unless you specify otherwise, SEDIT assumes the file extension is .SCR. If the filename you specify does not exist, SEDIT responds with this message: filename does not exist, do you wish it created? Type Y RETURN to create the new screen file and continue or N RETURN to exit SEDIT. Whether you are creating a new screen or editing an existing one, the first screen you see after using the SEDIT command is the ESP Main Menu as shown below: ######### ## ## ####### ## ## ######### Executive ######## ## ## ## ######## ## ## ## ######## Screen ######## ## ## ## ## ######## ## ## ## Processor Version 2.2(xxx) 4 bytes in use 109848 bytes available +-------------------------------------------------------------------+ ! Enter Command: Edit ! ! ! ! Commands currently available: ! ! Edit - Edit the screen information ! ! List - List field information to printer ! ! Test - Test the screen ! ! Finish - Save current changes and leave editor ! ! Save - Save current changes ! ! Quit - Leave editor and abandon changes ! +-------------------------------------------------------------------+ Enter command -OR- press MENU key to return to edit mode 27-Apr-92 The ESP Main Menu shows you: The ESP software version number. The size of the current screen file in bytes. The available space in bytes; this lets you know how much room you have left to work with in your memory partition. A list of the ESP Main Menu commands. The ESP Main Menu is a central point in using SEDIT; it’s the first screen you see when you call up SEDIT and you return here to exit SEDIT. SEDIT User’s Guide, Rev. 03 Using SEDIT Page 2-3 ESP MAIN MENU COMMANDS When you want to update, save, or print a screen, or leave SEDIT, you do so from the ESP Main Menu. There are six ESP Main Menu commands; to use one of these commands, type the first letter of its name and press RETURN . You can use these commands directly from the Screen Editor by using a "slash command." See Chapter 3. The following list describes each ESP Main Menu command. COMMAND DESCRIPTION EDIT Takes you to the screen editor so you can update the current screen file. LIST Prints the current screen file. As you develop your screen, this is helpful for fine-tuning the screen’s design and layout; the print-out helps you see "behind the screen" to the characteristics of each field. The format of the printed screen file is described in Chapter 6. TEST Calls a test program which displays and processes the screen as if it had been called from an application. This test program notifies you when pre- or post-edit interrupts occur, and lets you make sure the screen behaves the way you want. To leave the test program, press MENU . FINISH Writes the current screen file on the disk and returns you to AMOS command level. This is the same as using the SAVE command followed by the QUIT command. SAVE Writes the current screen file on the disk without leaving SEDIT. As you create your screen, get in the habit of flipping back to the Main Menu every so often to use SAVE. This protects your work in the unlikely event the computer is rebooted. QUIT Abandons any changes you made since the last SAVE command and returns you to AMOS command level. QUIT is helpful when you use SEDIT and want to see an existing screen without making any changes, leaving it in the same condition as when you called it up. It can also prevent frustration in the creative process; if you call up a screen and make changes that don’t work out the way you want them to, just QUIT and start again. SEDIT User’s Guide, Rev. 03 Page 2-4 Chapter Two VIEWING HELP INFORMATION While you are using SEDIT, you see help messages at the bottom of the screen. These one line messages serve as reminders about the type of responses ESP expects from you. The text of the message is based on the cursor’s current location and changes as you move the cursor around the screen. If you need more information, you can call up more extensive help information by pressing HELP or ESCAPE ? . This help information may be several pages long. When there is more than one screen for a topic, you can go forward by pressing NEXT SCREEN or CTRL / T . If you want to look at something you’ve already passed, you can move back to a previous screen using PREV SCREEN or CTRL / R . THE SCREEN EDITOR To call up the Screen Editor from the ESP Main Menu, type E RETURN . Your screen clears and displays the current layout of the screen file you’re editing. For new screen files, your screen appears blank, except for the bottom status line, which shows the cursor’s current column and line position. You can now position the fields for your screen by moving the cursor where you want a field to be. Fields may be screen titles, messages, data entry fields, or special fields, such as boxes or lines. The bottom status line displays information about the screen you are building. From left to right it shows you: The current cursor position. If the cursor is in a field, the field number. If there is a marked location in effect, the screen coordinates for the marked area. If the marked location is a field, its field number appears to the right of the coordinates. The system date. Not all terminal types can display this information. Using the Screen Editor is described in Chapter 3. THE FIELD EDITOR Each field you create has certain characteristics associated with it. These are determined by the entries you make for it in the Field Editor. SEDIT User’s Guide, Rev. 03 Using SEDIT Page 2-5 You can access the Field Editor only from the Screen Editor. When you create a field using the Screen Editor (as described in Chapter 3), you are transferred to the Field Editor to enter information about the field. The Field Editor screen and all of its capabilities are described in Chapter 4. You can return to the Screen Editor from the Field Editor by pressing either: to keep any information you’ve added or changed. to abandon your changes and return the field’s characteristics to the way they were before (or not create a new field). EXECUTE MENU It’s important to become accustomed to how ESP interprets these two keys. EXECUTE causes ESP to store the current settings displayed in the Field Editor and return to the Screen Editor. MENU , on the other hand, aborts any changes made to the current field settings. EXECUTE is ESP’s normal means of recognizing completion of screen entry. SEDIT User’s Guide, Rev. 03 CHAPTER THREE THE SCREEN EDITOR This chapter describes how to use ESP’s Screen Editor. You design your screen using the Screen Editor by moving the cursor to where you want each field, then going to the Field Editor to set the characteristics and parameters for the field. The next chapter describes how to use the Field Editor. Besides positioning new fields using the Screen Editor, you can move, copy, or delete existing fields. This lets you easily try different screen layouts until you find the one you want. You can also perform any of the functions available from the ESP Main Menu from the Screen Editor by using a "slash command" as described below. This chapter covers everything you can do with the Screen Editor; but first, we include a few hints on designing screens. DESIGNING SCREENS Screen design is an important part of your application, especially as seen through the eyes of the people using your product. Although ESP makes creating this visual interface for your application easier than ever before, nothing can replace a well thought-out design. To make the screen creation process easier on you, we suggest you begin with a rough sketch. Include what you want the screen to look like and a preliminary list of all the data fields the screen must hold. Planning your screen beforehand can save you time and frustration. Screen design is a much broader and more philosophical subject than can be addressed in this document. If you are interested in finding information about researched methods for screen designs, this book may be very helpful: Handbook of Screen Format Design, Third Edition, by Wilbert O. Galitz. Published by Q.E.D. Information Sciences, Inc. MOVING THE CURSOR As stated above, the first step in creating a screen field is moving the cursor to where you want the field to be. As you move the cursor, the column and row coordinates at the bottom of the screen are updated. You can position the cursor anywhere on the Screen Editor display with the keys shown in the following table. SEDIT User’s Guide, Rev. 03 Page 3-2 Chapter Three TO MOVE THE CURSOR: USE THIS KEY: → Right Up Down Left To row 1, column 1 To top of screen To bottom of screen Next field Previous field Beginning of row End of row or CTRL / L or CTRL / K ↓ or CTRL / J ← or CTRL / H HOME or CTRL / A PREV SCREEN or CTRL / NEXT SCREEN or CTRL / TAB or CTRL / I BACK TAB or CTRL / ] SHIFT / ← SHIFT / → ↑ R T THE FUNCTION KEYS You can use the function keys to access the Main Menu or Field Editor. You can also perform some screen editing operations using the function keys, as described later. Keyboard overlays are available to help you locate the various function keys. Three keys you’ll use frequently from the Screen Editor are EDIT , MENU , and HELP . THE FIELD EDIT KEY On the Screen Editor, you press EDIT to indicate you want to create a field at the cursor location, or edit an already existing field. EDIT takes you to the Field Editor, where you set the characteristics and parameters for the field. The Field Editor is described in Chapter 4. THE MENU KEY From the Screen Editor, exit this session. MENU returns you to the Main Menu, where you can save, print or THE HELP KEY As with all ESP screens, help information is readily available. From the Screen Editor, you can display two kinds of help information depending on whether or not the cursor is on a field. If the cursor is on a field, pressing HELP displays an abbreviated form of the Field Editor settings for this field on the bottom status line. If the cursor is not on a field, pressing Screen Editor. HELP displays general information about using the SEDIT User’s Guide, Rev. 03 The Screen Editor Page 3-3 FUNCTION KEY SUMMARY TABLE The following table lists the function keys ESP uses. For each, it shows the key name, function key number for Alpha Micro’s AM-6x AM-72 and AM-75 terminals, the universal key sequence for its function, and the action this key performs from the Screen Editor. While HELP is not a function key, it is also included. NAME EDIT DELETE BLOCK MARK BLOCK COPY MENU SCROLL UP SCROLL DOWN SCREEN LEFT SCREEN RIGHT PRINT HELP KEY SEQUENCE F1 ESCAPE E F3 ESCAPE D F5 CTRL F6 ESCAPE C F13 ESCAPE ESCAPE ESCAPE + ESCAPE - ESCAPE < ESCAPE > F16 ESCAPE P HELP ESCAPE ? F14 SHIFT / F14 F15 SHIFT / F15 / P DESCRIPTION Calls up Field Editor Deletes field Marks location or field Copies marked field Goes to Main Menu Scrolls screen up Scrolls screen down Scrolls screen left Scrolls screen right Prints screen display Displays help SLASH COMMANDS The Screen Editor’s slash commands are an alternative way for you to perform any of the commands on the ESP Main Menu. Rather than pressing MENU , then choosing the command you want, just type / followed by the first letter of the command. Do not press RETURN . For example, /T takes you directly into test mode. You can use a slash command anytime you are in the Screen Editor, except when the menu requesting the type of line you want is displayed (see "Creating a Line," below). You cannot use slash commands from the Field Editor or any of its associated screens. If you type just a slash, a window appears showing you the possible commands. Edit is not listed, since you are already editing a screen. CREATING FIELDS There are typically two kinds of fields created for any screen you make with ESP: Text fields. These include both data fields, which can hold information from your application or accept input from the user, and message fields, such as screen titles. Appearance fields, either lines or boxes. The methods for creating text fields and appearance fields are slightly different. SEDIT User’s Guide, Rev. 03 Page 3-4 Chapter Three TEXT FIELDS There are three steps to creating a text field: 1. Move the cursor to where you want the first character of the field. For data fields, this is where the first character of the displayed or entered data should go, not the beginning of the prompt for the field. For message fields, it is where the first character of the message will display. 2. Press EDIT to enter the Field Editor, and define the field’s characteristics. The Field Editor is described in Chapter 4. 3. When you’re done using the Field Editor, press EXECUTE to save the field and return to the Screen Editor. The information you entered in the Field Editor, such as a screen prompt, appears on the Screen Editor display. The field number appears on the bottom status line. The field is automatically marked (see "Marking a Field," below). You may often find it easier to create a new field by copying an existing field and modifying the copy than to use this process to create the field from scratch. How to copy a field is described later in this chapter. It’s possible to define a field which doesn’t completely fit on your screen display. For example, if you have an 80 character wide display, you could define a 30 character field starting in column 60. If this happens, the field does not show up on the Screen Editor display, but it does exist. If you move the cursor to its location, its field number displays on the bottom status line and you can edit it, as described below. APPEARANCE FIELDS There are two kinds of appearance fields: lines and boxes. The next sections describe how to create them. Creating a Line You can create horizontal and vertical lines using this procedure: 1. Move the cursor to where you want either the beginning or end of the line. 2. Mark this location by pressing BLOCK MARK . 3. Move the cursor to where you want the opposite end of the line and press ESCAPE L . 4. A menu appears at the bottom of your display. Type the number corresponding to the line you want. There are different types of lines so you can design a screen where boxes and lines neatly intersect with other lines and boxes. After you choose the type of line, ESP draws the line you selected and displays the field number for the line. SEDIT User’s Guide, Rev. 03 The Screen Editor Page 3-5 A line is like any other field: you can copy, move or delete it. Drawing a Box Drawing a box is like drawing a line, except you work with the box’s opposite corners. Boxes are always rectangular. 1. Move the cursor to where you want one of the box’s corners. It can be any corner. 2. Mark this location by pressing BLOCK MARK . 3. Move the cursor to where you want the opposite corner of the box and press ESCAPE B . A box appears intersecting the coordinates you marked and its field number displays. The position you marked in step 2 remains marked until you change it. If you press ESCAPE B again, a new box is drawn from the marked position to the cursor location, overlaying the previous box. This lets you easily experiment with drawing boxes of different shapes and sizes. OVERLAPPING FIELDS Two or more fields may partially or completely overlap. This is normally done with appearance fields, such as boxes, and text fields, such as screen titles, but you can also have two data fields in the same location, with field expressions that cause one or the other to display based on other values. If you move the cursor to overlapping fields, only one field number displays at the bottom of your screen. This is the "top" field of the two—the one with the higher field number (see the section on field numbers in Chapter 4). If you want to edit the bottom field, you need to move the top field to another location, as described below, change the bottom field, then move the top field back to the position you want. EDITING EXISTING FIELDS Once you create a field, you can modify it, copy it, move it to a new location or delete it. The following sections describe all of these actions. POSITIONING THE CURSOR FOR EDITING OPERATIONS The first step for many editing operations is putting the cursor on the field you want to affect. You know when the cursor is positioned in a field because its field number appears at the bottom of the screen. For text fields, the field number is displayed when the cursor is anywhere in the field. SEDIT User’s Guide, Rev. 03 Page 3-6 Chapter Three With boxes or lines, cursor position is especially important because the field number appears only when the cursor is at specified places on the line or box: To see the field number of a box, position the cursor on the top line of the box. For a vertical line place the cursor at the top of the line. For a horizontal line, the cursor can be anywhere on the line. MARKING A FIELD To copy, delete, or move a field, you need to mark it first. Since ESP identifies a field by one set of cursor coordinates, you only need to mark one point in the field, rather than a beginning and ending location. To mark a field, position the cursor on the field, as described above. Be sure the field number displays at the bottom of your screen. Then, press BLOCK MARK . ESP displays the row and column coordinates of the marked field on the status line. You can now perform the function you want, as described in the following sections. The marked field stays marked (unless you delete the field) until you mark a different field (by using BLOCK MARK or by saving a field from the Field Editor) or leave SEDIT. MODIFYING A FIELD To modify an existing field, move the cursor to the field (making sure its field number appears, as described above), and press EDIT . You do not need to mark the field. This takes you to the Field Editor, where you can modify any of the information for the field. When you’re done, press EXECUTE to save your changes and return to the Screen Editor. COPYING A FIELD You can copy any field to another location. ESP copies all information associated with that field. ESP changes only the copied field’s row/column coordinates, and it gives it a new field number. To copy a field: 1. Move the cursor to the field, being sure you see the field number at the bottom of the display. 2. Mark the field by pressing BLOCK MARK . 3. Move the cursor to where you want the copied field to begin. As when creating a field, this is the beginning of the data area, not the field’s prompt. 4. Press BLOCK COPY . SEDIT User’s Guide, Rev. 03 The Screen Editor Page 3-7 MOVING A FIELD When you move a field, the only thing that changes is its row/column coordinates. All other information, including its field number, stays the same. To move a field: 1. Move the cursor to the field, being sure you see the field number at the bottom of the display. 2. Mark the field by pressing BLOCK MARK . 3. Move the cursor to where you want the field to begin. 4. Press ESCAPE M If you try to move a field to a location where it does not fit on the screen (for example, if you move a 30 character field to start in column 60), the field moves, but does not display on your screen. ESP does not display partial fields; if the entire field does not fit on your screen, none of it appears. The field still exists, and you will see its field number if you move the cursor to its location. Centering a Field You can center a field on the line by moving the cursor to the field and pressing CTRL / C . This is most useful for message fields, where there is no prompt. For data entry or display fields, the data portion of the field is centered; the prompt may make the field appear not to be centered correctly. REARRANGING THE SCREEN In addition to moving a single field, as described in the previous section, you can move single or multiple fields by inserting or deleting rows or columns. When you insert a row, all fields on or below the current row move down one row. When you delete a row, all fields below that row move up one row. Deleting a row deletes all fields in that row! When you insert a space, all fields to the right on that line move right one space. When you delete a space, all fields to the right on that line move left one space. You cannot delete a field by deleting spaces. When the field reaches the cursor position, it simply stops moving to the left; it is not deleted. You can use these keys to insert and delete rows and spaces: SEDIT User’s Guide, Rev. 03 Page 3-8 Chapter Three TO DO THIS Insert a row Delete a row Insert a space Delete a space USE THIS KEY or CTRL / B or CTRL / Z CHAR INS or CTRL / F CHAR DEL or CTRL / D LINE INS LINE DEL DELETING A FIELD To delete a field, move the cursor to the field, as described above. Make absolutely sure the field number displayed at the bottom of your screen is the one you want to delete. (This is especially important with overlapping fields.) Press DELETE . You can also delete all the fields in a row by moving the cursor to the row and pressing LINE DEL or CTRL / Z . SEDIT User’s Guide, Rev. 03 CHAPTER FOUR THE FIELD EDITOR You set characteristics and parameters for the fields you create in the Screen Editor with the Field Editor. This chapter explains how to use the Field Editor and describes each setting available. USING THE FIELD EDITOR You can only get to the Field Editor from the Screen Editor. To call up the Field Editor, press EDIT from anywhere in the Screen Editor. If you are on an existing field when you press EDIT , you see the information for the field. If you are not on a field, pressing EDIT creates a new field and you see a blank Field Editor screen. The Field Editor screen looks like this: -------------------------E S P Field Editor --------------------------+ ! Field Number: 1 ,1 Window Size: 0 Field type: Text ! ! Field max size: 5 Field flags: 256 Field modifiers: 9 ! ! Field min size: Field class: 4 ! +------------------------------------------------------------------------------+ ! Read Security: 127 START display format code: Background Color: ! ! Write Security: 127 END display format code: Foreground Color: ! +------------------------------------------------------------------------------+ !Field Buffer (text for screen titles): ! ! ! !Field Default: ! ! ! !Field Expression: ! ! ! !Pop-Up Menu Selections: ! ! ! !Field Prompt: ! ! ! !On-Line Help: ! ! ! +------------------------------------------------------------------------------+ [ Press MENU key to cancel edit and return to screen display ] [ Press EXECUTE key to set new field information ] Enter new field sequence number (if desired) Row 012 Column 040 27-Apr-92 MOVING THE CURSOR You can use these keys to move among the fields in the Field Editor: SEDIT User’s Guide, Rev. 03 Page 4-2 Chapter Four , ↓ , or RETURN to go to the next field. BACK TAB , SHIFT / TAB , or ↑ to go to the previous field. TAB Within a field, you can use: → and ← to move right and left. / → and SHIFT / ← to go to the end or beginning of an entry. NEXT WORD and PREV WORD to move one word at a time. SHIFT CHANGING ENTRIES To change an existing entry in a field, you can retype it, or use the following editing keys: , or CTRL / D to delete a character. or / F to insert a space. WORD DEL or CTRL / V to delete a word. CTRL / Y to delete to the end of the field. CTRL / Q to enter or leave automatic character insert mode. RUBOUT , CHAR INS CHAR DEL CTRL DISPLAYING HELP INFORMATION As with all ESP screens, you can see help information from the Field Editor by pressing HELP . PULL-DOWN MENUS Three of the fields on the Field Editor have pull-down menus to provide you with an easy way to make your choice. The fields with pull-down menus are Field Flags, Field Classes, and Field Modifiers. When the cursor is in any of these fields, you can press F9 to see the pull-down menu. The currently selected settings are displayed in normal intensity; the rest are in dim intensity. For example, here is the pull-down menu for the Field Flags field. --------------------------- Field Flags ---------------------------+ ! 2) Non-changeable 512) Right Prompt Display ! ! 4) Display Only 1024) Retain Trailing Blanks ! ! 8) Auto-Carriage Return 2048) Changed Value Post-Edit Interrupt ! ! 16) Secured Entry 4096) No Display If Blank ! ! 64) Pre-Edit Interrupt 8192) No Prompt Flash ! ! 128) Post-Edit Interrupt 16384) No Expression Value ! ! 256) Clear On Entry ! +---------------------------------------------------------------------+ To turn a setting on or off, move the cursor to it using ↑ and ↓ , then press SPACE . After making all your changes, press EXECUTE . If you don’t want to keep your changes, press MENU . SEDIT User’s Guide, Rev. 03 The Field Editor Page 4-3 When you use a pull-down menu, ESP keeps track of the value for the field. When you press EXECUTE , ESP adds the values associated with your selection(s) and puts the total in the field. If you become familiar with the values associated with your selection(s), you can enter the total manually, bypassing the pull-down menu. LEAVING THE FIELD EDITOR There are two ways to leave the Field Editor and return to the Screen Editor: Press EXECUTE . This keeps all your changes to this field. Press MENU . This abandons any changes you made, and returns the field to its previous state. If you were creating a field, the field is not created. THE FIELD EDITOR FIELDS The rest of this chapter describes each field on the Field Editor screen. FIELD NUMBER The field number is a unique identification ESP assigns to each field. The first field you create is assigned the number 1, the next is 2, and so on. Field numbers determine the order and direction the cursor moves in when your screen is accessed by your application. Regardless of a field’s position on your screen, the cursor always appears first in field 1, then moves to field 2, etc. (assuming the fields are set to accept input). ESP assigns and keeps track of the field numbers for you. You can also manually assign the field number. Valid numbers are from 1 through 999. The number following the comma in this field is the Field ID. It is displayed for your information only; you cannot change it. SEDIT assigns the Field ID and it is used internally by ESP. If you assign a field number which is already used in this screen, ESP renumbers the other field (giving it the next higher number), and any other fields affected. For instance, if you have fields 1 through 25 and create a new field 12, old fields numbered 12 through 25 become 13 through 26. If you enter a number higher than any existing field number, SEDIT assigns the number one greater than the highest existing field number. For example, if there are field numbers 1 through 10 and you enter 15, SEDIT uses 11 instead of 15. To check the field number sequence of your screen, at the Screen Editor, press HOME , then press TAB . This takes you to field number 1. Each time you press TAB , you go to the next higher field. SEDIT User’s Guide, Rev. 03 Page 4-4 Chapter Four Field Renumbering After you’ve created all the fields for your screen, determine the order you want for the fields and renumber them accordingly. During development of ESP applications, we have found it easiest to use ESP if the fields for user input begin with number 1, followed by display-only fields, headings, and information fields, with boxes and lines having the highest numbers. This does not require you to create the fields in this order. Create the fields in the easiest order for you, then renumber them as the last step in creating the screen. You can check the field order using TAB at the Screen Editor, as described above. For any field that’s not in the order you want, go to the Field Editor and change the field number. FIELD MAX SIZE The Field Max Size setting determines the maximum number of characters allowed in the field. If anyone attempts to enter more characters, the extra characters are not accepted. If you don’t enter a window size (as described below) this value also determines the visible length of the field on the screen. For date fields without slashes, set this field to 6; for dates with slashes, set it to 8. For numeric fields, set the maximum size to the number of characters in the largest number which can be entered or displayed. Include the decimal point, dollar sign, any commas, or a minus sign if they apply. Valid responses to this field are in the range 1 to 155. If you make an entry in the Field Buffer field which is longer than the Field Max Size entry, SEDIT increases the Field Max Size value to match the number of characters in the Field Buffer field. FIELD MIN SIZE The value in Field Min Size determines the minimum number of characters a user must enter to exit from this field. ESP will not allow the cursor out of the field until the user enters this minimum number of characters. This setting is useful for fields which MUST be filled in for the data to be valid. For instance, for a date field, you might set this field to 6. If there is no minimum number of characters, or if the entry in this screen field is optional, set Field Min Size to zero. The valid responses in this field are zero through the Field Max Size value. SEDIT User’s Guide, Rev. 03 The Field Editor Page 4-5 WINDOW SIZE The window size determines how many characters of a field actually display on the screen. This lets you have fields accept more data than would fit in the screen area allotted for them. For example, the AlphaCALC cell value field accepts entries of up to 254 characters, but only 71 can be shown in the field at once. 254 is the field maximum size and 71 is the window size. The window size cannot be larger than the field maximum size. If you want the window size to be equal to the field maximum, enter 0 as the window size. FIELD FLAGS The Field Flags setting determines various characteristics for the field, mostly dealing with how the field accepts and displays user input. Field Flags is a pull-down menu field—how to display the menu and make your choices is described earlier in this chapter. The value for Field Flags is the total of the values of the flags you select. The default value is 256, meaning only the Clear On Entry flag is set. The following list describes all the flags you can set in this field. They are in the same order as they appear on the pull-down menu. Non-Changeable Field—numeric value 2: if you set this flag, the user can move the cursor into this field, but no input is allowed. For example, you may want to set this flag for a selection field, where the user presses a function key to make a selection, because you want the user to be able to move through the field, but not change the information. Display Only Field—numeric value 4: this flag keeps the cursor from moving into this field. Screen titles and column headings are good examples of display only fields. Auto-Carriage-Return—numeric value 8: if this flag is set, and the user enters the maximum number of characters allowed, the cursor automatically goes to the next field (the user doesn’t have to press RETURN ). For example, in the U. S., a telephone number field may actually be three fields: one for area code, one for exchange, and one for the number. Setting Auto-Carriage-Return on the first two fields causes the cursor to move to the next field as soon as each one is filled. Secured Entry—numeric value 16: this is a data security feature. When this flag is set, the characters a user enters in the field are echoed as asterisks. This flag is generally set for password fields. Pre-Edit Interrupt—numeric value 32: this flag causes ESP to return to the calling application program whenever the cursor enters this field, before any data entry. For example, you can set Pre-Edit Interrupt for a field so your program can determine from which direction the cursor entered this field. For more information on handling terminal input, see the ESP Programmer’s Manual. SEDIT User’s Guide, Rev. 03 Page 4-6 Chapter Four Neither the Pre-Edit nor the Post-Edit Interrupt flags have any effect on screens which will be used only with the DART data base manager. Post-Edit Interrupt—numeric value 128: this flag causes ESP to return to the calling program when the cursor leaves this field after data entry. For example, you might set Post-Edit Interrupt on a customer number field in an invoicing screen so the customer number can be validated from another file. Again, refer to the ESP Programmer’s Manual for more information. Also, see the Changed Value Post-Edit Interrupt flag, below. Clear On Entry—numeric value 256: if this flag is set and the user changes the first character in the field, the rest of the field is cleared. Key fields are good candidates for Clear On Entry because this setting can prevent entry errors caused by incorrect editing of field contents. Right Prompt Display—numeric value 512: setting this flag displays the prompt for the field to the right of the field instead of the left. For example, here is Date as a left display prompt and Time as a right display prompt: Date________ _________Time You can use this on any type of field. For example, in a percentage field, you could use the percent sign as a right prompt. Retain Trailing Blanks—numeric value 1024: ESP usually strips any trailing blanks at the end of an entry. Setting this flag tells ESP not to strip trailing blanks. The entire entry, including the blanks, is returned to the calling program. Changed Value Post-Edit Interrupt—numeric value 2048: this is the same as Post-Edit Interrupt, described above, except the return to the calling program occurs only if the user made a change to the field. No Display if Blank—numeric value 4096: when this flag is set, if the field is blank, neither the field nor the prompt displays, except when the cursor is in the field. For example, you could design a nine digit zip code field as two separate fields, one of five digits and one of four. If you set this flag for the four digit field, it will disappear if the user enters only the five digit zip code. No Prompt Flash—numeric value 8192: normally, field prompts display in dim intensity, and change to bright when the cursor is in the field. Setting this flag makes the prompt stay in dim display, even when the cursor is in the field. No Expression Value—numeric value 16384: ESP normally loads the result of a field expression into the field buffer. However, some field expressions are used for control purposes only, and should not be loaded into the buffer. Setting this flag tells ESP not to load the field expression value into the field buffer. The field buffer is discussed later in this chapter. Field expressions are covered in detail in Chapter 5. SEDIT User’s Guide, Rev. 03 The Field Editor Page 4-7 FIELD CLASS Field class values control printing sequences during report generation. They have no effect on screens. These values are used by the TBX$SCRPRT subroutine. See the ESP Programmer’s Manual for more information. Field Class is a pull-down menu field. You can make your selections by choosing them on the pull-down menu, as described earlier in this chapter. Assign the Field Class values shown below which best describe the field’s function in the report. Add the values together to produce a composite class value, representing all the classes you want to apply to this field. CLASS 0 1 2 4 8 16 32 64 128 MEANING Non-printing field Titles Detail headings Detail lines First level of subtotals Second level of subtotals Third level of subtotals Grand totals Field is report only Make sure all fields you want printed have a class designation. To cause any field to be print-only, with no screen display, add value 128 plus whatever other class value applies to this field and enter the total as the Field Class setting. FIELD TYPE The Field Type determines what type of data is valid in this field. Possible field types are: Date Text Numeric Type the first character of the type you want. The field types are used with the Field Modifiers described in the next section. FIELD MODIFIERS The Field Modifiers further define the type of data allowed in the field. There is a separate set of modifiers for each field type. Field Modifiers is a pull-down menu field. You can make your selections on the pull-down menu, or add the values of the selections you want and enter the total in the field. SEDIT User’s Guide, Rev. 03 Page 4-8 Chapter Four The field modifiers for a date field are: DESCRIPTION VALUE MEANING Embedded Slashes 1 Displays the date with the / character separating month, day and year after the user makes an entry and exits from the field. Dates may be entered with or without slashes. European Format 2 Requires the user to enter dates in the European format of DD/MM/YY. Also displays in this format. Can be used with or without embedded slashes. Sort Format Return 4 Returns date to the calling program in sort format: YY/MM/DD. Dates must be in sort format when sent back from the calling program. Can be used with or without embedded slashes. Sort Format Entry 128 Requires date to be entered in sort format: YY/MM/DD. Can be used with or without embedded slashes. SEDIT User’s Guide, Rev. 03 The Field Editor Page 4-9 The text field modifiers are: DESCRIPTION VALUE MEANING Alpha Characters 1 Allows upper letters. Numeric Characters 2 Allows numbers. Punctuation 4 Allows the punctuation characters listed below. Force Uppercase 8 Converts all entered letters to upper case. Spaces Allowed 16 Allows blank characters. Auto Capitalization 32 Capitalizes the first letter of all words, even if they are entered as lower case. Yes/No Only 128 Limits the valid responses to Yes or No. The characters for yes and no are taken from the user’s current language definition file. and lower spaces as case valid ESP uses the AMOS ALF monitor call to determine if a character is a letter and the NUM monitor call to determine if a character is a number. The valid punctuation characters are: . Period - Dash + Plus ; Semi Colon $ Dollar sign ’ Apostrophe @ At ^ Caret * Asterisk _ Underline ~ Tilde [ ] Brackets | Stile , = : ! % " # & () ‘ \ {} ? Comma Equal Colon Exclamation Percent Quote Pound Ampersand Parentheses Grave Accent Back slash Braces Question mark If you do not enter any field modifiers for a text field, the field accepts any printable character. SEDIT User’s Guide, Rev. 03 Page 4-10 Chapter Four The field modifiers for numeric fields are: DESCRIPTION VALUE MEANING Leading Dollar Sign 1 Displays the current currency symbol to the left of the field. Display Commas 2 Displays a comma every three digits to the left of the decimal point. Convert Zero to Blank 4 Converts any zero entry to blanks. Especially useful for columnar displays, where you may not want columns full of zeros. Auto Decimal Point 16 Inserts a decimal point in the field if the user leaves the field without entering one. The Special Field Modifier sets how many places are to the right of the decimal point. Negative Numbers 32 Allows negative numbers. A minus sign (-) indicates the entry is negative. Left Justify 64 Overrides normal right justification of the entered number and displays it left justified. Leading Zeros 128 ESP normally blanks out leading zeros. Setting this flag displays leading zeros. Line and box field types do not take any field modifiers. SPECIAL FIELD MODIFIERS The Special Field Modifier is used only for numeric type fields. It lets you set the number of decimal places displayed. When you set a number of decimal places, a decimal point is automatically inserted at the proper point in a user entry, even if the user enters no decimal point. The default setting is blank. SEDIT User’s Guide, Rev. 03 The Field Editor Page 4-11 VALUE MEANING 0 Allows only integers. 1 - 254 Sets the number of decimal places when the Auto Decimal Point field modifier is set. 255 Numbers in this field have a floating decimal point; no automatic decimal point positioning occurs. READ & WRITE SECURITY The settings in the Read Security and Write Security fields determine whether the user is allowed to see or make any entry to this field. The read security level determines whether or not the user sees this field—including its prompt—on the screen. If the user’s read security as set by SIGNIN is less than the read security set for this field, it is as if this field does not exist. The write security level determines if the user can change or make any entry to this field. If the user’s write security is not high enough, they are not permitted to move the cursor into this field, although they will see the prompt and any existing field contents. Users whose read security does not allow them to view this field cannot make an entry, even if their write security setting is high enough. All users whose security level is at or above the level defined by the read and write security settings can both view and modify this field. The default value for each field is 127; the allowed values are 0 to 255. If you do not use SIGNIN, leave these values at 127; this allows all users read and write access. If you set the security level higher than 127, no one will be able to access the field. START & END DISPLAY FORMAT The Start & End Display Format codes determine the special display attributes, if any, used for your field. The common display features available are shown in the table below. You normally start and end the field using the pairs of values shown in the Start and End Columns. The codes for these fields correspond to the standard AMOS -1,* TCRT codes. SEDIT User’s Guide, Rev. 03 Page 4-12 Chapter Four DISPLAY FEATURE START CODE END CODE Blink Underscore Reverse Video Reverse Video Blink 21 30 32 34 22 31 33 35 The default value for this field is 0, for no display features. BACKGROUND AND FOREGROUND COLOR Selections for background and foreground colors let you set the color used in your screen on a field-by-field basis. There is no default setting for either the foreground or background color. Both the Background Color and Foreground Color fields accept these values: COLOR BRIGHT VALUE DIM VALUE Black White Blue Magenta Red Yellow Green Cyan 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 These numbers correspond to the standard AMOS -2,* TCRT codes. Many terminals let you select display colors from a palette of available colors. If the terminal colors have been changed from the default, these values may select colors other than those shown in this table. A word of caution regarding screen design: although changing colors from field to field may seem like an inviting idea, don’t do it. Just because you have eight colors to work with does not mean any one screen should use all of them. Remember, the screen you design is your application’s "face" and as such is what people using your product see the most often. Be judicious with your palette of colors; use them sparingly to accent or highlight. For foreground or background color selection encompassing your entire screen, use the AMOS PRINT TAB functions. See the AlphaBASIC User’s Manual for more information. SEDIT User’s Guide, Rev. 03 The Field Editor Page 4-13 FIELD BUFFER The Field Buffer sets any information you want pre-loaded into this field. Valid entries are letters, numbers, and punctuation marks. The default entry for Field Buffer is blank. The Field Buffer entry overrides any entry in Field Default; if you have entries in both Field Buffer and Field Default, the Field Buffer entry is displayed. You should enter the text for screen titles and messages in this field. FIELD DEFAULT Your entry in Field Default determines the value assumed for this field if the user exits it without making an entry. Valid entries are letters, numbers, and punctuation marks. The default entry for Field Default is blank. The Field Buffer entry overrides any entry in Field Default; if you have entries in both Field Buffer and Field Default, the Field Buffer entry is displayed. FIELD EXPRESSION The Field Expression field lets you mathematically calculate field default values and manipulate field parameters and attributes from within the screen. Field expressions are discussed fully in Chapter 5. A Field Expression value overrides a Field Default entry unless you set the No Expression Value flag discussed in the Field Flags section of this chapter. An entry in Field Buffer overrides a Field Expression value. POP-UP MENU SELECTIONS Pop-up Menu Selections are short lists of items used to validate user entered data. If you make an entry in this field, the user is not permitted to enter any data not found in the pop-up list. Pop-up lists are created according to certain rules. Items in the list are separated by commas; spaces are significant. We recommend each list item start with a unique character. If a comma is a valid entry in the list, enter it by using a double comma. When using the screen, users can make selections by typing the first character of their choice or by pressing NEXT WORD or PREV WORD to cycle through the choices. SEDIT User’s Guide, Rev. 03 Page 4-14 Chapter Four FIELD PROMPT The Field Prompt is a short description or explanatory phrase to identify this field to the user. For example, on the Field Editor screen, the words Field Number: are a field prompt. The field prompt you enter displays to the left of the field, unless you set the Right Prompt field flag, as described in the Field Flag section of this chapter. The default for this field is blank. ON-LINE HELP For every field you create, you can include an on-line help message. The message appears at the bottom of the screen when the cursor enters this field and is erased when the cursor leaves the field. You can also define a help file to be displayed if a user presses HELP when in this field. The default for this field is blank. If you make an entry in this field, it is in the format: On line help information|filename All text up to the | character displays at the bottom of the screen when the cursor enters this field. Any text after a | is treated as a file specification for the file to be displayed if the user presses HELP in this field. For example: Press HELP for more information | DSK0:SHOW[7,1] You can enter a full file specification for the help file, as shown. The help file extension defaults to the extension defined in the user’s currently selected language definition file. You do not have to enter a help file name in this field. If you don’t, when the user presses HELP they see a message telling them no further help is available. SEDIT User’s Guide, Rev. 03 CHAPTER FIVE FIELD EXPRESSIONS In the Field Expression field of the Field Editor, you can enter a mathematical formula to calculate the value to use as the default for this screen field. This lets you calculate the default entry for the field based on entries in other fields and/or values stored in ESP’s accumulators. You can also set various characteristics of this field—such as color and read/write security—based on these values. As this chapter explains, field expressions are quite flexible and powerful. When you use a Field Expression to set the default for a field, the Field Expression value overrides any entry in Field Default, but any Field Buffer entry overrides the Field Expression value. You can use Field Expression to set field characteristics even when there is a Field Buffer entry. USES OF FIELD EXPRESSIONS You may find field expressions useful in any of these situations: When the default for a field depends on the value of another field. For example, you could set the default minimum payment based on a percentage of an account balance. When whether to display a field at all depends on the value of another field. For example, on AlphaCALC’s Worksheet Header screen, a field expression in the password field displays the field only if you choose password protection. When using ESP to create a report, you can sum subtotals or totals in a field using ESP’s accumulators (accumulators are described later in this chapter). You can change display characteristics based on a field’s value. For example, if a number is negative, you could display it in red or in reverse video. The following sections describe the various values, operators and functions you can use in a field expression. The end of this chapter explains some sample field expressions. GENERAL FORMAT A field expression can contain any combination of the following: SEDIT User’s Guide, Rev. 03 Page 5-2 Chapter Five Numbers. References to the values of fields on this screen. Glossary items. Arithmetic, relational, and logical operators. Mathematical functions. ESP field functions, which refer to or change characteristics of fields on this screen. References to ESP accumulators. NUMBERS You can refer to decimal numbers in a field expression just by entering the number. FIELD VALUES You can include the value of any field on this screen in a field expression by referring to the field number. The format is F#. # is the number of the field to refer to. For example, F4 uses the current value of field 4. When you refer to a field, ESP checks to make sure it exists. Therefore, you may need to create all fields for a screen, then go back to put in the field expressions referring to these fields. When ESP renumbers fields, as described in Chapter 4, it updates all field expressions to refer to the proper field numbers. GLOSSARY ITEMS Glossary items retrieve information from either AMOS or the user’s SIGNIN record, and let you use this information in a field expression. The glossary items available are: SEDIT User’s Guide, Rev. 03 Field Expressions Page 5-3 ITEM DESCRIPTION $TD $TW $UB $UL $UE $UM $UX PAGE CMP’NBR* DEF’BCOLOR* DEF’FCOLOR* READ’SEC* WRITE’SEC* TIMEOUT* TIME TRUE FALSE Today’s date, in YYMMDD format. The day of the week. 0 = Monday, etc. The user’s privilege code. The user’s level. The user’s expertise. The current memory partition size. The current radix (8 or 16). Page number for reports (DART only). Company number. Default background color. Default foreground color. The user’s read security level. The user’s write security level. The currently set timeout period. The current time in HHMM format. -1 0 * The information for these items comes from the current user’s SIGNIN record. If you don’t use SIGNIN, all of these items have a value of 0. OPERATORS Field expressions support a full range of arithmetic, logical and relational operators. You use any of these operators by placing it between the two values you want it to work on. The arithmetic operators are: OPERATOR DESCRIPTION + * / ** or | MAX MIN Addition Subtraction Multiplication Division Exponentiation Take maximum value Take minimum value The logical operators compare two numeric values and give a result of either -1 (true) or 0 (false). They are: SEDIT User’s Guide, Rev. 03 Page 5-4 Chapter Five OPERATOR DESCRIPTION = # > < >= <= Equal to Not equal to Greater than Less than Greater than or equal to Less than or equal to The relational operators compare two logical values, and give a result of either -1 (true) or 0 (false). They are: OPERATOR DESCRIPTION AND OR XOR Are both expressions true? Is either expression true? Is only one expression true? Precedence In general, ESP follows algebraic rules of precedence when evaluating a field expression. Multiplication and division are performed before addition and subtraction, and so on. Operations of equal precedence are performed from left to right. You can use parentheses to control the order in which operations are performed. This works for the operators listed in the previous sections and the functions described below. The operator or function enclosed in the most sets of parentheses is performed first. MATHEMATICAL FUNCTIONS You can use the following mathematical functions in a field expression: SEDIT User’s Guide, Rev. 03 Field Expressions Page 5-5 FUNCTION DESCRIPTION ABS FIX IF INC INT LOG NOT SET SQR Absolute value Truncate to integer Logical comparison (see the next section) Increment accumulator by one Take the integer value Natural logarithm Reverses logical value Set accumulator or value Square root The general format for all these functions is: Function(expression) All of these functions except IF, SET and INC are the same as in AlphaBASIC. IF is described in the next section and SET in the one following. INC is described further in the Accumulators section later in this chapter. The IF Function The IF function selects one of two values based on the results of a logical comparison. Since the values it selects can be complex expressions, IF is a very powerful function, allowing you to choose among many different values for this field expression, based on the values of many other fields or expressions. The format for IF is: IF(logical expression,expression 1,expression 2) If logical expression is true, the value of the IF function is the value of expression 1. If logical expression is false, the value of IF is the value of expression 2. Both expression 1 and expression 2 can be any legal field expression, including another IF function (you can nest IF functions). The SET Function The SET function has two purposes: To place a value into one of ESP’s accumulators. The accumulators are discussed later in this chapter. To set a field characteristic to a particular value. You do this by using SET with one of the field functions described in the next section. SEDIT User’s Guide, Rev. 03 Page 5-6 Chapter Five The format for SET is: SET(Destination:=Value) Destination is either an accumulator number or a field function. Value is the value you want to set the destination to. It can be a constant value or any allowable expression. For example, this SET function sets accumulator 23 to the value of field 5 multiplied by 100: SET(@23:=F5*100) There are more examples of SET in the "Field Functions" and "Accumulators" sections. FIELD FUNCTIONS The field functions let you retrieve or set the characteristics of a field on this screen. There are two types of field functions: Functions which can both retrieve and set a field characteristic. These functions all start with the characters FLD’ (except for POPUP’ITEM). They retrieve the indicated value unless you use them in the SET function. Functions which can only set or retrieve a value, not both. You do not need to use SET with this type of function. When using a field function to set a field characteristic, you normally do not want to display the value of the field expression in the cell. For example, if you are setting the color to white, you don’t want the field’s value to be set to one. To set a field characteristic without changing the value displayed in the field, set the No Expression Value flag, as described in Chapter 4. Field functions of the first type are: SEDIT User’s Guide, Rev. 03 Field Expressions Page 5-7 FUNCTION DESCRIPTION FLD’ASC FLD’BCLR FLD’COL FLD’CSIZ ASCII value of first character Background color Column number Number of characters entered (the current size of the field buffer. See LEN, below.) Ending display format code Foreground color Row number Read security Starting display format code Write security Item number of the selected item of a pop-up list. FLD’EDFC FLD’FCLR FLD’ROW FLD’RSEC FLD’SDFC FLD’WSEC POPUP’ITEM The format for all of these functions is: Function(F#) F# is the number of the field you want to retrieve the value from or set the value for. When used in the SET function, these field functions let you set the indicated characteristic of a field—normally, though not always, the current field. Combining SET and IF lets you set the characteristics based on other values or conditions. For example, this IF function sets the color of field 2 to red if the value in field 2 is less than 0, and to white otherwise: IF(F2<0,SET(FLD’FCLR(F2):=4),SET(FLD’FCLR(F2):=1)) You can set two or more field characteristics in one field expression by using two SET functions connected with a plus sign. There is an example of this at the end of the chapter. Except when used within a SET function, the field functions retrieve the indicated characteristic from this field or another. If you use the field function as part of IF’s logical expression, you can then set another value based on the retrieved characteristic. For example: IF(FLD’BCLR(F4)=1,SET(@4:=1),SET(@4:=0)) This sets accumulator 4 to 1 if field 4’s background color is white, and sets it to 0 if the background color is anything else. Field functions of the second type are: SEDIT User’s Guide, Rev. 03 Page 5-8 Chapter Five FUNCTION DESCRIPTION ALLOW Allows editing of a previously skipped field. It is the reverse of SKIP. CALL Evaluates the expression in a field and returns the value of the field. This differs from just referring to the field number in two ways: it works only if the field has a field expression, and rather than just reading the current field value, it forces the field expression to be re-evaluated. You can use CALL to evaluate an expression in a display-only field, which might not otherwise be updated. HIDDEN Checks to see if a field is hidden; it returns true if the field is hidden, false if it isn’t. HIDE Hides a field, so it is not displayed on the screen. You can reverse this by using the SHOW function. JULN Converts a date field value to a Julian date. A Julian date is the number of days since January 1, 4713BC. Converting dates to Julian format allows you to perform arithmetic on date values. LEN Returns the data length of the specified field. This differs from FLD’CSIZ in that, if the field buffer is empty, LEN returns the size of the field default, while FLD’CSIZ does not. SHOW Reverses the effect of HIDE, so the field is displayed on the screen. SKIP Causes the field to be skipped. The cursor will not go to the field, so it can’t be edited. The field is still displayed. You can reverse SKIP by using ALLOW. SKIPPED Checks to see if a field is skipped; it returns true if the field is skipped, false if it isn’t. All of these functions accept only a field number as an argument. For example: SKIP(F5). All of these functions which set a field characteristic return a numeric value of zero. SEDIT User’s Guide, Rev. 03 Field Expressions Page 5-9 ACCUMULATORS Accumulators are memory locations ESP uses to store numbers. There are 512 accumulators available to you, numbered from 0 through 511. Accumulators are local to each user; the values for each user’s accumulators are stored in the impure area set up for the user in TOOLBX.SYS when the computer boots. There are three types of accumulators: Numbers 0 through 250 are for temporary storage of values. These accumulators are normally cleared by the INITRM XCALL or TRMINI subroutine, so any value in them is lost whenever you leave an ESP application. See the ESP Programmer’s Guide for more information on TRMINI and INITRM. Numbers 251 through 499 are longer lasting storage locations; the values in these accumulators are not cleared by ESP. This lets you save a value for later use or pass values from one application to another. Numbers 500 through 511 are used by the DART data base manager to store information about the current data base or report. You should not use these accumulators in your application, except as they are defined in DART. See the DART documentation for more information. All accumulators are cleared when your system is booted! You cannot use an accumulator for permanent storage of any value. You refer to an accumulator using the @ symbol followed by the accumulator number—for example, @7. To set an accumulator to a value, use the SET function described above. For example, this field expression adds 2 to the current value of accumulator 205 and displays the new value in the field: SET(@205:=@205+2) If you want to increment an accumulator by one, you can use the INC function: INC(@205) You could use an expression such as this one to increment a line counter on a report. In field expressions, you can use accumulators for storing totals and other calculated values for reports, keeping track of the next available value for a field, and many other things. SEDIT User’s Guide, Rev. 03 Page 5-10 Chapter Five SAMPLE FIELD EXPRESSIONS The following field expression sets the value of this field to the value of field 3 divided by 100. This can be useful to, for example, let someone enter a percentage as a whole number, then use it as a decimal elsewhere: F3/100 The next example sets the foreground color for this field based on the field’s value. The field is red if the value is negative, white if it is less than 100, or blue if it is greater than 100. You could use this so account balances of different amounts display in different colors, letting you see the largest balances at a glance: IF(F5<0,SET(FLD’FCLR(F5):=4),IF(F5>100,SET(FLD’FCLR(F5):=2), SET(FLD’FCLR(F5):=1))) When you use a field expression like this to set a field characteristic, be sure to set the No Expression Value field flag. If you don’t, the value of the expression displays in the field (in this case, either 1, 2, or 4, whichever color number was set.) The field expression below puts a running report subtotal into accumulator @303 by adding the value of field three for the current line to the previous value of @303. When this field prints, it prints the current value of the accumulator: SET(@303:=@303+F3) Since this is a subtotal, you would also want to set the field class for this field to 8, 16, or 32, depending on the level of subtotal. The following example shows how you can set two field characteristics in a single field expression. It sets field 12 to display in the same row as field 5, starting one column after the end of field 5. SET(FLD’ROW(F12):=FLD’ROW(F5))+SET(FLD’COL(F12):= (FLD’COL(F5)+FLD’CSIZ(F5)+1)) SEDIT User’s Guide, Rev. 03 CHAPTER SIX PRINTING ESP SCREENS SEDIT offers three ways to print the screens you create: the LIST command, and the SEDIT command’s L option. PRINT key, the Main Menu THE PRINT KEY The PRINT key prints the current screen image. You can print any SEDIT screen display: Main Menu, Screen Editor or Field Editor. Just press PRINT when the information you want to print is displayed. When you use PRINT from the Screen Editor, the printout shows the row and column screen coordinates along with the text of all displayable fields on the screen. You do not see individual field information entered via the Field Editor. The screen image part of the figure in the next section is an example of what you get using PRINT from the Screen Editor. THE LIST COMMAND The SEDIT Main Menu LIST command prints complete information about the screen you’re currently editing. It includes an image of the screen and all the information entered in the Field Editor for each field. Here is a sample of the LIST output for a fairly simple ESP screen: SEDIT User’s Guide, Rev. 03 Page 6-2 Chapter Six ESP Screen List of SAMPLE.000 on April 28, 1992 1:24 PM Screen uses 820 bytes 1 2 3 4 5 6 7 123456789012345678901234567890123456789012345678901234567890123456789012345 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20| ESP SAMPLE SCREEN +---------- Data Entry ------------+ | | | _____ ID Number | | | | Entry Date: _______ | | Entry Code: _ | | Amount: _________ | | Description: ____________ | | | +----------------------------------+ [ Press MENU key to return to AMOS ] [ Press EXECUTE key to add record to file ] Loc 8, 29 10, 37 11, 37 12, 37 13, 37 6, 19 3, 28 18, 19 20, 16 6, 30 Fld # 1 2 3 4 5 6 7 8 9 10 Max Min Fld Fld T Fld Spc Rd/Wrt St/End Bck/For Siz Siz Flags Cls P Mod Mod Security Code Color Prompt 6 1 512 0 N 128 0 0 0 0 0 0 0 ID Number 8 0 0 0 D 5 0 0 0 0 0 0 0 Entry Date: 1 0 128 0 T 2 0 0 0 0 0 0 0 Entry Code: 10 0 0 0 N 17 2 0 0 0 0 0 0 Amount: 13 0 256 0 T 23 0 0 0 0 0 0 0 Description: 37 10 4 0 B 0 0 0 0 0 0 0 0 17 0 4 0 T 9 0 0 0 30 31 0 0 40 0 4 0 T 9 0 0 0 32 33 0 0 45 0 4 0 T 9 0 0 0 32 33 0 0 12 0 4 4 T 9 0 127 127 32 33 0 0 Fld # Expression 3 IF(F3>3,SET(@1:=1),SET(@1:=@1+1)) 4 F3*100 Fld # 1 2 3 4 5 On-line help message Enter the Identification Number Enter the date of this entry Enter 1, 2, 3, or 4. Enter the amount of this entry. Enter a description of the entry. The tables below the screen image give the detailed information about each field that you entered into the Field Editor. Each field is identified by cursor coordinates and field number. The columns give the following information (see Chapter 4 for explanations of these fields): SEDIT User’s Guide, Rev. 03 General Information Page 6-3 COLUMN DESCRIPTION Max Siz Min Siz Fld Flags Fld Cls TP Fld Mod Spc Mod Rd/Wrt Security St/End Code Bck/For Color Prompt Maximum number of characters allowed Minimum number of characters allowed Field Flags Field Class Field Type Field Modifiers Special Modifiers Read and write security level settings Start and end display format codes Background and foreground colors Field Prompt The print-out also lists all field expressions and on-line help messages for the screen. PRINT DESTINATIONS SEDIT does not allow you to select a printer when you print using either The printer used depends on one of two things: PRINT or LIST. If you use SIGNIN, and have a default printer defined in your SIGNIN user record, that printer is used. If you didn’t use SIGNIN, or don’t have a default printer in your SIGNIN user record, the system default printer is the destination. THE SEDIT /L OPTION Once you create an ESP screen, you don’t have to travel through the menu system to print it. A command option available with SEDIT lets you make a printable disk file. To use this SEDIT feature, make sure you’re in the account where the screen file is stored and, from AMOS command level, type: SEDIT filename /L RETURN filename is your screen file’s name and extension. If you don’t include an extension, SEDIT assumes the extension .SCR. The /L option creates a printable disk file containing the same information in the same format as the ESP Main Menu LIST command. This format is described above. You can also use a wildcarding feature with the SEDIT /L option to print all screens in an account, by typing this command: SEDIT User’s Guide, Rev. 03 Page 6-4 Chapter Six WILD SEDIT *.SCR /L RETURN If you give your screen files an extension other than .SCR, use that extension in the command. The disk file created by the /L option has the same name as your screen file and the first available extension in the series .000, .001, and so on. If you use the WILD command, a separate file is created for each screen. SEDIT User’s Guide, Rev. 03 DOCUMENT HISTORY REVISION DATE DESCRIPTION 03 9/1/95 Incorporate all outstanding changes for AlphaCD release. 02 Internal paperwork change only. No actual change to document. 01 6/25/92 Add field expression functions which were omitted Revision 00. 00 6/4/92 ESP 2.1 inclusion in AMOS 2.2A. Replaces Introduction to ESP. General update, reformat, add new information. SEDIT User’s Guide, Rev. 03 INDEX A Absolute value in field expression 5-5 Accumulator in field expression 5-9 INC function 5-5 setting in field expression 5-5 ALLOW function in field expression 5-8 Appearance field 3-3 creating 3-4 Arithmetic operators in field expression 5-3 Automatic carriage return flag 4-5 B Background color setting for field 4-12 Blank field hiding 4-6 Blinking field, setting 4-11 BLOCK MARK key 3-6 Box 3-3 creating 3-5 editing 3-6 C CALL function in field expression 5-8 Centering a field on the line 3-7 Changed value post-edit interrupt flag 4-6 Changing entries in Field Editor 4-2 Class setting for report field 4-7 Clear on entry flag 4-6 Color setting for field 4-12 Commands ESP Main Menu 2-3 slash 3-3 Conventions used in this book 1-2 Copying an existing field 3-6 Creating appearance field 3-4 box 3-5 line 3-4 screen field 3-3, 3-4 screen file with SEDIT 2-2 screen, overview 2-1 text field 3-4 SEDIT User’s Guide, Rev. 03 D Data field 3-3 Data type setting for field 4-7 Date field modifiers 4-8 selecting 4-7 setting maximum size 4-4 Date formats 4-8 Date value converting to Julian date 5-8 Decimal point setting for numeric field 4-10 Default entry and field buffer 4-13 setting for field 4-13 Deleting existing field 3-8 rows 3-7 spaces 3-7 Designing screens 3-1 Display format setting for field 4-11 Display only field flag 4-5 Drawing box 3-5 line 3-4 E EDIT command 2-3 EDIT key Screen Editor 3-2, 4-1 Editing screen fields 3-5 Erasing an existing field 3-8 ESP Main Menu commands 2-3 description 2-2 returning to 3-2 EXECUTE key 2-5 from Field Editor 4-3 F Field allowing editing 5-8 assigning number 4-3 buffer 4-13 checking if hidden 5-8 checking if skipped 5-8 checking length 5-8 clearing marked 3-6 Page ii copying 3-6 creating 3-3, 3-4 data type 4-7 default entry 4-13 deleting 3-8 display format 4-11 editing 3-5 entering help message 4-14 expression 4-13 flags 4-5 hiding 5-8 marking 3-6 maximum size 4-4 minimum size 4-4 modifiers 4-7 modifying 3-6 moving 3-7 overlapping 3-5 pop-up menu selections 4-13 prompt 4-14 read and write security 4-11 rearranging 3-7 renumbering 4-4 setting class 4-7 setting color 4-12 showing 5-8 skipping 5-8 special modifiers for numeric 4-10 types 3-3 window size 4-5 Field buffer and field maximum size 4-4 setting for field 4-13 Field characteristics in field expression 5-6 setting with field expression 5-5 Field default relation to field buffer and field expression 4-13 Field Editor abandoning changes 4-3 accessing 2-4, 3-2, 4-1 changing entries 4-2 description 4-1 leaving2-4, 4-3 moving the cursor 4-1 pull-down menus 4-2 Field expression accumulators 5-9 and field characteristics 5-6 evaluating from other field 5-8 examples 5-10 field functions 5-6 format 5-1 glossary items 5-2 IF function 5-5 mathematical functions 5-4 not placing in field buffer 4-6 operator precedence 5-4 operators 5-3 referring to other fields 5-2 relation to field default and field buffer 4-13 SET function 5-5 setting accumulators 5-5 setting field characteristics 5-5 uses 5-1 Field flags setting for field 4-5 Field functions in field expression 5-6 Index Field number and copied field 3-6 and overlapping fields 3-5 display 3-4 selecting 4-3 specifying in field expression 5-2 Field value using in field expression 5-2 File creating with SEDIT 2-2 FINISH command 2-3 Foreground color setting for field 4-12 Function keys in Screen Editor 3-2, 3-3 universal key sequences 3-3 G Glossary items in field expression 5-2 Graphic conventions 1-2 H Help setting for field 4-14 Help file defining for field 4-14 Help information Field Editor 4-2 for SEDIT 2-4 HELP key 2-4 in Screen Editor 3-2 HIDDEN function in field expression 5-8 HIDE function in field expression 5-8 I IF function in field expression 5-5 INC function in field expression 5-5 Inserting rows 3-7 spaces 3-7 Integer in field expression 5-5 J Julian date 5-8 JULN function in field expression 5-8 L Leaving Field Editor 4-3 Screen Editor 3-2 SEDIT 2-3 LEN function in field expression 5-8 Line 3-3 creating 3-4 editing 3-6 types 3-4 LIST command 2-3, 6-1 output description 6-2 SEDIT User’s Guide, Rev. 03 Index Logarithm in field expression 5-5 Logical NOT in field expression 5-5 Logical operators in field expression 5-3 M Main Menu see ESP Main Menu 3-2 Marking a field 3-6 Mathematical functions in field express 5-4 Maximum size effect of Field Buffer entry 4-4 setting for field 4-4 MENU key 2-5 in Field Editor 4-3 in Screen Editor 3-2 Message field 3-3 entering text in field buffer 4-13 Minimum size setting for field 4-4 Modifiers setting for field 4-7 Modifying an existing field 3-6 Moving an existing field 3-7 Moving the cursor Field Editor 4-1 in Screen Editor 3-1 to edit a field 3-5 N No display if blank flag 4-6 No expression value flag 4-6 No prompt flash flag 4-6 Non-changeable field flag 4-5 NOT function in field expression 5-5 Numeric field modifiers 4-10 selecting 4-7 setting format 4-10 special modifiers 4-10 O Operators in field expressions 5-3 precedence in field expression 5-4 Overlapping fields 3-5 P Pop-up menu selections setting for field 4-13 Post-edit interrupt flag 4-6 changed value only 4-6 Pre-edit interrupt flag 4-5 PRINT key 6-1 Printing multiple screen files 6-3 output destination 6-3 screen file 2-3, 6-1 Prompt displaying on right 4-6 setting for field 4-14 SEDIT User’s Guide, Rev. 03 Page iii Pull-down menus in Field Editor 4-2 making selections 4-2 Punctuation characters for text field 4-9 Q QUIT command 2-3 R Read security setting for field 4-11 Rearranging screen fields 3-7 Relational operators in field expression 5-4 Renumbering screen fields 4-4 Report field setting class 4-7 specifying totals and subtotals 4-7 Retain trailing blanks flag 4-6 Reverse video field 4-11 Right prompt display flag 4-6 Row inserting and deleting 3-7 S SAVE command 2-3 Saving a screen file 2-3 Screen design hints 3-1 overview of creation process 2-1 Screen Editor calling up 2-4 description 2-4 EDIT key 3-2 function keys3-2, 3-3 HELP key 3-2 leaving 3-2 MENU key 3-2 moving the cursor 3-1 slash commands 3-3 using 3-1 Screen field see Field 3-3 Screen file editing 2-3 printing 2-3, 6-1 to 6-3 saving 2-3 size 2-2 testing 2-3 Secured entry flag 4-5 Security read and write 4-11 SEDIT command choosing a file name 2-2 format 2-1 L option 6-3 overview 1-1 SET function in field expression 5-5 SHOW function in field expression 5-8 SIGNIN default printer 6-3 security settings 4-11 Page iv Index Size of screen file 2-2 SKIP function in field expression 5-8 SKIPPED function in field expression 5-8 Slash commands 3-3 Space inserting and deleting 3-7 Special modifiers for numeric fields 4-10 Square root in field expression 5-5 Status line contents on Screen Editor 2-4 Subtotals specifying for report 4-7 T TEST command 2-3 Testing a screen 2-3 Text field 3-3 characters allowed 4-9 creating 3-4 editing 3-5 modifiers 4-9 punctuation characters 4-9 selecting 4-7 Titles entering text in field buffer 4-13 Totals specifying for report 4-7 Types of screen fields 3-3 U Underlining a field 4-11 Universal key sequences for Screen Editor function keys 3-3 W WILD command 6-3 Window size setting for field 4-5 Write security setting for field 4-11 SEDIT User’s Guide, Rev. 03