home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / s / surefir2.zip / SFDOC.TXT < prev    next >
Text File  |  1991-11-11  |  471KB  |  11,825 lines

  1.  
  2.  
  3.             Surefire User's Guide         Page 1
  4.  
  5.  
  6. Surefire User's Guide         -    Table of Contents
  7.  
  8.  
  9. Chapter 1:  Introduction                               10
  10.      What is a Smart Document                          11
  11.      Chapter Preview                                   12
  12.  
  13. Chapter 2:  Getting Started                            13
  14.      Running Surefire                                  13
  15.           Running Surefire with a Document             14
  16.      Leaving Surefire                                  14
  17.      System Information                                14
  18.      System Setup                                      14
  19.           Current Drive and Directory                  14
  20.           Current Printer and Printer Port             15
  21.           Using Your Display                           15
  22.           Document Related Parameters                  16
  23.           Tab Size                                     16
  24.           Word Wrap                                    16
  25.           Auto Calc                                    16
  26.           Hints                                        16
  27.           Auto Backup                                  16
  28.      The Surefire Demo/Tutorial                        17
  29.  
  30. Chapter 3:  Getting Around                             18
  31.      The Document                                      18
  32.      The Page Display                                  18
  33.      Menus                                             18
  34.           The Menu Bar                                 18
  35.           Choosing a Menu Item                         19
  36.           Accelerated Menu Selection                   19
  37.           Inactive Menu Items                          20
  38.      Shortcuts                                         20
  39.      Windows                                           20
  40.      Window Fields                                     20
  41.           Data Entry Fields                            20
  42.           Action Buttons                               21
  43.           Multiple Choice Buttons                      21
  44.           Logical Choice Buttons                       21
  45.           Moving Between Fields                        21
  46.           Changing Logical and Multiple Choice Buttons 21
  47.           Choosing Action Buttons                      21
  48.      Getting Help                                      22
  49.           The Status Line                              22
  50.           Hints                                        22
  51.           Context Help                                 23
  52.           Document Help                                23
  53.  
  54. Chapter 4:  Typing Text                                24
  55.      Word Processors -vs- Typewriters                  24
  56.      Creating a New Document                           25
  57.      Saving Your Document                              25
  58.      Cursor Movement                                   25
  59.      Entering Text                                     26
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.             Surefire User's Guide         Page 2
  69.  
  70.  
  71.      "Wrapped" and "Unwrapped" Paragraphs              27        
  72.      Typeover and Insert modes                         27
  73.           Using Typeover Mode                          27
  74.           Using Insert Mode                            27
  75.      Deleting Characters                               28
  76.      Exiting Surefire                                  28
  77.  
  78. Chapter 5:  Revising a Document                        29
  79.      Opening a Document                                29
  80.      Printing a Document                               30
  81.           Preparation                                  30
  82.           Printing                                     31
  83.      Scrolling                                         31
  84.           Scrolling by Lines, Screens and Pages        32
  85.      Two Faces of Editing                              33
  86.      "Scroll and Change" Editing                       33
  87.           Moving the Cursor on the Screen              33
  88.      Changing Text                                     34
  89.           Removing Text                                34
  90.           Adding Text                                  35
  91.           Adding and Deleting Lines                    35
  92.      Good Editing Practices                            35
  93.  
  94. Chapter 6:  Locating Text                              36
  95.      Finding Text                                      36
  96.           Finding Capitalized and Whole Words          36
  97.      Using Goto                                        37
  98.      Using Replace                                     37
  99.      Locating Text Using Bookmarks                     38
  100.      Correcting Spelling Errors Using Replace          40
  101.  
  102. Chapter 7:  Clipboard Editing                          41
  103.      The Clipboard                                     41
  104.      Clipboard Commands                                41
  105.      Selecting Text                                    42
  106.           Block Select -vs- Line Select                42
  107.           Selecting a Region with Block Select         42
  108.           Selecting Sentences with Line Select         43
  109.           Return to Normal Operations                  43
  110.           Canceling a Selection                        44
  111.      Viewing Clipboard Objects                         44
  112.      Copying Text                                      45
  113.      Moving Text                                       45
  114.      Pasting Text                                      46
  115.           Paste & Keep                                 47
  116.      Sizing Clipboard Objects                          47
  117.      Removing Text                                     48
  118.      Recovering Text                                   49
  119.  
  120. Chapter 8:  Adding Emphasis                            50
  121.      Character Attributes                              50
  122.           Giving a Character Attribute to Text         51
  123.      Special Characters                                51
  124.      Indenting Lines and Paragraphs                    51
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.             Surefire User's Guide         Page 3
  134.  
  135.  
  136. Drawing Boxes and Lines                                52
  137.      Constructing Tables                               53
  138.  
  139. Chapter 9:  Page Layout                                54
  140.      Formatting Choices                                54
  141.      Changing Character Spacing                        55
  142.      Changing Printers                                 57
  143.      Rewrapping Paragraphs                             58
  144.      What is a Paragraph?                              58
  145.      Changing Margins                                  58
  146.      Page Breaks                                       59
  147.      Adding and Deleting Pages                         60
  148.      Headers and Footers                               61
  149.           Automatic Page Numbering                     61
  150.      Page and Paper Sizes                              61
  151.      Printing Your Document                            63
  152.  
  153. Chapter 10:  The Calculator                            64
  154.      Mathematical Expressions                          64
  155.      Using Functions                                   65
  156.      Calculator Errors                                 66
  157.      Pasting a Result                                  66
  158.  
  159. Chapter 11:  Introduction to Fields                    67
  160.      Fields and Forms                                  67
  161.      Editing and Using Documents                       67
  162.      Moving Around a Document via Fields               68
  163.           Cursor Tied To Fields                        68
  164.           Free Cursor                                  69
  165.      Creating Fields                                   69
  166.      Sizing Text and Numeric Fields                    70
  167.      Field IDs                                         70
  168.  
  169. Chapter 12:  Field Types and Attributes                71
  170.      Format Attributes                                 71
  171.      Data Attributes                                   71
  172.      Text Fields                                       72
  173.           Justified Text Formats                       72
  174.           Unjustified Text Formats                     72
  175.           Single vs Multiple Lines                      72
  176.      Numeric Fields                                    72
  177.           Numeric Appearance                           73
  178.           Negative Representation                      73
  179.           Numeric Justification                        73
  180.           Other Numeric Format Settings                73
  181.           Single vs Multiple Cells                     74
  182.      Date Fields                                       74
  183.           Date Styles                                  74
  184.           Default to Today                             75
  185.      Logical Fields                                    75
  186.      Button Fields                                     75
  187.      Fixed vs Auto Sized Fields                        76
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.             Surefire User's Guide         Page 4
  199.  
  200.  
  201. Chapter 13:  Working With Fields                       77
  202.      Editing Fields                                    77
  203.      Single vs Multiple Line Fields                    78
  204.      Modifying Field Attributes                        78
  205.      Resizing Fields                                   78
  206.      Deleting Fields                                   79
  207.      Editing a Document with Fields as Text            79
  208.      Moving and Copying Fields                         79
  209.      Entering Information into Fields                  80
  210.           Entering Dates                               81
  211.      Pop-Lists                                         82
  212.           Creating a Pop-List                          82
  213.           Using a Pop-List                             82
  214.      Clearing Field Values                             83
  215.      Locating Specific Field Values                    83
  216.      Printing a Document with Fields                   83
  217.      Copying and Pasting Values Among Fields           84
  218.      Copying and Pasting Values To the Calculator      84
  219.  
  220. Chapter 14:  Introducing Field Commands                85
  221.      What is a Field Command?                          85
  222.      What Can Be Done with Field Commands?             86
  223.      Field IDs                                         86
  224.      Specifying Commands                               87
  225.           Entering Field Commands                      87
  226.           Executing Field Commands                     87
  227.      Specifying Functions                              87
  228.  
  229. Chapter 15:  Using Field Commands                      89
  230.      Viewing and Editing Field Commands                89
  231.           IDs and Names                                89
  232.           Viewing Field Commands                       90
  233.           Editing Field Commands                       90
  234.           Pasting Values From the Calculator           91
  235.      IDs and References                                91
  236.           Ranges                                       92
  237.           Numeric Fields                               92
  238.           Sum of Numbers                               92
  239.           Text Fields                                  93
  240.      Tracing References                                94
  241.      Assignment Statements                             94
  242.           Implicit Assignment                          94
  243.           Explicit Assignment to a Field               95
  244.           Assignment to a Range of Cells               95
  245.      Multiple Statements                               95
  246.      Operating with Numbers                            95
  247.      Operating with Text                               96
  248.      Conditions and Logical Expressions                97
  249.           Logical Operators                            97
  250.           Complex Logical Expressions                  98
  251.           Logical Condition Function                   98
  252.      Control Operations                                99
  253.           Errors in Control Functions                  99
  254.           Document Levels                              99
  255.           
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.             Surefire User's Guide         Page 5
  264.  
  265.  
  266.           Changing Directories                         99
  267.      More About Command Execution                      100
  268.           Automatic Command Execution                  100
  269.           Explicit Execution by Page or Document       100
  270.           Execution by Buttons                         101
  271.           Execute on Enter                             101
  272.           Order of Execution                           101
  273.           Command Errors                               101
  274.  
  275. Chapter 16:  Spreadsheets                              102
  276.      Creating a Spreadsheet                            102
  277.      Using a Spreadsheet                               102
  278.      Absolute and Relative References                  102
  279.      Loading Commands with Relative References         103
  280.      Vertical and Horizontal Relative References       103
  281.           Absolute/Relative Toggle Key                 104
  282.      Enlarging a Spreadsheet                           105
  283.      Using a Range of Fields                           105
  284.           Selecting a Range of Fields                  105
  285.           Copy Commands Using Range Selection          106
  286.      Horizontal vs Vertical Execution Order            106
  287.  
  288. Chapter 17:  Introduction to Databases                 107
  289.      Storing Data                                      107
  290.           Specifying a Database Field                  107
  291.           Database Limits                              108
  292.           Adding a Data Record                         108
  293.      Clearing All Fields                               109
  294.      Simple Data Search                                109
  295.           Viewing All Records                          109
  296.           Database Status Information                  109
  297.           Getting Specific Records                     110
  298.      Updating a Data Record                            110
  299.      Deleting a Data Record                            111
  300.  
  301. Chapter 18:  Searching a Database                      112
  302.      Specifying a Query                                112
  303.           Query Lines                                  113
  304.           Sort Order Multiple Choice Button            113
  305.           Sort Direction Multiple Choice Button        113
  306.           Field Name and Type                          114
  307.           Condition Multiple Choice Button             114
  308.           Single Conditions                            114
  309.           The 'All' Condition                          115
  310.           Range Conditions                             115
  311.           Adding a Query Line                          116
  312.           AND'ed Conditions                            116
  313.           OR'ed Conditions                             116
  314.           Deleting a Query Line                        117
  315.      Closing the Query Window                          117
  316.      Clearing the Current Query                        117
  317.      Setting Search Options                            117
  318.           Setting the  Record Type                     118
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.             Surefire User's Guide         Page 6
  329.  
  330.  
  331.      Named Queries                                     118
  332.           Saving a Query                               118
  333.           Getting a Query                              119
  334.           Running a Query                              119
  335.           Deleting a Query                             119
  336.  
  337. Chapter 19: Sharing Data Among Documents               120
  338.      Base Documents vs Projected Documents             120
  339.      Projected Fields                                  121
  340.           Projecting Fields Using the Clipboard        121
  341.           Projection as a Field Attribute              122
  342.           Using Projected Fields vs Original Fields    122
  343.      Searching in a Projected Document                 122
  344.      Printing Your Data                                123
  345.           Printing the Current Record                  123
  346.           Printing All Qualifying Records              124
  347.  
  348. Chapter 20: Forms and Form Letters                     125
  349.      What You Need to Know                             125
  350.           Documents with Fields and No Database        126
  351.           Documents with Stored Fields                 126
  352.           Documents with Projected Fields              127
  353.      Mailing Labels                                    127
  354.           Printing Mailing Labels                      128
  355.      Envelopes                                         129
  356.      Form Letters                                      129
  357.      Pre-Printed Forms                                 130
  358.  
  359. Chapter 21:  Advanced Database Topics                  131
  360.      Changing the Database Structure                   131
  361.      Using Calculated Fields                           132
  362.      Using Hidden Fields                               133
  363.      Using Database Searching Functions                134
  364.      Recalling a Deleted Record                        135
  365.      Manipulating Record Sets                          136
  366.           Updating a Record Set                        136
  367.           Deleting a Record Set                        136
  368.           Recalling a Record Set                       137
  369.      Importing and Exporting Data                      137
  370.           Importing Data                               138
  371.           Exporting Data                               140
  372.           Merging and Extracting Surefire Databases    140
  373.      Joining Two Databases                             141
  374.  
  375. Chapter 22:  Generating Reports                        142
  376.      Formatting the Report                             142
  377.           Specifying Repeated Fields                   143
  378.           Using Trim                                   144
  379.           Clearing the Repeat Specification            144
  380.           Displaying at the Top or Bottom of Pages     144
  381.           Displaying at the End of a Report            144
  382.           Displaying When a Sort Field Changes         145
  383.           Turning off Report Formatting                145
  384.      Generating a Report                               146
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.             Surefire User's Guide         Page 7
  394.  
  395.  
  396.      Resetting a Report                                147
  397.      Printing a Report                                 147
  398.           Printing After Display                       148
  399.           Printing the Report Directly                 148
  400.      Saving a Report                                   148
  401.      Using Statistical Database Functions              149
  402.      Generating Reports at the Push of a Button        149
  403.  
  404. Chapter 23:  More About Printing                       150
  405.      The Print Window                                  150
  406.           Pages to Print                               150
  407.           Page Numbering                               150
  408.           Number of Copies                             151
  409.           Pause Before Printing                        151
  410.           PRINT and SEARCH & PRINT                     151
  411.      Printing the Current Document                     152
  412.      Stopping and Starting the Printer                 152
  413.      Printers and Printer Drivers                      152
  414.      What Actually Gets Printed                        154
  415.  
  416. Chapter 24:  More About Surefire Documents             156
  417.      The Modes of Editing and Using Documents          156
  418.      Getting Documents                                 156
  419.      Saving Documents                                  158
  420.      Copying Documents                                 158
  421.      Renaming Documents                                159
  422.      Deleting Documents                                159
  423.      Creating a New Document                           160
  424.      Protecting Documents                              160
  425.      Specifying Document Help                          160
  426.           Help File Format                             161
  427.           Specifying a Document Help Context           162
  428.  
  429. Chapter 25:  Surefire System Topics                    163
  430.      Backing Up Your Files                             163
  431.           Manual Backups                               163
  432.           Automatic File Backup and Recovery           163
  433.      Surefire Files                                    164
  434.           Document File Format - WordStar Compatible   165
  435.           Database File Format - DBase III Compatible  165
  436.           Locking Documents                            165
  437.      System Constraints                                166
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.             Surefire User's Guide         Page 8
  459.  
  460.  
  461. Appendix A:  Surefire Function Reference               167
  462.      General Mathematical Functions                    167
  463.      Absolute Value                                    167
  464.      Integer Value                                     167
  465.      Remainder                                         167
  466.      Rounding                                          167
  467.      Square Root                                       167
  468.      Trigonometric Functions                           168
  469.      Pi                                                168
  470.      Sine                                              168
  471.      Cosine                                            168
  472.      Tangent                                           168
  473.      Logarithmic Functions                             168
  474.      Logarithm                                         168
  475.      Power of e                                        168
  476.      Natural Logarithm                                 168
  477.      Financial Functions                               169
  478.      Future Value                                      169
  479.      Payment Amounts                                   169
  480.      Present Value                                     169
  481.      Compound Growth Rate                              169
  482.      Statistical Functions                             169
  483.      Average                                           169
  484.      Count                                             169
  485.      Maximum                                           170
  486.      Minimum                                           170
  487.      Sum                                               170
  488.      Standard Deviation                                170
  489.      Variance                                          170
  490.      Date Functions                                    170
  491.      Add Days to a Date                                171
  492.      Date is After?                                    171
  493.      Date is Before?                                   171
  494.      Specify a Date                                    171
  495.      Day of Month                                      171
  496.      Find Days between Dates                           171
  497.      Month of Year                                     172
  498.      Dates are Same?                                   172
  499.      Subtract Days from a Date                         172
  500.      Today's Date                                      172
  501.      Year                                              172
  502.      Text of a Date                                    172
  503.      Text of a Month                                   173
  504.      Text of a Day                                     173
  505.      Text Functions                                    173
  506.      Find a String                                     173
  507.      Obtain a String                                   173
  508.      Replace a String                                  174
  509.      Obtain Length of String                           174
  510.      Remove Trailing Blanks                            174
  511.      Compare Two Strings                               174
  512.      Force String to Upper Case                        174
  513.      Force String to Lower Case                        174
  514.      Convert a Number to a String                      174
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.             Surefire User's Guide         Page 9
  524.  
  525.  
  526.      Put String to a Page                              175
  527.      Text Buffer Functions                             175
  528.      Copy Text to Buffer                               175
  529.      Paste Buffer onto Page                            175
  530.      Copy Text from Field to Buffer                    175
  531.      Paste Buffer into Field                           176
  532.      Time Functions                                    176
  533.      Current Time                                      176
  534.      Time Stamp                                        176
  535.      Control Functions                                 176
  536.      Go To a Page                                      177
  537.      Go To a Field                                     177
  538.      Go To a Document                                  177
  539.      Return to Previous Document                       177
  540.      Return to Document at Level                       178
  541.      Run a DOS Command                                 178
  542.      Reset the Document                                178
  543.      Set Help Context                                  178
  544.      Present a Document                                179
  545.      Database Statistical Functions                    179
  546.      Database Search Functions                         180
  547.      Set Query Conditions                              180
  548.      Execute a Query                                   181
  549.      Join a Document                                   181
  550.      Start a Search                                    181
  551.      Update  Record                                    181
  552.      Logical Value Functions                           182
  553.      Logical Condition Function                        182
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.             Surefire User's Guide         Page 10
  589.  
  590.  
  591. Chapter 1      -    INTRODUCTION
  592.  
  593.      We have developed Surefire to help you do a wide variety of tasks
  594. in the office and at home. Whether you want to track expenses, send
  595. timely correspondence, or keep information about all your clients,
  596. employees or favorite recipes, Surefire can meet your needs.
  597.  
  598.      You will find that Surefire is easy to use and easy to understand.
  599. Menus and windows guide you through all of its features. Help is
  600. available when and where you need it.  And you know at all times what
  601. your printed text will look like without special formatting and viewing
  602. procedures.
  603.  
  604.      The power of Surefire can be learned and incorporated in stages.
  605. Your use and knowledge of Surefire will grow as you discover new ways to
  606. automate various tasks. Through reading this manual and exploring the
  607. Surefire system, you will gradually learn new powerful concepts. Once
  608. you learn to do an operation, the methods for performing that operation
  609. are the same no matter how complex your use becomes.
  610.  
  611.      This manual presents the concepts of Surefire so you can easily
  612. build upon what you know from one stage to the next. As you read this
  613. manual, you should take time to understand the concepts that are
  614. presented in each chapter. It is not necessary to read each chapter
  615. completely before moving on, but understanding the key concepts will
  616. make understanding subsequent chapters easier.
  617.  
  618.      When you register your copy of Surefire, you will receive a nicely
  619. bound printed Surefire User's Guide. This guide is loaded with
  620. illustrations and step-by-step practices and has a complete index for
  621. finding topics of interest quickly. Doing the practices will enable you
  622. to benefit the most from the unique capabilities of Surefire.
  623.  
  624.      In order that you can have a vision of what Surefire is about
  625. before you begin, we are going to introduce the notion of Smart
  626. Documents. The Smart Document is what makes Surefire unique.
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.             Surefire User's Guide         Page 11
  654.  
  655.  
  656. What is a Smart Document
  657.  
  658.      Normally, word processing features are used to edit and manipulate
  659. text. Once the text has been typed into your document, you could print
  660. it for yourself or others to read. But what if your document did some
  661. things for you automatically? Or better yet, what if you could interact
  662. with your document?
  663.  
  664.      Suppose you were writing a letter. Your letter would probably have
  665. your company letterhead and other information pertinent to you. However,
  666. every time you write another letter you need to check your calendar so
  667. that you can type the correct date. Having each new letter automatically
  668. start with today's date would let you spend more time putting your
  669. thoughts into your letter.
  670.  
  671.      Or, have you ever filled out a travel expense form at the end of a
  672. long week and found out that the figures did not add up? No matter how
  673. carefully you added the amounts, all of your daily totals did not equal
  674. all the totals for the weekly categories. Frustrating time-wasters like
  675. this can be eliminated if you could teach the computer to make these
  676. routine calculations.
  677.  
  678.      With Surefire, you can put intelligence into your textual
  679. documents. When you do this, you create Smart Documents.  Surefire
  680. builds upon your knowledge of word processing to allow you to
  681. incorporate spreadsheet and database management features directly within
  682. your documents. A Smart Document can be a data entry or retrieval form,
  683. an expense report, a contact database, a profit and loss statement or a
  684. job estimate. In fact, a Smart Document can be almost any application
  685. for which a spreadsheet or database program is used.  What's more, a
  686. Smart Document can contain "buttons" to perform specific actions. And,
  687. Smart documents can be linked together to build sophisticated custom
  688. applications.
  689.  
  690.      Automatically dating your letter and setting up an expense report
  691. are two simple examples of Smart documents. But Surefire's power and
  692. flexibility go far beyond that! On the following page is an example of
  693. two smart documents that could be part of a larger application. One of
  694. the documents is an organizational chart that shows the reporting
  695. hierarchy at a company. The other is an example of the phone list of all
  696. employees at that company. The phone list may be viewed by "pressing" a
  697. button on the ORG chart. In this case, pressing the "Full Directory"
  698. button will give the company phone list while pressing the "VP
  699. Marketing" button will display a list of all the employees reporting to
  700. Joan Lindle.
  701.  
  702.       A Smart Document can be used as a fill-in-the-blank form. Take a
  703. standard property lease for example. Generally, a lease has blank spaces
  704. which will eventually hold information such as the names of the tenant
  705. and landlord, the rent due each month and the required damage deposit.
  706. With Surefire, you could enter the standard text of the lease once and
  707. allow Surefire to quickly guide you through the blank areas to fill in
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.             Surefire User's Guide         Page 12
  719.  
  720.  
  721. the missing information each time a new lease is needed. In addition,
  722. this information can be stored so you can quickly find a lease for a
  723. particular tenant or all leases starting in a particular month.
  724.  
  725.      Perhaps you have trouble sorting your friends from your business
  726. associates in your little black address book, or perhaps you travel
  727. often for business or pleasure and would like to keep track of the best
  728. places to eat in various cities. A database would allow you to keep
  729. track of the information and would let you search through it in an easy
  730. manner. You may want to send different holiday cards to your friends
  731. than to your associates, or you may wish to look up restaurants by city
  732. or by cuisine. Any of these can be a Smart Document.
  733.  
  734.      Eventually, you may find that you have created a number of smart
  735. documents that each do a specific task. With Surefire, you can create a
  736. smart document that is a menu linking all of these other documents into
  737. one personalized application. The uses of Surefire's Smart Documents are
  738. almost limitless. As you will see, a smart document can become
  739. increasingly more intelligent by incorporating features one at a time to
  740. solve the task at hand. This manual will show you how to create useful
  741. Surefire documents and gradually add more and more intelligence to them.
  742.  
  743. Chapter Preview
  744.  
  745.      Chapter 2 guides you through the steps to install and run Surefire.
  746.  
  747.      Chapters 3 through 9, show you how to get around in Surefire and
  748. how to use the word processing features. These features range from
  749. creating simple letters to manipulating more complicated documents.
  750.  
  751.      Chapter 10 shows you how to use Surefire's handy calculator.
  752.  
  753.      Chapters 11 through 15 show how to create Smart Documents that
  754. directly calculate information. Chapter 16 shows specifically how this
  755. applies to spreadsheets.
  756.  
  757.      Chapters 17 through 21 describe Surefire databases. You will see
  758. how Smart documents can store and retrieve many records of similar
  759. information. Chapter 19 tells you how you can access a database in many
  760. ways while Chapter 20 specifically shows you how to make forms and form
  761. letters.  In Chapter 22 you will learn how to generate reports from a
  762. Surefire database, right in your document.
  763.  
  764.      Chapters 23 and 24 include more detail on using printers and
  765. managing Surefire documents. In addition, you will see how to import and
  766. export data between Surefire and other programs.
  767.  
  768.      Chapter 25 gives you more information about the Surefire system.
  769. This includes a discussion of backing up your files.
  770.  
  771.      Appendix A describes all of the functions that are available in
  772. Surefire to manipulate Surefire data.
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.             Surefire User's Guide         Page 13
  784.  
  785.  
  786. Chapter 2      -    GETTING STARTED
  787.  
  788.      Before you install Surefire, you should be somewhat familiar with
  789. the DOS operating system and your particular hardware. You should know
  790. about the DOS directory structure, the type of disks drive(s) you have
  791. and the identifiers of these drives (i.e. A:, B:, C:, etc).  Consult
  792. your DOS reference manual for complete information.
  793.  
  794.      After downloading surefire.zip onto your hard drive, and unpacking
  795. the Surefire files from it, be sure to run the Surefire demo.  See the
  796. section "The Surefire Demo/Tutorial" at the end of this chapter for more
  797. information.
  798.  
  799. You will see these files:
  800.  
  801.      The Surefire program (surefire.exe), the Surefire system help file,
  802.      printer drivers and other miscellaneous files associated with the
  803.      Surefire system. You will also have the files needed to run the
  804.      Surefire Demo/Tutorial.
  805.  
  806.      You may put the Surefire directory in your path by updating your
  807. AUTOEXEC.BAT file so that the directory is in your PATH command. Read
  808. your DOS manual for directions on doing this. This will allow you to run
  809. Surefire from any directory.
  810.  
  811. Running Surefire
  812.  
  813.      1.  Type SUREFIRE at the DOS prompt.
  814.      If you have added the Surefire directory to your DOS path (in
  815.      your autoexec.bat file) you will be able to run Surefire from
  816.      any directory on your system. If you have not, you must change
  817.      directory to the Surefire directory before running Surefire.
  818.  
  819.      Surefire will look in your default drive and directory for files
  820.      and documents that you access. If you type the command:
  821.      "SUREFIRE .", at the DOS prompt, Surefire will look in your current
  822.      drive and directory for any files and ignore the defaults saved in
  823.      the configuration file. See the discussion of current drive and
  824.      directory under System Setup later in this chapter.
  825.  
  826.      2.  Press (Enter)
  827.      This will run Surefire. You will see a copyright notice and then
  828.      the initial Surefire screen.
  829.  
  830.      The screen appears with the Menu Bar/Status line at the top. Just
  831. below this line is the top portion of an empty standard 8 1/2 by 11
  832. sheet of paper. This is a new document. You may move about anywhere in
  833. this document and immediately type in information. The document may then
  834. be printed or saved for later use.
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.             Surefire User's Guide         Page 14
  849.  
  850.  
  851. Running Surefire with a Document
  852.  
  853.      You may specify the name of a Surefire document that you want to be
  854. displayed immediately upon running Surefire. To do this, type SUREFIRE
  855. and a document name at the DOS prompt. Surefire will look for this
  856. document in your current DOS directory. Press (Enter). This will run
  857. Surefire. You will see a copyright notice and then the screen will
  858. appear with the first page of the previously saved document.
  859.  
  860. Leaving Surefire
  861.  
  862.      You can leave or exit from Surefire by choosing "Exit" from the
  863. File menu or by pressing (ALT + X). You may not exit from Surefire if
  864. there are any windows or menus currently displayed. Surefire will
  865. display a message window to warn you if there is the possibility of
  866. data loss due to not saving your document changes.
  867.  
  868. System Information
  869.  
  870.      System information is always available by choosing the option
  871. "Info..." from the File menu. The Info window shows the current version
  872. number of the system with a copyright notice. You will also see the
  873. current date and time (provided you have set the DOS system clock) and
  874. the amount of memory available for the document.
  875.  
  876. System Setup
  877.  
  878.      You may define and modify general system parameters and hardware
  879. configuration information in the Setup window. This window is accessed
  880. by choosing the option " Setup..." from the File menu. It displays the
  881. current disk drive, the current working directory, the current printer
  882. and the current printer port. In addition, it lets Surefire know how to
  883. display information on your video device as well as the current settings
  884. of other document related parameters.
  885.  
  886.      After making the modifications desired, you can choose OK to have
  887. the settings be used for the current session only.  If SAVE is chosen,
  888. the settings are used for the current session and subsequent sessions.
  889.  
  890.    Current Drive and Directory
  891.  
  892.      Any files you read or save will be put in the directory where
  893. Surefire was installed.  You can change to another directory by changing
  894. the values for the current drive and directory in the Setup window.
  895.  
  896.      Specifying the drive and directory tells Surefire where to look for
  897. documents, text and data files when you do a Get, and where to put
  898. documents and files when you do a Save. To specify a drive, type in a
  899. letter (usually A,B,C,D or E) in the field to the right of the label
  900. "Drive:". You need not type in the colon ':' or slash '\'.  To change
  901. the current directory, enter the full path of the desired directory in
  902. the field to the right of the label "Directory:".  While a complete
  903. description of drives and directories is not necessary to use Surefire,
  904. you may wish to refer to your DOS reference manual for more information.
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.             Surefire User's Guide         Page 15
  914.  
  915.  
  916.    Current Printer and Printer Port
  917.  
  918.      Specifying the printer type is done with the multiple choice button
  919. to the right of the text "Printer is". If you press the Zoom key (ALT+Z)
  920. when the cursor is on this button, Surefire will display the names of
  921. all available printer definitions. Specifying a printer here indicates
  922. to Surefire how to send information to the printer when you choose PRINT
  923. or SEARCH & PRINT in the Print window.
  924.  
  925.      The printer port refers to how and where your printer is physically
  926. connected to your computer. You will find a multiple choice button to
  927. the right of the text "on Port" that is used to indicate the printer
  928. port to Surefire. If you press the Zoom key (ALT+Z) when the cursor is
  929. on this button, Surefire will display the names of available ports.
  930.  
  931.      Please read "Chapter 23: More About Printing" in this manual, for
  932. a discussion about setting up printers.
  933.  
  934.    Using Your Display
  935.  
  936.      Depending on whether you have a monochrome or color monitor or the
  937. type of grey scale supported by your laptop or display monitor, you may
  938. choose the representation for how Surefire will appear on your display
  939. device. The possible display types are described as follows:
  940.  
  941.      Display Types       Indication
  942.  
  943.      Default             Automatically set for monochrome or color
  944.                          depending on your equipment.
  945.      Color               Indicates that the monitor is color.
  946.      Grey                Use for grey scale or color emulation.
  947.      Inv Grey            Similar to Grey but reversed for LCD
  948.                          displays.
  949.      B & W               Forces monochrome attributes on
  950.                          non-monochrome monitor.
  951.  
  952. Note:   If an incorrect display type is shown or you wish to change your
  953. display type, you must save the change, exit from Surefire and run
  954. Surefire again from the DOS prompt.
  955.  
  956.      If you have a computer that does color emulation on black and white
  957. monitors, you may want to try a few options to see what is most
  958. pleasing. This may be of particular interest if you are using a laptop
  959. or portable computer. If you have an LCD display, and the default
  960. display setting doesn't produce enough contrast, you should try the "Inv
  961. Grey" setting.
  962.  
  963.      Another option is to set your computer to emulate a monochrome
  964. monitor instead of color. Sometimes this can be done by using the "B &
  965. W" display option. Try it. If underlines are not displayed, you may need
  966. to set your computer hardware to monochrome emulation mode. This may not
  967. be available on some computers. Consult your computer manual for how to
  968. change its display modes.
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.             Surefire User's Guide         Page 16
  979.  
  980.  
  981. Document Related Parameters
  982.  
  983.      Any of the document related parameters shown in the table below can
  984. be changed for the current Surefire session or set for all subsequent
  985. sessions. To change any parameter but Tab Size, position the cursor over
  986. the appropriate Yes or No and press (Spacebar).
  987.  
  988. Tab Size
  989.  
  990.      The Tab Size indicates where to put equally spaced tab stops. When
  991. you are editing a document and you press the (Tab) key, blank characters
  992. are inserted on the page from the current cursor position up to the next
  993. tab stop. You enter the number of characters to be between tab stops in
  994. the field to the right of the label "Tab Size:".
  995.  
  996. Word Wrap
  997.  
  998.      Word Wrap is a mode that can be either on or off. When on, words
  999. that you type on a page of your document are automatically moved to the
  1000. next line if there is not enough room on the current line. The value
  1001. that you set here will be reflected in the Word Wrap menu item on the
  1002. Page menu. Read "Chapter 4: Typing Text" for a complete discussion of
  1003. Word Wrap.
  1004.  
  1005. Auto Calc
  1006.  
  1007.      Auto Calc is a mode that can be either on or off. When on, Surefire
  1008. will always calculate new field values whenever any field value changes.
  1009. The value you set here will be reflected in the Auto Calc menu item on
  1010. the Field menu.  Read "Chapter 15: Using Field Commands" for a complete
  1011. discussion of Auto Calc.
  1012.  
  1013. Hints
  1014.  
  1015.      The response that you enter, in the field to the right of the label
  1016. "Hints:" tells Surefire whether you want the Hint Line at the bottom of
  1017. your screen to be displayed or not. The Hint Line shows the more
  1018. important keystrokes that are available at any time during your Surefire
  1019. session. This information changes depending upon whether there is an
  1020. open Surefire window or menu. You may also decide to display or
  1021. undisplay the Hint Line by pressing (Shift+F10). Below is an example of
  1022. the hint line displayed when there are no open Surefire windows or
  1023. menus.
  1024.  
  1025. Auto Backup
  1026.  
  1027.      Auto Backup may be on or off. If on, Surefire will save a copy of
  1028. your document before you save any changes. You may restore the previous
  1029. version of your document from the copy if you wish. See "Chapter 25:
  1030. Surefire System Topics" for a complete discussion of Backup and Recovery
  1031. procedures.
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.             Surefire User's Guide         Page 17
  1044.  
  1045.  
  1046. The Surefire Demo/Tutorial
  1047.  
  1048.      The quickest way to become familiar with Surefire is to see it and
  1049. feel it. You can do this with minimal effort by running the Surefire
  1050. demo/tutorial. You can view the demo/tutorial completely by just using
  1051. the (Spacebar) key. In some places, you can use the same keys as in
  1052. Surefire itself. The demo/tutorial will really get you excited about
  1053. what you can do. You run the demo/tutorial by typing SFDEMO at the DOS
  1054. prompt.
  1055.  
  1056.      The example documents described in the demo are available with the
  1057. registered version of Surefire. These documents will help you build your
  1058. own Smart Document applications. They include a basic lease manager, a
  1059. contact manager and a company organization system. The on-line help
  1060. specific to these example applications will provide a template for
  1061. developing your own application help.
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.             Surefire User's Guide         Page 18
  1109.  
  1110.  
  1111. Chapter 3      -    GETTING AROUND
  1112.  
  1113.      In the spirit of making an easy-to-use program, we created Surefire
  1114. with a custom window interface.  Since Surefire doesn't require the
  1115. memorization of hundreds of cryptic commands or overload you with too
  1116. much information at once, you'll soon discover that Surefire's window
  1117. system is a refreshing departure from other DOS applications. Surefire
  1118. groups all of the same types of functions together in specialized
  1119. windows.
  1120.  
  1121.      If you have seen other window systems before such as the Apple
  1122. Macintosh or Microsoft Windows for the IBM PC, then you are already
  1123. familiar with the basic concepts behind a window system.  However,
  1124. because Piaf designed a custom interface for Surefire, the interface has
  1125. some unique features not seen anywhere else.  Therefore, whether or not
  1126. you've used window-based programs before, we recommend that you look
  1127. over this chapter to familiarize yourself with Surefire's approach.
  1128.  
  1129. The Document
  1130.  
  1131.      The document is carefully designed to provide you with a flexible
  1132. environment perfectly suited for handling every aspect of document
  1133. generation.  For example, the word processing features found in the
  1134. document are best used for manipulating text and dealing with formatting
  1135. concerns, while the data management features give you complete control
  1136. of how you want your data presented.
  1137.  
  1138.   The Page Display
  1139.  
  1140.      If you choose to start a new document, the screen shows you a
  1141. representation of a standard 8 1/2 by 11 blank sheet of paper.  This is
  1142. the first page.  The grey area represents the margin, and the blank
  1143. space represents the writing area.  Text is added to the page by typing,
  1144. and it appears to the left of the cursor.  If you make a mistake, using
  1145. the backspace key will erase characters to the left of the cursor.  To
  1146. change the position of the cursor on the page, you use the arrow keys on
  1147. your keyboard.  On some PC, AT and XT keyboards you'll see separate
  1148. arrow keys, while on others, you'll find them on the numerical keypad.
  1149.  
  1150. Menus
  1151.  
  1152.      While a screen looks like a complete display, a menu or window
  1153. looks like an independent display-within-a-display.  Whenever you choose
  1154. a command in a menu or window, you are telling Surefire exactly what you
  1155. want it to do for you at the time.  Menus give you a list of choices
  1156. called menu items.
  1157.  
  1158.    The Menu Bar
  1159.  
  1160.      Menus are accessed from the menu bar.  Because it is always
  1161. visible, the menu bar provides you access to all menus at all times.
  1162. This line also provides you with essential status information about what
  1163. you are currently doing in Surefire.
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.             Surefire User's Guide         Page 19
  1174.  
  1175.  
  1176.      The Menu bar consists of seven menus (or pull-down windows):  File,
  1177. Page, Operate, Edit, Field, Data and Graphic.  In this chapter, we will
  1178. be using the File and Page menus in our examples.  These and the other
  1179. menus will be detailed fully in subsequent chapters.
  1180.  
  1181.    Choosing a Menu Item
  1182.  
  1183.      Follow these steps to choose a menu item:
  1184.  
  1185.      1.  Press (F10).
  1186.      The Menu bar is accessed by pressing function key (F10). This
  1187.      places the cursor on the word File.
  1188.  
  1189.      2.  Move the Cursor.
  1190.      Pressing the (right arrow) key will place the cursor at Page, and
  1191.      a (left arrow) from Page will return the cursor to File.
  1192.  
  1193.      3.  Open the File menu.
  1194.      Pressing the (down arrow) key at File will display the File menu.
  1195.  
  1196.      4.  Open the other menus.
  1197.      Use the (left or right arrow) keys to cycle through all 7 menus.
  1198.  
  1199.      5.  Cycle through the menu items.
  1200.      The (down arrow) will cycle through available choices and the (up
  1201.      arrow) will cycle in the reverse direction.
  1202.  
  1203.      6.  Select one of the menu items.
  1204.      When the cursor is over the desired choice, press (Enter) and some
  1205.      kind of action will be performed.  For example, choose Get... in
  1206.      the File menu.
  1207.  
  1208.      7.  Close the window.
  1209.      When you choose Get..., a window appears asking for the name of the
  1210.      file that you want Surefire to load.  Close the window by typing
  1211.      (Esc) for now.  This will return the cursor to the document.
  1212.  
  1213.      If you chose "Get..." in the File menu, you were presented with a
  1214. window that requested more information.  For "Get..." and several other
  1215. menu items, a window will appear when the choice is selected.  However,
  1216. in most instances, Surefire will simply perform an action in response to
  1217. a menu item selection.  For example, the choice "Add Page" on the Page
  1218. menu appends a page to the current page of the document without bringing
  1219. up a window.  You can tell the difference between the two kinds of items
  1220. if you see three dots "..." following the item.  The dots indicate that
  1221. choosing an item will open a window.
  1222.  
  1223.    Accelerated Menu Selection
  1224.  
  1225.      In addition to choosing menus from the Menu Bar, you can choose
  1226. menus directly from the keyboard by pressing the (ALT) key with the
  1227. appropriate highlighted or red-colored letter of the menu.  For example,
  1228. to quickly bring up the File menu, you type (ALT + F).
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.             Surefire User's Guide         Page 20
  1239.  
  1240.  
  1241.      Once you've opened a menu, you can also quickly choose an item.  In
  1242. our File menu example, you have two options for choosing the menu item
  1243. 'New'; you could either move the cursor to the item and hit (Enter), or
  1244. you could type the item's highlighted letter (N).
  1245.  
  1246.    Inactive Menu Items
  1247.  
  1248.      When a menu item is unavailable because it is inappropriate to the
  1249. type of work you are doing at the time, it will not have a highlighted
  1250. or red-colored letter, and cannot be selected.
  1251.  
  1252. Shortcuts
  1253.  
  1254.      For the menu items which are frequently used, it may be bothersome
  1255. to bring up a menu each time you want to access the choice.  Therefore,
  1256. shortcut keybindings are available for the commonly-used menu items.
  1257. Shortcuts are special keystrokes which give you direct access to the
  1258. desired menu item. If a menu item has a shortcut, the keystroke will be
  1259. indicated on the menu to the right of the menu item.
  1260.  
  1261. Windows
  1262.  
  1263.      As you saw in the Setup window in the previous chapter, some
  1264. windows ask you to supply additional information.  Other kinds of
  1265. Surefire windows provide you with information or alert you to a possible
  1266. problem.  These are called message windows.  Whenever a message window
  1267. appears, its function is to request some kind of input that Surefire
  1268. needs before proceeding, and thus, you must respond to it before you can
  1269. do anything else in the program.
  1270.  
  1271.      When you look at a window, you will notice three kinds of items:
  1272. informative text, areas for typing, and buttons.  The typing area is
  1273. called a data entry field.  The words not associated with a data entry
  1274. field are usually buttons and they come in two varieties: "action" and
  1275. "multiple choice".
  1276.  
  1277. Window Fields
  1278.  
  1279.      In Surefire, fields are areas found in windows and documents with
  1280. some sort of assigned function.  On color monitors, window fields are
  1281. blue and document fields are green.  On a monochrome monitor, all fields
  1282. are underlined. When you move the cursor into a field, the area changes
  1283. to a black background with white letters.  Windows have four varieties
  1284. of fields:  data entry, action button, multiple choice button and
  1285. logical choice button. You can easily determine which kind of window
  1286. item you are looking at by using the following guidelines:
  1287.  
  1288.    Data Entry Fields:  In windows, you type in data entry fields.  You
  1289.           can easily identify them because they always follow
  1290.           informative text, and usually a colon.
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.             Surefire User's Guide         Page 21
  1304.  
  1305.  
  1306.    Action Buttons:  Action buttons always preform an operation when
  1307.           you "press" them.  They are displayed as uppercase words and,
  1308.           like all other window fields are blue or underlined.  You
  1309.           always use these buttons when closing a window.
  1310.  
  1311.    Multiple Choice Buttons:  All multiple choice buttons are
  1312.           capitalized lowercase words.  They are used for setting
  1313.           options.  All multiple choice buttons can be zoomed.  Whenever
  1314.           you zoom a multiple choice button, you are presented with a
  1315.           list of choices for that button.  Press (ALT+Z) to "zoom" a
  1316.           multiple choice button or (Spacebar) to cycle through values.
  1317.  
  1318.    Logical Choice Buttons:  Logical choice buttons look like multiple
  1319.           choice buttons as they are also capitalized lowercase words.
  1320.           Unlike multiple choice buttons, logical choice buttons answer
  1321.           a Yes/No question, and are easily identified by the question
  1322.           mark in the informative text preceding them. Press (Spacebar)
  1323.           to change the value of a logical choice button.
  1324.  
  1325.    Moving Between Fields
  1326.  
  1327.      The simplest way to change the position of the cursor inside a
  1328. window is to use the (Home) and (End) keys.  (End) will move the cursor
  1329. to the next item of interest in the same way your eye moves across the
  1330. page when you are reading. That is from left-to-right and top-to-bottom.
  1331. In contrast, the (Home) key moves in the opposite direction.
  1332.  
  1333.    Changing Logical and Multiple Choice Buttons
  1334.  
  1335.      To change a logical choice button from Yes to No or from No to Yes,
  1336. you use the (Spacebar).  Multiple choice buttons let you choose from a
  1337. list of items.  To operate a multiple choice button, you can either use
  1338. (Spacebar) to scroll through all of the choices (as you did with the
  1339. logical choice button); or you can "zoom" the button by pressing
  1340. (ALT+Z).  Whenever you use the zoom option, Surefire will display all of
  1341. your choices for the button in a "pop-list".
  1342.  
  1343.    Choosing Action Buttons
  1344.  
  1345.      In contrast to the multiple choice buttons which are always
  1346. displayed as lowercase words, all action buttons are uppercase and are
  1347. used to perform an action when you "press" them.
  1348.  
  1349.      Action buttons are always used whenever you close a window.  Most
  1350. of the Surefire windows have an action button labeled OK and a button
  1351. labeled CANCEL. The OK button is used to tell Surefire that you either
  1352. want to go ahead with an operation or that the new settings shown in the
  1353. window are correct. The CANCEL button tells Surefire to ignore all of
  1354. the changes you've made in the window.  For example, in the Get File
  1355. window, OK tells Surefire to read the file whose name is given in the
  1356. window, and CANCEL tells Surefire to forget about reading a file.  To
  1357. access these buttons you use the (Home) an (End) keys.  You can use
  1358. the shortcuts: (Ctrl + Enter) for OK and (Esc) for CANCEL to bypass
  1359. having to use the corresponding action buttons.
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.             Surefire User's Guide         Page 22
  1369.  
  1370.  
  1371. Getting Help
  1372.  
  1373.      Surefire has several forms of help. Help displays descriptions of
  1374. procedures and commands so that you can complete your tasks without
  1375. having to turn away from the screen.  Some help information is always
  1376. visible such as the information in the Status Line. If desired, you can
  1377. display Hints (see below) for suggestions on which keys to press, and
  1378. Context Help for more information on common commands and procedures.
  1379.  
  1380.    The Status Line
  1381.  
  1382.      The Status line is placed to the right of the Menu Bar on the top
  1383. line of the screen. The Status line provides you with word processing
  1384. and database information; the current document name; the current page,
  1385. line; and column.  It also lets you know what Surefire is doing from
  1386. time to time with an operation indicator.
  1387.  
  1388.      The operation indicator is found on the right side of the status
  1389. line and appears highlighted.  It notifies you that an operation is
  1390. taking a long time and tells you when it is finished.  The meanings of
  1391. some indicators are shown below:
  1392.  
  1393.      Indicator      Meaning
  1394.  
  1395.      GETTING        A document file is being loaded into Surefire.
  1396.      SAVING         The changes in a document file are being saved.
  1397.      LOOKING        A word is being looked for in the document.
  1398.      REPLACING      A substitution of occurrences of a word by another
  1399.                     word in the document is being processed.
  1400.  
  1401.    Hints
  1402.  
  1403.      Surefire uses Keybindings to help you perform operations and make
  1404. choices easily and efficiently.  Recall that when you wanted to use a
  1405. menu, you typed (F10) to access the Menu Bar.  Likewise, when you wanted
  1406. to close a window, you typed (Esc) to return the cursor to the document
  1407. page.
  1408.  
  1409.      So that you don't have to keep a mental record of all of the
  1410. keybindings used in Surefire, we offer a help line at the bottom of the
  1411. screen to show you a context-specific display of keybindings.  Only the
  1412. most common keybindings that are relevant for the current task are
  1413. displayed.  For example, the hint line for a window shows you that the
  1414. (Home) and (End) keys are used to move around; the (Esc) key will cancel
  1415. the window; and the keys: (Ctrl + Enter) will verify the window
  1416. information.  If you were to type (Esc) and return to the document, you
  1417. would see only the keybindings and their contextual meaning appropriate
  1418. to Surefire's word processing and data management features.
  1419.  
  1420.      After some experience with using Surefire, you may not need to see
  1421. the keybindings all the time.  The line showing the keybindings can be
  1422. hidden by typing (Shift+F10).  You can redisplay the line by typing
  1423. (Shift+F10) again.
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.             Surefire User's Guide         Page 23
  1434.  
  1435.  
  1436.    Context Help
  1437.  
  1438.      When you need help with using a menu or window, you can receive it
  1439. by displaying the menu or window and then pressing function key (F1).
  1440. The (F1) key displays a Help window that briefly explains what can be
  1441. done in that menu or window.  Often, there is more help information than
  1442. can be displayed in one screen.  To show another help screen, use the
  1443. arrow keys or the (Page Up) and (Page Down) keys.  When you are
  1444. finished, press (Esc) to close the Help window.
  1445.  
  1446.      When there are no open menus or windows, pressing (F1) provides you
  1447. with the most general information about Surefire.
  1448.  
  1449.    Document Help
  1450.  
  1451.      Document help may be provided for specific Surefire documents.
  1452. After you have created a document using Surefire, you may want to use
  1453. the document as a complete application in itself and will want others in
  1454. your business to use it.  To provide your associates with help specific
  1455. to your document, you can create your own help information.  This help
  1456. information, if provided, is obtained by pressing function key (F2).
  1457. See the section "Specifying Document Help" in "Chapter 24: More About
  1458. Surefire Documents", for information on providing document help for your
  1459. documents.
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.             Surefire User's Guide         Page 24
  1499.  
  1500.  
  1501. Chapter 4      -    Typing Text
  1502.  
  1503.      This chapter will guide you through the first steps of word
  1504. processing - getting your words on the screen and saving them in a file.
  1505.  
  1506.      Those of you who have used other word processors before and are
  1507. acquainted with common word processing features such as word wrap,
  1508. typeover and insert modes, this chapter can be used as an overview.
  1509. Just browse through the step-by-steps to see how Surefire's approach
  1510. compares with what you've used in the past.  Once you've become familiar
  1511. with the key concepts in this chapter, you'll have an adequate
  1512. background for doing the more complicated editing and formatting
  1513. operations described in later chapters.
  1514.  
  1515. Word Processors -vs- Typewriters
  1516.  
  1517.      For those of you new to word processing, keep in mind that you
  1518. don't have to learn anything new about typing in order to use Surefire.
  1519. Although many typists think that keystroking feels more natural on an
  1520. electric typewriter than on a computer keyboard, the fingering for each
  1521. is almost exactly the same.  This is because the keyboard for the IBM PC
  1522. and their "clones" or "compatibles" was designed from the popular IBM
  1523. Selectric.
  1524.  
  1525.      The extra keys on the main part of the IBM PC keyboard (Esc, Ctrl
  1526. and Alt) are called "control keys".  The name is slightly misleading
  1527. because these keys don't control anything. Instead, they are used in
  1528. conjunction with other keys to send commands or perform special
  1529. functions.  For example, pressing both the control key and the backspace
  1530. key at the same time will erase a word, while pressing the backspace key
  1531. alone will erase a single character.  Therefore, the control keys make
  1532. it possible for other keys to have more than one function.
  1533.  
  1534.      Another difference between the computer keyboard and a typewriter
  1535. is the extra keys on the right and left sides of the main typing area.
  1536. On most keyboards, on the right side has a numeric key pad.  Often, the
  1537. number keys double as cursor-control keys as well.  If you have this
  1538. kind of keyboard, a key called "Num Lock" will switch you between using
  1539. the key pad for entering numbers and using it for cursor control.  You
  1540. will know which "mode" your keyboard is in if you see a light above the
  1541. key pad.  On most, when the light is on, the number keys are active, and
  1542. when the light is off, the arrow keys are active.  If your keyboard is
  1543. of this variety, Surefire will operate more efficiently if you use these
  1544. keys for cursor movement only, and use the main keyboard for entering
  1545. numbers.  Some of the more upscale keyboards keep the cursor-control
  1546. keys separate from the numeric key pad, so you don't have to use the
  1547. same keys for both.
  1548.  
  1549.      The function keys are found either to the left side or above the
  1550. main set of keys.  They are usually marked "F1", "F2", "F3". . .
  1551. Keyboards with the function keys along the left edge usually have 10
  1552. function keys, while keyboards with the keys across the top have 12.
  1553. Each key has a different meaning depending on whether you press the key
  1554. alone or in combination with either the (ALT) or (Shift) control keys.
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.             Surefire User's Guide         Page 25
  1564.  
  1565.  
  1566.      For help on learning which keys to press when, look at the Hints
  1567. displayed at the bottom of the screen for suggestions. You view Hints by
  1568. pressing (Shift+F10).  Pressing (Shift+F10) again will hide the Hints.
  1569.  
  1570. Creating a New Document
  1571.  
  1572.      When you start Surefire for the first time, the screen displays a
  1573. representation of the upper portion of a blank 8 1/2 x 11 sheet of
  1574. paper. The cursor is the blinking horizontal line, and starts out in the
  1575. upper left-hand corner of a new document.  The grey area is the margin,
  1576. and the blank space is the typing area.
  1577.  
  1578.      As you type on the keyboard, text is inserted to the left of the
  1579. cursor as the cursor moves from left to right.  If you make a mistake,
  1580. the (Backspace) key will erase one character at a time to the left of
  1581. the cursor. You can press (Enter) to move to the start of the next line.
  1582.  
  1583. Saving Your Document
  1584.  
  1585.      When you're done typing, bring up the Save window from the File
  1586. menu to save your text.  Saving your file will store what you typed   on
  1587. a permanent medium such as a floppy or hard disk.  Since you are saving
  1588. the document for the first time, you will need to give it a name.  In
  1589. the "Name:" data entry field, type in any name up to eight characters.
  1590. When you are done typing the name, press (Ctrl + Enter) to close the
  1591. window.  This will return the cursor to where you last were in your
  1592. document.
  1593.  
  1594.      Your document's name is displayed on the status line and the text
  1595. you typed remains on the screen after you save it so that you can
  1596. continue working on it. It is a good idea to save your typing on disk
  1597. about every 15 minutes or so.  This ensures that your work will not be
  1598. lost if the power goes out or you leave your computer unattended.
  1599.  
  1600. Cursor Movement
  1601.  
  1602.      If Surefire forced you to start every page in the upper left-hand
  1603. corner, and required you to erase all mistakes by backspacing, it
  1604. wouldn't be a very useful program.  Luckily, this isn't the case, as
  1605. you can start typing anywhere on the page by moving the position of the
  1606. cursor to the desired location.  In addition, there are many other times
  1607. when you'll want to move the cursor--when inserting, deleting,
  1608. relocating text, and reformatting paragraphs--to name a few.
  1609.  
  1610.      In Surefire the cursor keys (arrow keys, Home, End, Page up and
  1611. Page down) change your typing position, while the Spacebar, Tab, Enter
  1612. and Backspace keys actually modify the text when pressed.  For example,
  1613. typing (Spacebar) will give you a blank character, while pressing (Right
  1614. arrow) will move the cursor over one position on the screen without
  1615. changing the text in any way.  Pressing (Backspace) will erase a
  1616. character, while pressing (Left arrow) will move the cursor over one
  1617. space.  Likewise, typing (Enter) will put the cursor at the beginning of
  1618. the next line, but pressing (Down arrow) will move the cursor down one
  1619. line while keeping the left-right orientation of the cursor the same.
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.             Surefire User's Guide         Page 26
  1629.  
  1630.  
  1631.      In this chapter we are concentrating on the basics of typing a
  1632. simple document, so our discussion is limited to only what you need to
  1633. know for making small changes while entering text.  When you start doing
  1634. major revisions in the next chapter, you'll encounter a complete
  1635. presentation of the cursor keys in action.
  1636.  
  1637. Entering Text
  1638.  
  1639.      One difference between entering text into a word processor and
  1640. typing on a typewriter is that a word processor makes pressing (Enter)
  1641. at the end of every line optional.  The choice is based on whether you
  1642. are typing while using automatic Word Wrap.
  1643.  
  1644.      Surefire's Word Wrap determines what happens when you reach the end
  1645. of the line while typing text.  When Word Wrap is off, you will find
  1646. that Surefire operates like a typewriter because it will not let you
  1647. type characters beyond the right margin.  To continue typing, you can
  1648. either press the (Enter) key or reposition the cursor using the arrow
  1649. keys.  In contrast, if you reach the end of the line when Word Wrap is
  1650. on, you will be able to continue typing since the cursor automatically
  1651. moves to the beginning of the next line.  When in Insert mode, the word
  1652. you are currently typing will also automatically jump down to the
  1653. beginning of the next line along with the cursor.  This means that if
  1654. there is not enough room on the end of the line for a complete word to
  1655. fit, Surefire will automatically move the last whole word you type to
  1656. the beginning of the next line without you having to press (Enter).
  1657.  
  1658.      When entering text using Typeover mode while Word Wrap is on, only
  1659. the cursor moves to the next line.  For example, if you are entering a
  1660. table where the last column is aligned flush right, you can start
  1661. entering the next row without pressing (Enter).  This is done by typing
  1662. text or pressing the (Tab) key until the cursor automatically moves to
  1663. the first character of the next line.
  1664.  
  1665.      As you can see, Word Wrap is a convenient feature.  You no longer
  1666. need to press the (Enter) key in anticipation that the word you are
  1667. about to type will not fit on the line.  With Word Wrap, your typing
  1668. speed and concentration are greatly improved as you don't have to be
  1669. constantly watching the screen to see where to type (Enter).
  1670.  
  1671.      Although Word Wrap makes typing paragraphs much easier, there are
  1672. still many tasks for which Word Wrap is not suitable.  Tables,
  1673. letterheads, diagrams, charts, and forms are some examples of documents
  1674. best done without Word Wrap.  This is why Surefire gives you both modes.
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.             Surefire User's Guide         Page 27
  1694.  
  1695.  
  1696. "Wrapped" and "Unwrapped" Paragraphs
  1697.  
  1698.      Whether you want to use Word Wrap while typing text or not, each
  1699. paragraph you enter will be either "wrapped" or "unwrapped".  In a
  1700. "wrapped" paragraph, all the words are arranged to completely fill up
  1701. each line.  A line that is "unwrapped" has extra space on the right that
  1702. could be "filled-in" with words "wrapped up" from the lines below it.
  1703. In addition, entering or editing text in Insert mode with Word Wrap on
  1704. automatically results in "wrapped" paragraphs.
  1705.  
  1706.      Sometimes you may want to "wrap" together "unwrapped" text.  To
  1707. force an "unwrapped" paragraph to become "wrapped", move the cursor to
  1708. the end of the first line of the paragraph, press (ALT+W) until a 'W' is
  1709. displayed in the status line to turn Wrap on, and then press (Delete).
  1710.  
  1711.      In Surefire, a paragraph is separated from the next paragraph by a
  1712. blank line or a line that is indented at least one character from the
  1713. left margin.  An indented line also indicates the start of another
  1714. paragraph.  When you force an "unwrapped" paragraph to "wrap", the
  1715. paragraph is reformatted up to the start of the next paragraph.
  1716.  
  1717. Typeover and Insert modes
  1718.  
  1719.      Surefire gives you two modes for editing text, Typeover and Insert.
  1720. As a general rule of thumb, Typeover mode is better suited for replacing
  1721. text that is already there with something else. Insert mode is more
  1722. appropriate for adding text to a line while retaining the text that is
  1723. already on the line.
  1724.  
  1725.    Using Typeover Mode
  1726.  
  1727.      Whenever you type text in Typeover mode, all old characters vanish
  1728. as you type new ones on top of them.  Therefore, you can type directly
  1729. on top of text, without having to worry about removing the characters
  1730. underneath.  This makes editing some documents such as forms and tables
  1731. easy and convenient.
  1732.  
  1733.      There are times when you will want to type on top of a larger
  1734. section of "wrapped" text.  The best way is to remove the unwanted
  1735. section of text and then insert the new text in Insert mode with Word
  1736. Wrap on.  You will learn how to edit text this way in "Chapter 5:
  1737. Revising a Document".
  1738.  
  1739.    Using Insert Mode
  1740.  
  1741.      Correcting missing letters, spaces, words, or punctuation marks is
  1742. simple in Insert mode: you merely position the cursor one character to
  1743. the right of where you need to add text, and type the new text.  As you
  1744. type, the letters to the right are moved further to the right, to make
  1745. room for the text  you insert.  Because of this, Insert mode is more
  1746. suitable for "wrapped" text, but it will also work for "unwrapped" text
  1747. if the amount of text is small. What happens at the end of the line
  1748. depends on whether you are inserting while using Word Wrap mode or not.
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.             Surefire User's Guide         Page 28
  1759.  
  1760.  
  1761.      Word Wrap together with Insert mode allows for quick paragraph
  1762. entry, while Typeover mode is best for typing forms, charts and tables.
  1763. Keep in mind, that you can have both "wrapped" and "unwrapped" text in
  1764. the same document, as in the example of a report with a "unwrapped"
  1765. chart inserted between "wrapped" paragraphs.  Depending on the kind of
  1766. task you are doing in Surefire, you may want to stick to one mode, or
  1767. use a combination.
  1768.  
  1769. Deleting Characters
  1770.  
  1771.      It often happens that while typing a phrase, you think of a better
  1772. phrase to use instead.  Perhaps the first phrase is a little wordy or
  1773. confusing, seems inappropriate at the time, or doesn't express your
  1774. point directly enough.  For times like these when you are deleting small
  1775. amounts of text, you can use the (Backspace) and (Delete) keys or
  1776. typeover text in Typeover mode.  When you want to remove larger areas,
  1777. you will need to use the other methods discussed in "Chapter 7:
  1778. Clipboard Editing".
  1779.  
  1780.      Whenever you want to remove text to the left of the cursor, use the
  1781.      (Backspace) key.
  1782.  
  1783.      Whenever you want to remove text at the cursor, use (Delete).
  1784.  
  1785.      Keep in mind that deleting text gives you different results
  1786. depending on whether you are working with Word Wrap or not.  In Word
  1787. Wrap mode, the words from the next line will move up to fill in the gap
  1788. left by the deleted text.  Otherwise, they will not.  In addition,
  1789. because Insert and Typeover modes only control how text is added to a
  1790. document, (Backspace) and (Delete), work the same way whether you are in
  1791. Insert or Typeover editing modes.
  1792.  
  1793. Exiting Surefire
  1794.  
  1795.      To exit Surefire, press (ALT+X).  When you exit you may see the
  1796. following message:
  1797.  
  1798.      "Changes made to the current document not saved, Go ahead anyway?"
  1799.  
  1800.      If you see the above message, it is a reminder that you've changed
  1801. your document since you last saved it, and those changes will be lost
  1802. unless you deliberately save them.  To save your changes before
  1803. quitting, use (Esc) to close the message window, bring up the Save
  1804. window by pressing (ALT+F) (S).  When you see the Save window appear,
  1805. press (Ctrl+Enter) to close the window and save the file.  If you want
  1806. your changes saved in a different file to keep them separate from the
  1807. previous version, type a new filename in the "Name:" text entry field
  1808. before closing the Save window.
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.             Surefire User's Guide         Page 29
  1824.  
  1825.  
  1826. Chapter 5      -    REVISING A DOCUMENT
  1827.  
  1828.      Now that you can use Surefire to type, insert and delete small
  1829. amounts of text, you are ready to take advantage of Surefire's more
  1830. sophisticated editing functions.
  1831.  
  1832.      If you examine the path you follow when you edit a document, you
  1833. will discover that there's a well-defined process.  The steps are
  1834. remarkably simple, but often look complex when you are doing them,
  1835. simply because you are in the middle of doing detailed work.  This
  1836. chapter will lead you through the basic steps of revising a document.
  1837.  
  1838.      Revising a document is how you'll spend many of your word
  1839. processing hours.  When effectively used, you'll find the editing
  1840. techniques discussed in this chapter will liberate you from much of the
  1841. drudgery of rewriting and free you to focus your mind--not on all of the
  1842. technical details of grinding out words--but on the crucial, exacting
  1843. process of effective communication.
  1844.  
  1845.  
  1846. Opening a Document
  1847.  
  1848.      The first step of revising a document is opening the version you
  1849. wish to edit.  But before you can do this, you'll must locate the file.
  1850. If the document is in a different directory than your current directory,
  1851. you'll first use the Setup window to change the current directory.
  1852.  
  1853.      1. Press (ALT+F) (E) to bring display the Setup window. Press (End)
  1854.      to move it to the "Directory:" entry field. Together, the "Drive:"
  1855.      and "Directory:" fields show your current "path".  A path is the
  1856.      directions Surefire uses for locating document files.  Initially,
  1857.      Surefire is looking in its home directory.  Type the name of the
  1858.      appropriate directory here and press (Ctrl+Enter) to close the
  1859.      window and accept the new path.
  1860.  
  1861.      2. Press (ALT+F) (G) to display the Get window. To display a list
  1862.      of all of the files in the current directory, press (ALT+Z).  Use
  1863.      the arrow keys to scroll the list until the cursor is positioned on
  1864.      the right document.  Press (Enter) and then (Ctrl+Enter) to close
  1865.      the "Get" window and load the document into Surefire.
  1866.  
  1867.      You should develop some kind of organizational system to manage all
  1868. of your files.  For example, you may want to group all of your letters
  1869. in one subdirectory, sales documents in  another, and proposals in a
  1870. third.  It doesn't really matter what system you use as long as you can
  1871. quickly locate the file you need.  For more information on organizing
  1872. files, see "Chapter 24: More About Surefire Documents" found later in
  1873. the manual.
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.             Surefire User's Guide         Page 30
  1889.  
  1890.  
  1891. Printing a Document
  1892.  
  1893.      Now that you've opened your document, you're ready to see what it
  1894. looks like on paper.  However, before you can print, you'll need to make
  1895. sure that your printer is ready, and Surefire knows the kind of printer
  1896. you have and what port it is connected to.
  1897.  
  1898.    Preparation
  1899.  
  1900.      Before you print your first document in Surefire, you'll need to
  1901. take these preliminary steps.  Unless you change printers or have an
  1902. unusual print job, you'll never need to do these steps again.
  1903.  
  1904.      1.  Check your hardware. Make sure that your printer is properly
  1905.      connected to your PC, has paper loaded, is plugged in, and is
  1906.      turned on.  For additional information on printer setup, see
  1907.      "Chapter 2: Getting Started" and "Chapter 23: More About Printing".
  1908.  
  1909.      2.  Press (ALT+F) (E) to display the Setup window.
  1910.  
  1911.      3.  Move the cursor to the "Printer is" multiple choice button by
  1912.      pressing the (End) key twice.
  1913.  
  1914.      4.  Check the printer name. If your printer is different than the
  1915.      one displayed, continue to step 5.  If your printer is the same
  1916.      continue to step 6.
  1917.  
  1918.      5.  Choose a printer. Zoom the button to see a list of supported
  1919.      printers by pressing (ALT+Z).  Use the (up and down arrow) keys to
  1920.      move the cursor in the list.  When the cursor lands on the name of
  1921.      your printer, press (Enter). If you don't see the name of your
  1922.      printer listed, choose the name of a printer that is compatible
  1923.      with your printer.  You may need to refer to "Chapter 23: More
  1924.      About Printing" to choose the appropriate printer.
  1925.  
  1926.      6.  Choose a port. When you connected the printer to your PC, you
  1927.      did so via a printer cable.  The printer port is the place on the
  1928.      back of the PC that is connected to the cable.  Printer ports come
  1929.      in two varieties:  parallel and serial.  The type you use depends
  1930.      on whether you have a parallel or serial printer.  For printing to
  1931.      work correctly, your printer and PC port must match, as a parallel
  1932.      printer will only work when plugged into a PC parallel port and a
  1933.      serial printer will only work with the associated PC serial port.
  1934.      If your printer can operate in either serial or parallel mode, you
  1935.      must tell your printer in some fashion which kind of port it is on
  1936.      the other end of the cable.  Read your printer manual for this.
  1937.  
  1938.      If you know what port your printer is connected to, and it isn't
  1939.      the one displayed, bring up the list of possibilities by pressing
  1940.      (ALT+Z).   Choose one of the ports in the list by using the (up and
  1941.      down arrow) keys to change the position of the cursor in the list.
  1942.      Press (Enter) to make your selection.  If you don't know what port
  1943.      your printer is connected to, read the information in "Chapter 2:
  1944.      Getting Started" about hardware connections before continuing.
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.             Surefire User's Guide         Page 31
  1954.  
  1955.  
  1956.      7.  Save the Setup configuration. Move the cursor to the "SAVE"
  1957.      action button by pressing (End).  Press (Enter).  This will close
  1958.      the Setup window and save your printer selections.  Unless you
  1959.      change printers or ports, you will not have to prepare Surefire for
  1960.      printing again before printing.
  1961.  
  1962.    Printing
  1963.  
  1964.      Whenever you print, there are some considerations that you should
  1965. keep in mind.  What paper size you are using?  What size characters do
  1966. you want to print?  How much space do you want for the margins?  How
  1967. long do you want to wait for it to print?  How many copies?  Which page
  1968. do you want to start with?
  1969.  
  1970.      To make this easier, you should experiment with the default printer
  1971. settings and formatting.  If you don't like how the printout looks, you
  1972. can adjust the settings to suit your own preferences.  For information
  1973. on customizing Surefire's formatting and printing settings, read
  1974. "Chapter 9: Page Layout".
  1975.  
  1976.      Follow these basic steps to print a document:
  1977.  
  1978.      1.  Press (ALT+F) (P) to display the Print window.
  1979.  
  1980.      2.  Start printing. Normally the cursor is found on the "PRINT"
  1981.      action button when the window first comes up.  Press (Enter) to
  1982.      begin printing.  If the cursor is found somewhere else, press (End)
  1983.      or (Home) until the cursor is over "PRINT".
  1984.  
  1985.      3.  Notice the Print Message. If you are prepared to print, you
  1986.      should see the Print Message.  It indicates that Surefire is
  1987.      sending information to the printer.
  1988.  
  1989.      4.  Notice that Surefire changes pages while printing. As the
  1990.      document prints, Surefire displays the page that is currently being
  1991.      sent to the printer.  When all of the pages have been sent, the
  1992.      message disappears, and you see the last page of the document.
  1993.  
  1994.      5.  Not Printing? If you see the Print Message, but nothing happens
  1995.      even after waiting awhile, check the following: Your printer is not
  1996.      configured correctly, you have selected the wrong printer or port
  1997.      in the Setup window, or the cable is not connected correctly.
  1998.  
  1999.  
  2000. Scrolling
  2001.  
  2002.      Whenever you revise a document, you usually start by scribbling
  2003. corrections and comments in the margins of the paper copy.  After you've
  2004. decided which redundant sentence to omit, what word is too formal, and
  2005. what paragraph is to be moved, the next step is usually scrolling
  2006. through the text on the screen to locate the sections that need
  2007. modification.
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.             Surefire User's Guide         Page 32
  2019.  
  2020.  
  2021.      To make locating text easier, you might find it helpful to mark the
  2022. sections on the printed copy with a highlight marker so you can quickly
  2023. glance at them while scrolling.  Furthermore, if you are going to spend
  2024. a lot of hours word processing, we recommend you use some kind of stand
  2025. to hold your printed copy upright next to your computer screen.  This
  2026. saves time and prevents neck strain because you don't have to take your
  2027. eyes off of the screen to look down.  Attach a spring clip or clothes
  2028. pin to the top of a clear plastic recipe book stand for a cheap and very
  2029. effective copy holder.
  2030.  
  2031.      But what if your printer is like the Diablo 630 and takes four
  2032. minutes to print a page, and you don't have time to wait that long after
  2033. each revision?  People with slower printers find it faster to review and
  2034. revise their document at the same time in Surefire--scrolling and
  2035. editing as they go.  However, keep in mind that for many people,
  2036. proofreading on the screen isn't as effective as proofreading a paper
  2037. copy.  When you can only view a third of the page at a time, it is easy
  2038. to get a distorted perspective of your document because it is difficult
  2039. to imagine what it reads like as a whole.  In addition, for most people
  2040. computer screens are harder to read and looking at them for hours at a
  2041. time is a strain on their eyes.  Therefore, if you want a refreshing
  2042. vacation from looking at pixels, work with printed copies--but only if
  2043. you have time to wait for the printer.
  2044.  
  2045.    Scrolling by Lines, Screens and Pages
  2046.  
  2047.      In the last chapter, you learned to move the cursor up and down the
  2048. page one line at a time--an appropriate amount for entering text into a
  2049. document.  However, when you start editing a document, learning how to
  2050. move around in much larger units is essential.  In this section you will
  2051. learn to move quickly from one part of the document to another so that
  2052. you can easily locate the sections you want to edit.
  2053.  
  2054.      Think of your document as one long piece of electronic paper that
  2055. stretches from one end to the other--something like the paper tape in an
  2056. adding machine.  Because your monitor will only display 25 lines, you
  2057. can only view about a third of a page at a time.  When you scroll, you
  2058. view a different "screen", either above or below the last one viewed.
  2059. As you advance (or back up) in the document by viewing sequential pieces
  2060. of text, the "electronic paper" will seem to wind or unwind across your
  2061. display.
  2062.  
  2063.      You can scroll by three amounts:  lines, screens and pages.  The
  2064. size you use depends on how far what you want to see is from where you
  2065. are, and how fast you want to get there.  If you advance (scrolling
  2066. forward) by lines by pressing the (down arrow) key, "new" lines will
  2067. constantly be appearing on the bottom of the screen, and "old" ones will
  2068. be disappearing off of the top.  Likewise, scrolling backwards with the
  2069. (up arrow) key reverses the movement, displaying "new" lines on the top,
  2070. and moving the rest down to compensate.
  2071.  
  2072.      When you scroll by screens and pages, you move more quickly from
  2073. one part of the document to another.  Once you are familiar with the
  2074. document, you can recognize where you are by reading snippets as they
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.             Surefire User's Guide         Page 33
  2084.  
  2085.  
  2086. move past.  You need to stop only when you feel you are close to the
  2087. place you're looking for.  Then you can scroll at a slower pace, and in
  2088. smaller chunks.
  2089.  
  2090.      Scrolling to the next "screen" (23 or 24 lines of the electronic
  2091. paper) is done by pressing (Page Down).  Pressing (Page Up) will display
  2092. the previous "screen".  Whenever you press (Ctrl+Page Down), you display
  2093. the first "screen" or first part of the next page.  Likewise, (Ctrl+Page
  2094. Up) displays the first "screen" on the previous page.
  2095.  
  2096.      In addition to using (up arrow), (Page Up) and (Ctrl+Page Up) to
  2097. scroll backward, and (down arrow), (Page Down) and (Ctrl+Page Down) to
  2098. scroll forward, you can also scroll to the beginning or end of the
  2099. document by pressing (Ctrl+Home) or (Ctrl+End) respectively.
  2100.  
  2101.  
  2102. Two Faces of Editing
  2103.  
  2104.      For those occasions when you are revising a document, you will find
  2105. the "scroll and change" style of editing to be the most efficient way to
  2106. get the job done.  Likewise, whenever you are reorganizing, you will
  2107. find "cut and paste" editing a real time saver.
  2108.  
  2109.      Since the focus of this chapter is using the "scroll and change"
  2110. method of revising text, we are going to leave the exciting world of
  2111. "cut and paste" to another chapter--"Chapter 7:  Clipboard Editing".  If
  2112. at this point in time, you are more interested in learning about "cut
  2113. and paste" editing, feel free to skip ahead, as you do not need to read
  2114. the rest of this chapter before you can learn to do clipboard editing.
  2115.  
  2116. "Scroll and Change" Editing
  2117.  
  2118.      Whenever you scroll through a document--reading and revising as you
  2119. go--you make changes by adding or removing text.  If you  read the last
  2120. chapter, "Chapter 4:  Typing Text", then you already know the basics of
  2121. moving the cursor around the screen and inserting, backspacing or
  2122. deleting.  However, if Surefire limited you to doing only what was
  2123. discussed in that chapter, revising documents would be painfully slow.
  2124. Luckily, there are several key commands that really speed things up, and
  2125. these are discussed below.
  2126.  
  2127.    Moving the Cursor on the Screen
  2128.  
  2129.      Once you've located the screen you want to view, and you spot a
  2130. sentence you want to change, you'll need to move the cursor into
  2131. position before you can make any changes.  As discussed in the last
  2132. chapter, "Chapter 4: Typing Text", you move the cursor into position by
  2133. pressing the cursor keys.
  2134.  
  2135.      For a summary of all of Surefire's cursor movement commands, survey
  2136. the table on the next page:
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.             Surefire User's Guide         Page 34
  2148.  
  2149.  
  2150.           To Move                       Press
  2151.  
  2152.           Left one character            Left arrow
  2153.           Right one character           Right arrow
  2154.           Up one line                   Up arrow
  2155.           Down one line                 Down arrow
  2156.           Left one word                 Ctrl + Left
  2157.           Right one word                Ctrl + Right
  2158.           Start of text on the line     Home
  2159.           End of text on the line       End
  2160.           Left margin                   Ctrl + (L)
  2161.           Right margin                  Ctrl + (R)
  2162.           Scroll backwards one screen   Page Up
  2163.           Scroll forwards one screen    Page Down
  2164.           Scroll backwards one page     Ctrl + Page Up
  2165.           Scroll backwards on page      Ctrl + Page Down
  2166.           Go to beginning of document   Ctrl + Home
  2167.           Go to the end of document     Ctrl + End
  2168.  
  2169.  
  2170.    Changing Text
  2171.  
  2172.      Once you've located the text that you want to change, and have
  2173. moved the cursor into position, the next step is to remove the old and
  2174. replace it with the new.  Of course, in the cases where you are only
  2175. adding text--tacking on a sentence at the end of a paragraph, adding an
  2176. omitted word or phrase, adding a blank line to break a long paragraph
  2177. into two paragraphs--you will not need to remove text.  Simply, type the
  2178. addition, inserting it in front of the cursor.
  2179.  
  2180.      Keep in mind that the methods Surefire affords for adding and
  2181. removing text, vary depending on whether you are editing using Insert or
  2182. Typeover mode and whether Word Wrap is on or off.
  2183.  
  2184.    Removing Text
  2185.  
  2186.      In the last chapter, you saw that the (Backspace) and (Delete) keys
  2187. are used to remove text one character at a time.
  2188.  
  2189.      Surefire also offers several methods for removing text in addition
  2190. to (Backspace) and (Delete).  To delete the word under the cursor, you
  2191. press (Ctrl+Backspace); to remove all the text on the line the cursor is
  2192. currently on, you press (Ctrl+D); and to delete all the characters from
  2193. the cursor to the end of the line, you press (Ctrl+E).
  2194.  
  2195.      As you might expect, when text is removed while Insert mode is on,
  2196. the space that is left is "closed up".  Therefore, whenever you delete
  2197. words or characters you will notice that any text to the right of the
  2198. cursor moves over to fill the gap.  If Word Wrap is also on, words from
  2199. the lines below may also "wrap up", preserving "wrapped" paragraph
  2200. formatting.  Likewise, when a line is deleted, all lines below it are
  2201. moved up to fill in.  This happens in any mode.
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.             Surefire User's Guide         Page 35
  2213.  
  2214.  
  2215.    Adding Text
  2216.  
  2217.      As discussed in the last chapter, the methods you choose to use for
  2218. adding text may depend on whether text on the page is "wrapped" or not.
  2219. When inserting text using Insert mode, you simply position the cursor
  2220. one character to the right of where you want to insert text, and start
  2221. typing.  Surefire will automatically make room for each character as you
  2222. type and rearrange the text to accommodate the addition while there is
  2223. still room on the line.  When Word Wrap is on, Surefire will also move
  2224. words down to subsequent lines if necessary.
  2225.  
  2226.      You can add text in Typeover mode by either typing over blank areas
  2227. or by replacing text that is already there.  Keep in mind that Surefire
  2228. never does any "automatic adjustments" for you in Typeover mode.
  2229.  
  2230.    Adding and Deleting Lines
  2231.  
  2232.      In addition to removing text, the (Delete) key can also be used to
  2233. remove blank lines and join lines and paragraphs together.  To remove
  2234. blank lines you move the cursor to the beginning of the line, and press
  2235. (Delete).  To join two lines, you must be in Word Wrap mode.  You move
  2236. the cursor to the end of the first line and then press (Delete).  The
  2237. text on the next line will "wrap up".
  2238.  
  2239.      While (Delete) can be used to join two lines together, (Enter) can
  2240. be used to break lines apart.  Here, you simply position the cursor
  2241. where you want the line to break and press (Enter).  All of the text to
  2242. the right of where you pressed (Enter) will be moved to the beginning of
  2243. the next line.  Use the same technique to "open" a line by positioning
  2244. it on the first character of the line before pressing (Enter).
  2245.  
  2246.      You can insert a blank line between the current line and the one
  2247. above the cursor by pressing (Ctrl+O).  This is a convenient way to put
  2248. a blank line between two lines of text, and unlike opening a line with
  2249. (Enter) it works in any mode.
  2250.  
  2251.  
  2252. Good Editing Practices
  2253.  
  2254.      You will repeat the basic revision process you've encountered in
  2255. this chapter many times to polish an important document.  Once again,
  2256. reading through the hard-copy version of the document after each
  2257. revision is essential.  It's just too easy to miss things on the screen
  2258. that absolutely yell at you from the printed page.
  2259.  
  2260.      In the next chapter, you will learn faster techniques for moving
  2261. around in the document than scrolling screen-by-screen.  Specifically,
  2262. you will learn how to use the "Goto", "Find" and "Search and Replaces"
  2263. commands.
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.             Surefire User's Guide         Page 36
  2278.  
  2279.  
  2280. Chapter 6      -    LOCATING TEXT
  2281.  
  2282.      There are two ways to locate text in a document.  One you now know
  2283. well--the laborious method of going to the beginning of the document and
  2284. scrolling down page-by-page until you find the right spot.  An easier
  2285. alternative is using a combination of Surefire's "Goto", "Find" and
  2286. "Find and Replace" operations to quickly move around in a document.
  2287.  
  2288.      This chapter is designed to help you learn how to utilize these
  2289. operations to move through the document and edit text in the fastest and
  2290. most efficient ways.  In the first few sections we will explain how to
  2291. use each feature.  Later, we will illustrate ways to use the operations
  2292. to create "Bookmarks", and correct spelling mistakes and punctuation
  2293. errors.
  2294.  
  2295. Finding Text
  2296.  
  2297.      Sometimes you know that a paragraph or sentence needs to be
  2298. changed, but you don't know exactly where in the document it is.  If you
  2299. can remember some unique words that are found only in that sentence or
  2300. paragraph, you can quickly locate it with Surefire's Find operations.
  2301. Find searches from the cursor to the end of the document.  Therefore, to
  2302. search the whole document, you will need to start at the beginning.
  2303.  
  2304.      Find is good for locating all of the times you discuss a point,
  2305. refer to a person, mention a date, time or price.  To use Find, follow
  2306. these steps:
  2307.  
  2308.      1. Press (Ctrl+Home) to go to the beginning of the document.
  2309.  
  2310.      2. Press (ALT+T) or select "Find..." from the Page menu.
  2311.  
  2312.      3. Type your text. The Find window will appear with the cursor
  2313.      already in the "Search for:" data entry field so you don't have to
  2314.      move it into position before typing.
  2315.  
  2316.      4. Choose NEXT. This will start Surefire searching for all
  2317.      occurrences of your text.
  2318.  
  2319.      After you have found the word, Surefire stores it away, and you can
  2320. "replay" the search with either (Ctrl+P) to look backwards, or (Ctrl+N)
  2321. to look forwards.  This makes Find fast and efficient. When there are no
  2322. more matches of your text in the document, a message will be displayed.
  2323.  
  2324.    Finding Capitalized and Whole Words
  2325.  
  2326.      If your word is 'product', by default Surefire will find both
  2327. "product" and "products".  Unless you specify that you want Surefire to
  2328. search for "whole" words, it will find any occurrence of the target text
  2329. whether or not it is embedded in longer words.
  2330.  
  2331.      To find only those occurrences that are distinct words, you "press"
  2332. the "Part Word/Full Word" button in the Find window.  To "press" the
  2333. button, use the (Home) key to move the cursor to "Part Word".  Press
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.             Surefire User's Guide         Page 37
  2343.  
  2344.  
  2345. (Spacebar).  This will change "Part Word" to "Full Word".  Now choose
  2346. NEXT or PREVIOUS to do your search.
  2347.  
  2348.      In addition to limiting Find to looking for whole words, you can
  2349. ask it to find occurrences of text with the specified arrangement of
  2350. uppercase or lowercase letters.  For example, in our "announce"
  2351. document, "Boxes" is used differently than "boxes".  In this document,
  2352. "Boxes" is always part of the company name, while "boxes" are what the
  2353. company sells.  You can tell Surefire to be more discriminating by first
  2354. entering the correct case in the "Search for:" text entry field, and
  2355. then "pressing" the "Any Case/Exact Case" button in the same way you did
  2356. the "Part Word/Full Word" button.
  2357.  
  2358.  
  2359. Using Goto
  2360.  
  2361.      While "Find" helps you quickly locate words and phrases, with Goto,
  2362. you can move the cursor to any page in the document or to the beginning
  2363. or end. Depending on where you want to go, this can be faster than Find.
  2364.  
  2365.      For example, the paragraph that you want to change may be near the
  2366. bottom of the document.  Instead of searching for all instances of a
  2367. phrase, it can be faster to go directly to the bottom of the document
  2368. and then scroll backward to the place you need to edit.
  2369.  
  2370.      To use Goto, you start by bringing up the Goto window by either
  2371. choosing "Goto" on the Page menu or pressing (Alt+P) (G).  When the
  2372. window appears on the screen, tell Surefire where you want to go.  If
  2373. you want to jump to a page, type in the number in the "Page Number:"
  2374. text entry field, and then press (Ctrl+Enter).  If you want to jump to
  2375. the beginning or end of the document, press (End) until the cursor lands
  2376. on the "BEGINNING" or "END" action buttons.  Press (Enter).
  2377.  
  2378.      If you chose to jump to a page or the beginning of the document,
  2379. then the cursor will appear in the upper left-hand corner of the typing
  2380. area, whereas if you chose to jump to the end, the cursor will appear in
  2381. the lower left-hand corner of the last page in the document.
  2382.  
  2383.      If you want to bypass bringing up the Goto window when jumping to
  2384. the beginning or end of the document, you can press either (Ctrl+Home)
  2385. or (Ctrl+End).
  2386.  
  2387.  
  2388. Using Replace
  2389.  
  2390.      While Find locates text for you, Replace gives you the ability to
  2391. track down a target word or phrase, and substitute something else for it
  2392. or even delete it by replacing it with nothing at all.  You access the
  2393. Replace window from the Page menu or use the shortcut, (ALT+R).  After
  2394. Surefire is done locating all of the occurrences of text it is looking
  2395. for, and has either replaced them or skipped over them, it will tell you
  2396. how many replacements it made and inform you that the replacement
  2397. operation is completed.
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.             Surefire User's Guide         Page 38
  2408.  
  2409.  
  2410.      Like Find, Replace locates a specified group of characters that you
  2411. enter in the "Search For:" field.  When specifying what to search for,
  2412. you can also direct Replace to find only the text that matches the
  2413. combination of upper and lowercase text you typed, or find whole or
  2414. partial words.  However, instead of parking the cursor at the beginning
  2415. of the located text, Replace lets you substitute it with whatever you
  2416. entered in the "Replace With:" text entry field in the Replace window.
  2417. In addition, you can choose to either verify each replacement or have
  2418. Replace make the substitution throughout the entire document.
  2419.  
  2420.      Replace differs from Find in that it can only search forward (there
  2421. is no equivalent to "PREVIOUS").  If you want to locate all occurrences
  2422. of the text, you must start at the beginning of the document.
  2423.  
  2424.      One of the biggest advantages of Surefire's Replace operation is
  2425. that you can have it verify changes before it makes them by choosing
  2426. "ASK & REPLACE". After you close the Replace window, Surefire will
  2427. locate the first occurrence of your text and select it on the screen. 
  2428. In addition, the "Ask & Replace" window will appear.  On the left-hand
  2429. side it shows you what it found and what you specified as the
  2430. replacement. Press (End) to move the cursor to the "REPLACE" action
  2431. button Press (Enter).  This will make the substitution on the screen.
  2432.  
  2433.      "ASK & REPLACE" is necessary when searching for and replacing words
  2434. that could be imbedded in other words.  There are times when it is
  2435. disadvantageous to search for whole words because you may want to
  2436. replace some imbedded occurrences and not others.  For example, suppose
  2437. you were substituting all occurrences of "cash" with "dollars", and for
  2438. some reason didn't want to set the Replace window "Part Word/Full Word"
  2439. logical choice button to "Full Word".  When looking for partial words,
  2440. Surefire would also find "cash" in "cashier".
  2441.  
  2442.      If instead of using "ASK & REPLACE", you chose to use "REPLACE
  2443. ALL", Surefire would have found each instance of "cash" and substituted
  2444. in "dollars" for it.  Therefore, "cashier" would become "dollarsier".
  2445. To prevent problems like these, Surefire lets you choose to replace a
  2446. word or skip over it in the "Ask & Replace" window.
  2447.  
  2448.      Now that you understand the general uses of Replace, Goto and Find,
  2449. you're ready to see how they are used in specific situations.  The
  2450. remaining half of this chapter concentrates on practical uses of these
  2451. operations such as creating Bookmarks, correcting spelling errors, and
  2452. changing punctuation errors.
  2453.  
  2454.  
  2455. Locating Text Using Bookmarks
  2456.  
  2457.      When revising documents, you'll often find yourself going on
  2458. several editing tangents.  For example, while you're editing a section
  2459. on marketing strategies, you may start thinking about customer
  2460. preferences.  If customer preferences are  discussed in another section,
  2461. this often means jumping to that section, typing in your thoughts before
  2462. you forget them, and then jumping back again to marketing strategies.
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.             Surefire User's Guide         Page 39
  2472.  
  2473.  
  2474.      Like paper bookmarks, creating "Bookmarks" in Surefire allows you
  2475. to move quickly to another place in the document without loosing your
  2476. place.  Incidentally, using Bookmarks is not a technique unique to
  2477. Surefire.  It is often found as a built-in feature offered by many
  2478. high-priced, dedicated, word processors.  But, when you use the basic
  2479. Find operation, you can get the same results in an integrated program
  2480. like Surefire.
  2481.  
  2482.      To create a bookmark, all you need to do is to type a unique string
  2483. of characters (such as "**") on a blank line near the text you are
  2484. currently editing.  Then, search either backwards or forwards for a word
  2485. or short phrase you know is found near some other place you want to
  2486. locate.  When the Find operation locates the target spot, simply type
  2487. the same characters as you used for the other Bookmark on a blank line
  2488. nearby.  Now you can zip back and forth between the two Bookmarks by
  2489. searching forwards or backwards for the unique string.  When you're done
  2490. using the Bookmark, "search and destroy" it using Replace.
  2491.  
  2492.      The mechanics of using Bookmarks are easy and intuitive.  To search
  2493. for your Bookmark in Surefire, simply press (ALT+T) to bring up the Find
  2494. window.  In the "Search for:" text entry field type your bookmark
  2495. string.  Then press (End) either once or twice to position the cursor on
  2496. "NEXT" or "PREVIOUS" depending on whether you want to search to the end
  2497. of the document or back to the beginning.  As you learned earlier in
  2498. this chapter, the next time you want to search for the Bookmark, you can
  2499. do so without bringing up the Find window.  You simply press either
  2500. (Ctrl+N) to find the next Bookmark, or (Ctrl+P) to find the previous
  2501. one.
  2502.  
  2503.      When you want to remove Bookmarks so that they're not printed in a
  2504. final draft, you eliminate them by using Replace.  To do this, bring up
  2505. the Replace window by pressing (ALT+R).  In the "Search for:" text entry
  2506. field, type the unique string identifying the Bookmark.  Then, press
  2507. (End) to move to the REPLACE ALL action button (the "Replace With:"
  2508. field will be left blank).  Press (Enter) to close the window, and
  2509. Surefire will remove the Bookmarks.
  2510.  
  2511.      If you find using Bookmarks to be well suited to the way you think,
  2512. you may want to develop a Bookmarking system.  To move among several
  2513. locations in the text, you can develop a numbering system for the
  2514. Bookmarks.  For example, if you find "**" exceptionally appealing, you
  2515. base a system on it such as "**1", **2, **3, or "**", "***", "****".
  2516.  
  2517.      For really complex documents, you may want to use a variety of
  2518. unique strings for Bookmarks--such as "**", "XX", "%%", and "##"--to
  2519. designate different Bookmarks for different chores.  For example, in a
  2520. report, "**" could mark all of the places where you discuss marketing
  2521. strategies, while "XX" could identify places where you examine consumer
  2522. preferences.  If a system like this is appropriate for the document
  2523. you're writing, be sure to include a list at the beginning of the
  2524. document so that you won't forget what each Bookmark stands for.
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.             Surefire User's Guide         Page 40
  2537.  
  2538.  
  2539. Correcting Spelling Errors Using Replace
  2540.  
  2541.      Luckily, once you've spotted spelling errors, either on the screen
  2542. or on a hard copy, you can easily correct them in Surefire.  For
  2543. example, let's suppose you have misspelled a name.  You'd have Surefire
  2544. automatically search for every occasion you typed "Mr. Gresham" instead
  2545. of "Mr. Gershom", and make the substitution.  Therefore, there's no need
  2546. to bother with locating and correcting spelling errors on-screen.  Once
  2547. you've discovered a misspelled word, Surefire will locate and correct
  2548. all occurrences for you.
  2549.  
  2550.      Remember that Replace locates and corrects all occurrences between
  2551. the cursor and the end of the document.  So to correct the entire
  2552. document, first move the cursor to the beginning of the document by
  2553. pressing (Ctrl+Home).
  2554.  
  2555.      To correct your misspellings, bring up the Replace window from the
  2556. Page menu; type the misspelled word in the "Search for:" text entry
  2557. field; and then type the correctly spelled word in the "Replace with:"
  2558. text entry field.  Use (Home) and (End) to move between the text entry
  2559. fields. When both words are entered, press (End) to move to the "REPLACE
  2560. ALL" action button and then press (Enter).  Surefire will then make the
  2561. substitutions.
  2562.  
  2563.      One method of preventing misspellings of important names and places
  2564. is to keep Replace in mind while you are entering text into a document.
  2565. For example, let's imagine that you're writing a proposal to expand the
  2566. Albuquerque Municipal Water System and Sewage Treatment Facility.
  2567. Instead of typing "Albuquerque" 26 times, you could just type a unique
  2568. sequence of characters such as "AAAA" each time you want to use the
  2569. name.  After the text is entered, use Replace to substitute all AAAA's
  2570. with "Albuquerque".  This way, you only type the name accurately once.
  2571.  
  2572.      In addition to using Replace for correcting spelling errors, it is
  2573. useful for finding and changing many things that are hard to find (or
  2574. don't want to find) by eye by manually scrolling through a document.
  2575. Examples are dollar amounts, dates, times, extra spaces, missing spaces,
  2576. voice (they, we, I, you), pet words, etc.
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.             Surefire User's Guide         Page 41
  2602.  
  2603.  
  2604. Chapter 7      -    CLIPBOARD EDITING
  2605.  
  2606. The Clipboard
  2607.  
  2608.      In Surefire, as in most modern word processors, the Clipboard is
  2609. simply a way to think of a place in memory that stores selected pieces
  2610. of your document.  Like a real clipboard, its function is to hold things
  2611. until they are used elsewhere.  Like many things which are just places
  2612. in memory, you can't see the Clipboard, although you can see the objects
  2613. it stores.  For example, if you Cut a piece of text to the Clipboard,
  2614. the text is removed from its former place in the document and is stored
  2615. in the Clipboard memory exactly as it was displayed on the screen.
  2616. Whenever you Cut or Copy something to the Clipboard, you will see this
  2617. piece highlighted on the screen and displayed as an object.
  2618.  
  2619.      Once a piece of text becomes a Clipboard object, you can place it
  2620. anywhere inside the margins of the document. To do this, you simply
  2621. "paste" it.  Unlike other software programs where you can store only one
  2622. object on the Clipboard at a time, Surefire allows you to store any
  2623. number. This way, if you add a new object, the old one is still around.
  2624. This prevents you from loosing the last thing you Cut, and allows you to
  2625. Cut or Copy multiple objects from the same page where they wait for
  2626. relocation until you're ready to use them on another page or into
  2627. another document.  This aspect of Surefire's word processor makes it
  2628. behave more like a desk-top publishing program than a simple word
  2629. processor.
  2630.  
  2631.      In the following sections, we will describe in detail the mechanics
  2632. of using each Clipboard operation--Block Select, Line Select, Cut, Copy,
  2633. Paste, and Paste & Keep.  We will discuss Delete since it shares the
  2634. same techniques with Clipboard editing operations, even though it
  2635. doesn't use the Clipboard.
  2636.  
  2637. Clipboard Commands
  2638.  
  2639.      In Surefire, the mechanics of "cut-and-paste" editing are easy and
  2640. intuitive:  you first select the piece of text you want to relocate, and
  2641. then choose either Cut or Copy from the Editing menu (ALT+E).  Both Cut
  2642. and Copy replicate the text you selected into a space in the computer's
  2643. memory called the Clipboard.  The replica is called a Clipboard object.
  2644. Cut differs from Copy in that Cut removes the selected text from the
  2645. document when the clipboard replica is made, while Copy leaves the
  2646. selected text where it is.  Delete acts like Cut but it doesn't make a
  2647. replica on the Clipboard.  Instead the text vanishes from the document,
  2648. and can be recovered by using Undelete as discussed in Chapter 5.
  2649.  
  2650.      After you have Cut an object to the Clipboard, you can "paste" it
  2651. back into the document once you've located where in the document you
  2652. want to put it.  To do this, you execute Paste, and Surefire takes the
  2653. replica off of the clipboard and puts it back into the document in the
  2654. new location.  Paste & Keep acts just like Paste except that the
  2655. Clipboard object remains on the Clipboard after pasting.
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.             Surefire User's Guide         Page 42
  2667.  
  2668.  
  2669. Selecting Text
  2670.  
  2671.      Before you can Cut or Copy a piece of text, you'll have to specify
  2672. to Surefire which piece of text to Cut or Copy.  You do this by
  2673. selecting it.  Surefire has two methods of selecting text:  Block Select
  2674. and Line Select.
  2675.  
  2676. Block Select -vs- Line Select
  2677.  
  2678.      You decide whether to use Block Select or Line Select by looking at
  2679. the nature of the text you are selecting.  The general guideline is to
  2680. use Block Select for tables, charts and forms and Line Select for
  2681. sentences and paragraphs.  In addition, the method you choose also
  2682. depends on what you want to happen when the text is pasted at a later
  2683. time.  When you paste Block selected text, it overwrites what is
  2684. underneath it; whereas, when you paste Line selected text, it is
  2685. inserted into the existing text.
  2686.  
  2687.      Just as its name implies, Block Select selects a rectangular area.
  2688. always starting in the upper left-hand corner of the area you want to
  2689. select, and always including the character under the cursor. Block
  2690. select is ideal for manipulating forms and tables.  For example, if you
  2691. wanted to interchange two columns of a table, you would choose to use
  2692. Block select.  The largest block you can select is a page.
  2693.  
  2694.      In contrast, Line Select gives you the ability to select all the
  2695. text between two specified points.  Therefore, you can select any text
  2696. in the document including several words, a phrase, sentences,
  2697. paragraphs, or even several pages.
  2698.  
  2699. Selecting a Region With Block Select
  2700.  
  2701.      Move the cursor to the upper left corner of the block to be
  2702. selected.  Choose Block Select from the Edit menu or press (ALT+B) to
  2703. mark the starting point for the selection.  When the beginning of a
  2704. selection is marked in this fashion, it will become highlighted.
  2705. Using the (down and right arrow) keys, move the cursor to the bottom
  2706. right corner of the area you want selected. As you do this, you will see
  2707. the screen highlight all the text in a rectangle between the starting
  2708. point of the block and the present location of the cursor. When you have
  2709. the desired rectangle highlighted, you have selected the block.
  2710.  
  2711.      When you select a block, Surefire expects you to do something with
  2712. it.  You can cut, copy or delete it. Each of these operations are
  2713. available on the Edit menu. Cut (ALT+F1) removes the Block from its
  2714. present location and puts a replica on a Clipboard.  If you chose to use
  2715. Copy (ALT+F2), it also puts a replica on the Clipboard, but keeps the
  2716. selected area where it is in the document.  Delete (ALT+E) (D)
  2717. obliterates the Block from the document without making a replica.
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.             Surefire User's Guide         Page 43
  2732.  
  2733.  
  2734.      Cut (ALT+F1) is the best choice to move text from one area in the
  2735. document to another.  Once the Block has been Cut, you will see it
  2736. displayed as a Clipboard object on the screen.  The cursor will be
  2737. inside the object, and you will be able to move the object around the
  2738. screen using the arrow keys. To return the cursor to the document, press
  2739. (F6).  This "hides" the Block selected Clipboard object. You will see
  2740. how to Paste a block later in this chapter.
  2741.  
  2742.      Cutting Block selected text will always leave white space behind
  2743. just as if you typed in rows of Spacebar characters in Typeover mode.
  2744. In contrast, cutting Line selected text results in having the text below
  2745. the cut "wrap up" to fill in the hole.
  2746.  
  2747.  
  2748. Selecting Sentences With Line Select
  2749.  
  2750.      To make a line selection, always start in the upper left-hand
  2751. corner of the area you want to select.  The selection includes the
  2752. character under the cursor.  Press (ALT+L) or choose Line Select from
  2753. the Edit menu to mark this character as the starting point for the
  2754. selection.
  2755.  
  2756.      By pressing the (down arrow), (Ctrl + right arrow) and (left arrow)
  2757. keys, move the cursor to the period at the end of a sentence.  As you do
  2758. this, you will see the screen highlight all the text between the
  2759. starting point of the selection and the present location of the cursor.
  2760. When you are at the period, you have selected the sentence.  Keep in
  2761. mind that with Line select, once you have moved the cursor one line
  2762. below the starting point, you can move the cursor either right or left.
  2763.  
  2764.      As with Block select, once you've selected a piece of text,
  2765. Surefire expects a Cut, Copy or Delete command to follow.  So, don't
  2766. choose Delete.  Instead, use Cut or Copy and a Clipboard object will
  2767. appear on the screen.  The cursor will be inside the object, and you
  2768. will be able to move the object around the screen using the arrow keys.
  2769. Return the cursor to the document by pressing (F6).
  2770.  
  2771.      Note:   When using Line select to select short line paragraphs
  2772. (e.g. lists), you must turn Wrap off to preserve the formatting of the
  2773. lists. See "Chapter 9: Page Layout" for more information on paragraphs.
  2774.  
  2775. Return to Normal Operations
  2776.  
  2777.      In addition to having a chance to compare how selecting text using
  2778. Line select differs from selecting rectangular regions with Block
  2779. select, you also learned how to view and hide objects on the screen.
  2780. Surefire requires you to hide objects before you can do normal
  2781. operations in the document such as typing and scrolling.  To do this,
  2782. press (F6).  To view the Clipboard object again, press (F6) again.
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.             Surefire User's Guide         Page 44
  2797.  
  2798.  
  2799. Canceling a Selection
  2800.  
  2801.      Sometimes you may change your mind and want to cancel your
  2802. selection.  Just as with canceling other Surefire operations, you
  2803. simply press (Esc).  In addition, we recommend that you choose to view
  2804. the "Hints" at the bottom of the screen for help with remembering what
  2805. keys to press while doing Clipboard editing, as many of the operations
  2806. are not available from a menu.  To view the "Hints", press (Shift+F10).
  2807.  
  2808. Viewing Clipboard Objects
  2809.  
  2810.      As you saw in the previous section, selected text and rectangular
  2811. regions become Clipboard objects when you Cut or Copy them.  An easy way
  2812. to understand exactly what happens when objects are Cut or Copied to
  2813. Surefire's imaginary Clipboard is to think about a real clipboard.  Lets
  2814. suppose that our real clipboard holds all of the pages of our document.
  2815. On top of the pages, let's pretend that we've overlaid a clear plastic
  2816. sheet--perhaps something made for an overhead projector.
  2817.  
  2818.      Now, imagine that you stuck several yellow notes from a "Post-it"
  2819. pad all over the plastic sheet.  These particular yellow notes have
  2820. clippings of text on them.  Remember that the "Post-it" notes are
  2821. obviously not part of the document text.  You can see this clearly
  2822. because the notes obstruct from view the text underneath them and are a
  2823. different color.  In addition, they can easily be moved around by
  2824. "sticking" and "unsticking" them, while the document text remains fixed
  2825. to the page.
  2826.  
  2827.      Now in our real-world clipboard situation, what do you do if you
  2828. want see a different page underneath the clear plastic sheet?  You
  2829. simply remove the plastic sheet and shuffle the other document pages
  2830. until you see the page you want.  Only after the page you want is in
  2831. view, can you replace the clear plastic sheet to see the notes again.
  2832. To do this, you simply put the plastic sheet back on top of the pile.
  2833.  
  2834.      As you've probably gathered, the behavior of the Surefire Clipboard
  2835. is almost exactly the same as our real one.  The only difference between
  2836. them is that Surefire's Clipboard is only the clear plastic sheet and
  2837. notes.  In Surefire, the document memory is kept separate from the
  2838. Clipboard memory, although they both can be displayed simultaneously on
  2839. the screen.  Remember that Surefire's word processor uses three distinct
  2840. memory spaces: the on-screen copy of the file (document), a delete
  2841. buffer (for undeleting deleted text) and the Clipboard.  Each of these
  2842. are independent of each other, and the only time they interact is when
  2843. you deliberately ask them to do so by using some kind of interactive
  2844. command.  As you continue to use Surefire, this distinction will become
  2845. more and more obvious.
  2846.  
  2847.      When your Clipboard Objects are hidden, you can press (Shift+F6) to
  2848. all of the objects at the same time. You may press (Shift+Tab) to move
  2849. the cursor from one object to the other.  Move the object with the
  2850. cursor around on the screen by pressing the arrow keys.  Press
  2851. (Shift+Tab) again to move the cursor to another object.  Notice that the
  2852. object with the cursor may appear brighter than the others.
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.             Surefire User's Guide         Page 45
  2861.  
  2862.  
  2863.      To hide one object while viewing the others, press (Tab).  This
  2864. will cause the cursor to move between each of the other objects and
  2865. gradually cause all but one of the objects to disappear.  To view and
  2866. return the cursor to the first object, keep pressing (Tab).
  2867.  
  2868.      When you press (F6) to return the cursor to the document, all of
  2869. the Clipboard objects will be hidden once more.
  2870.  
  2871. Copying Text
  2872.  
  2873.      Perhaps the most frequently used Clipboard operation is Copy.
  2874. Whenever you copy a piece of text to another location in Surefire, you
  2875. put a replica of a piece of text on the Clipboard while leaving the
  2876. original where it is in the document.  When you locate the new place you
  2877. want the copied object to go, you either use Paste or Paste & Keep.
  2878.  
  2879.      The most commonly copied text items are long phrases or names that
  2880. are often repeated.  For example, if you are writing a proposal to
  2881. expand a sewage disposal plant, instead of typing "Albuquerque Municipal
  2882. Water System and Sewage Treatment Facility" 26 times, just type it once,
  2883. copy it to the Clipboard, and paste it 25 times!  Therefore, if you find
  2884. yourself repeating any line of text more than a couple of times, rather
  2885. than retype, just select the text using Line select and Copy it.  When
  2886. you find the right spot to insert it, Paste it.
  2887.  
  2888.      In addition, since you can Copy a piece of text, you can compare
  2889. how the block or line reads in its new location compared to the old
  2890. location.  Exercise some caution with this, however. If you copy and
  2891. relocate a larger block of text, it appears in the document in both
  2892. places.  If the original block isn't removed later, it will still be in
  2893. both places, and when reading over the manuscript you may not notice the
  2894. repeated section if the instances are far enough apart.  However, if the
  2895. person reading your document is skimming through it quickly, he may say
  2896. to himself, "Didn't he just say that?".  Therefore, after you compare,
  2897. make sure that you delete one of the copies so that you don't
  2898. inadvertently repeat the same thing twice or more, in exactly the same
  2899. way in different parts of your document.
  2900.  
  2901. Moving Text
  2902.  
  2903.      While copying text is the most common Clipboard operation, moving
  2904. text is the safest.  Because there is always one copy of a paragraph in
  2905. the document, you avoid the "reproducing rabbit" syndrome sometimes
  2906. found in documents where copying is excessive.  With move, you can
  2907. always return your text to its original position if you don't like the
  2908. new lineup.  So choose to move text if you're trying out material in a
  2909. different order.  If it's gone from the first location, you can always
  2910. get it back by moving it again.  And it won't embarrass you like rabbit
  2911. fever can.
  2912.  
  2913.      The major function associated with moving is "parking".  When you
  2914. are writing paragraphs you often remember something that you haven't
  2915. discussed, or need to discuss in another place.  Instead of loosing your
  2916. train of thought, you simply designate a place to "park" your tangents.
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.             Surefire User's Guide         Page 46
  2926.  
  2927.  
  2928. It is also a good idea to "park" text that "just doesn't fit" in the
  2929. sections you are currently writing.  If the misfit text is important and
  2930. needs to be addressed, you'll find a more appropriate place for it
  2931. later.  Instead of deleting it, just "park" it.
  2932.  
  2933.      Setting the last page of the document aside for stray text is a
  2934. common approach to "parking".  This way you can have a safe place to
  2935. store text without affecting anything else in the document--like page
  2936. numbering.  And the page is saved along with the rest of your document.
  2937. You can name this page "Asides" or "Afterthoughts" with a Bookmark to
  2938. make it easy to locate with "Find".  This will help if your document
  2939. keeps growing, and you don't want to keep track of the new page numbers.
  2940.  
  2941. When you combine "parking text" with the "Book marking" technique
  2942. discussed in the last chapter, you can easily move between the Asides
  2943. and the paragraph you are currently working on.
  2944.  
  2945.      After you find a place for the "parked" text in the document, you
  2946. can easily locate it and zip it out of its "parked" location and move it
  2947. anywhere in the document using Cut or Copy and Paste.
  2948.  
  2949.      If you will be parking a lot of text, add a New Page, with a page
  2950. stop before it, at the end of your document. To do this, go to the end
  2951. of the document and choose "Add Page" from the Page menu. Move the
  2952. cursor upward to the line below the bottom margin of the previous page
  2953. that shows you where the page ends.  Press (Spacebar).  You will see a
  2954. "STOP" displayed.  A page stop (or hard page break) prevents text which
  2955. is added on previous pages, from being wrapped onto this one.
  2956.  
  2957.      Press (F6) to bring a previously Cut or Copied Clipboard object
  2958. into view.  Position the object in between the margins by pressing the
  2959. arrow keys.  Paste the object by pressing (ALT+F3).  The text has been
  2960. successfully "parked".
  2961.  
  2962.      You move text by simply Cutting it to the Clipboard and then
  2963. Pasting it from the Clipboard in the desired location.  Unlike, Copy,
  2964. the selected text in the document is not retained, but is removed in the
  2965. same fashion as if it were deleted.  Keep in mind that with Cut (as with
  2966. Delete), the results of the Cut operation are different depending on
  2967. whether you used Block select or Line select to select the text.
  2968.  
  2969. Pasting Text
  2970.  
  2971.      Before pasting a Clipboard object, move the cursor to the location
  2972. where the text will be inserted. The Paste operation will place the
  2973. object in the document differently depending on how it was selected.
  2974. Therefore if you are editing "wrapped" text, and used Block select, the
  2975. results of pasting the Clipboard object will be the same as if you typed
  2976. the text using Typeover mode. When you paste the Block, it retains its
  2977. same shape.
  2978.  
  2979.      If you've selected text using Block select, it is important that
  2980. there is enough blank space for the Clipboard object before you paste,
  2981. or the operation will obliterate existing text (and Undelete will not
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.             Surefire User's Guide         Page 47
  2991.  
  2992.  
  2993. undo this kind of deletion).  There are times when this is what you want
  2994. to do, but as a rule, you probably will want to make sure that there
  2995. is enough room first. Also, if the object is not contained between the
  2996. margins, you will see a message when you try to paste. Block selected
  2997. objects must be completely contained in the typing area.
  2998.  
  2999.      As long as you don't position the object in a margin and there is
  3000. no conflict with any fields (see "Chapter 11: Introduction to Fields"),
  3001. there will always be room for Line Selected text, memory allowing. If a
  3002. piece of "wrapped" text was selected using Line select, it will be
  3003. incorporated into the existing text when pasted as if you entered it
  3004. using Insert mode.  If you are in Word Wrap mode, the text is "wrapped
  3005. into" the document.  If Word Wrap is not on, text is inserted line by
  3006. line and is not wrapped together.
  3007.  
  3008.      Choose "Paste" from the Edit menu or press (ALT+F3) to Paste a
  3009. Clipboard object. After you Paste the object, the previously displayed
  3010. one will be displayed because it is now "on top of the pile".  To hide
  3011. it and return the cursor to the document, press (F6).
  3012.  
  3013.    Paste & Keep
  3014.  
  3015.      In contrast to Paste, Paste & Keep will retain a copy of the
  3016. Clipboard object even after it is pasted, and functions as the
  3017. "rubber-stamp" approach to "cut-and-paste" editing.  If you keep using
  3018. a long phrase like , "Albuquerque Municipal Water Storage and Sewage
  3019. Treatment Facility", just use Paste & Keep instead of Paste to retain a
  3020. copy of the object on the Clipboard after every insert.
  3021.  
  3022.      Choose "Paste & Keep" from the Edit menu or press (ALT+F4) to Paste
  3023. & Keep a Clipboard object.  Notice that there are now two copies of the
  3024. text displayed on the screen.  One is now part of the document and one
  3025. is a Clipboard object.  To return the cursor to the document, press (F6)
  3026. to hide the Clipboard object.
  3027.  
  3028. Sizing Clipboard Objects
  3029.  
  3030.      Whenever you Cut or Copy selected text to the Clipboard, the
  3031. viewable portion of the object is set to be the first 12 lines of larger
  3032. objects.  This gives you a context to know what the object contains
  3033. without having the object occupy too much of the screen.  There are
  3034. times when you will resize the object to view other than 12 lines.
  3035.  
  3036.      For example, let's suppose that you had several Clipboard objects
  3037. each the size of a paragraph.  In this case, you are using the Clipboard
  3038. as a means to help you create a mock "outline" so that you can
  3039. experiment with different sequences of these paragraphs and determine
  3040. the order that is the most effective.  When creating your "outline" it
  3041. would be preferable to reduce the size of the object to just the one or
  3042. two sentences.  Then you can rearrange the objects on the screen,
  3043. determine the best order, and then paste them one-by-one into the
  3044. document starting with the one you have decided will be first. Using the
  3045. Clipboard in this manner turns out to be a very efficient way to
  3046. reorganize the content of letters, reports and proposals.
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.             Surefire User's Guide         Page 48
  3056.  
  3057.  
  3058.      Another time you'll want to resize your object is when you have
  3059. more text in an object than what is displayed.  For times like these,
  3060. you can always make the object larger.  Keep in mind that when you
  3061. resize a Clipboard object, what is stored in the object remains the
  3062. same--only the viewable portion is changed.
  3063.  
  3064.      Once the Clipboard object is visible, follow these steps:
  3065.  
  3066.      1. Press (Shift+F3).
  3067.      This tells Surefire that you want to resize the object.  The cursor
  3068.      will move to the lower right-hand corner of the object.
  3069.  
  3070.      2.  Press (up arrow).
  3071.      The object will keep shrinking until it is one-line tall.
  3072.  
  3073.      3.  Press (down arrow).
  3074.      The object will expand to its original size.
  3075.  
  3076.      4.  Press (right arrow).
  3077.      Nothing happens.  This is because the object is already as wide as
  3078.      its original size.
  3079.  
  3080.      5.  Press (left arrow).
  3081.      The object shrinks in width.  Now press (right arrow) to expand the
  3082.      object.
  3083.  
  3084.      6.  Return the cursor to its normal Clipboard object behavior.
  3085.      Press (Shift+F1) to return the cursor to the upper left-hand
  3086.      portion of the object.  The object can be moved around on the
  3087.      screen again.
  3088.  
  3089.      7.  Press (F6) to return the cursor to the document.
  3090.  
  3091.      Often more information will be Cut or Copied to the Clipboard than
  3092. what is initially viewed in the object.  Cases like whole pages are good
  3093. examples.  In these cases, you may not want to resize the object, but
  3094. instead may want to scroll it and view its contents in smaller
  3095. portions.  You do this by pressing (Shift+F2).  This will put the cursor
  3096. in the middle of the object, indicating that you want to scroll.  Now
  3097. you can use the cursor keys to view all of the information in the
  3098. object.  To be able to move the object again, press (Shift+F1).
  3099.  
  3100.  
  3101. Removing Text
  3102.  
  3103.      In Surefire there are many ways to remove text.  Some you have
  3104. already seen in the last chapter--"search and destroy" with "Find and
  3105. Replace", pressing either the delete or backspace keys, delete to end of
  3106. line or delete the whole line.  You can also remove text by changing
  3107. your keyboard from Insert to Typeover mode and watching all previous
  3108. characters vanish as you type over them.  In addition, you can select
  3109. text, Cut it to the Clipboard and then not put it anywhere.  The last
  3110. alternative is the topic of this section--you can select text and then
  3111. delete it outright.
  3112.  
  3113.  
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.             Surefire User's Guide         Page 49
  3121.  
  3122.  
  3123.      Although potentially dangerous, select and delete is a useful
  3124. function.  It is best used for times you have writing experiments that
  3125. don't work, redundant sentences and rambling prose.  It helps you keep
  3126. things concise and clean up a cluttered manuscript.
  3127.  
  3128.      In Surefire, deleting text is simple:  just select text using Block
  3129. select or Line select and choose Delete from the Edit menu.  Keep in
  3130. mind that with Delete (as with Cut), the selection method you use gives
  3131. you different results when you remove text.  Deleting Block selected
  3132. text will leave white space behind just as if you typed in lines of
  3133. spacebar characters in Typeover mode.  In contrast, deleting Line
  3134. selected text results in having the text below the deletion "wrap up" to
  3135. fill in the hole.
  3136.  
  3137.  
  3138. Recovering Text
  3139.  
  3140.      With all of these convenient ways to eliminate text from you
  3141. document, it's important to know all the ways you can get it back if you
  3142. delete too much or you simply change your mind. As you know, being able
  3143. to delete a block can be a potentially disastrous capability.  You can
  3144. accidentally or thoughtlessly press the wrong keys.  Or you could change
  3145. your mind after deleting a lot of text, what do you do then?
  3146.  
  3147.      If the delete was the last one you did then you're alright.  Simply
  3148. press Undelete (F5).  This will recall the piece from the "delete
  3149. buffer" and return it to your document in the same place it was before.
  3150. But if you delete the important text awhile ago, and have since deleted
  3151. other things, then you can't resort to Undelete.  If the lost text was
  3152. part of your original document, you're still alright.  You could just
  3153. reopen your original version.  But, if you made a lot of beneficial
  3154. changes since disaster struck, you will be loosing those as well as
  3155. recovering the deleted text.  This could mean you'd be sacrificing a lot
  3156. more than you'd gain.
  3157.  
  3158.      Another alternative is to save the on-screen document to a
  3159. different file so that your beneficial changes are preserved. Now reopen
  3160. the original document and recover the lost piece.  Once you have the
  3161. original document on your screen, select the piece, copy it to the
  3162. Clipboard and hide the Clipboard by pressing (F6).  Recall the version
  3163. you were working on (and have since saved as a different file).  Show
  3164. the Clipboard again by pressing (F6) and paste the lost material.
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.             Surefire User's Guide         Page 50
  3185.  
  3186.  
  3187. Chapter 8      -    ADDING EMPHASIS
  3188.  
  3189.      All documents have a purpose.  Business documents are written to
  3190. inform, influence, persuade or convince the reader to do something or
  3191. think something.  You might write a letter to persuade a person to buy
  3192. your product or support your organization.  Or you might write a report
  3193. to inform your investors that you are increasing your market share.
  3194. Whatever the purpose, documents that are effective in accomplishing
  3195. these goals are always clearly written and easy to understand.
  3196.  
  3197.      The easiest way to use Surefire to improve the effectiveness of a
  3198. document is to take advantage of its graphical capabilities.  By using
  3199. its graphical features you can add emphasis to text and organize your
  3200. thoughts to make your point more clear and convincing.  You can support
  3201. your conclusions with tables and graphs that effectively illustrate your
  3202. data.  When used effectively, these elements help to guide your readers
  3203. through your printed thoughts, making it easier for them to agree with
  3204. your position, give you the job or buy your product.
  3205.  
  3206.      This chapter explains how to use Surefire's graphical features.
  3207. Specifically you are going to learn how to emphasize text, use special
  3208. characters, indent paragraphs, draw boxes and lines, and construct
  3209. tables and graphs.
  3210.  
  3211.  
  3212. Character Attributes
  3213.  
  3214.      There are two methods Surefire offers for adding emphasis to text:
  3215. drawing boxes around paragraphs to make them stand out, or having the
  3216. characters themselves stand out by either capitalizing them or giving
  3217. them attributes.
  3218.  
  3219.      Attributes are the distinctive elements added to selected
  3220. characters to make them look different than the rest.  In Surefire, you
  3221. can make text bold, underlined or both.
  3222.  
  3223.      Make words bold when you want to emphasize them inside a paragraph.
  3224.  
  3225. These are words that you don't want the reader to miss.  Defined terms
  3226. are good candidates for boldfacing.  Underlined words are also commonly
  3227. found inside paragraphs.  In contrast to bold words, these words are
  3228. "loud" and are used to remove any doubt from the reader's mind that this
  3229. is important.  A good example is: "this does not mean that we are going
  3230. to support the project."
  3231.  
  3232.      Making a word both underlined and bold is usually too loud for
  3233. words inside a paragraph but is excellent for emphasizing headlines and
  3234. subheadings.  In order to make the best use of emphasis in headings and
  3235. subheadings, you should develop a consistent system for assigning
  3236. attributes to them.  Both headlines and subheadings should be clear and
  3237. readable.  If your document lends itself to subheadings, use them to
  3238. your advantage.
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.             Surefire User's Guide         Page 51
  3250.  
  3251.  
  3252.    Giving a Character Attribute to Text
  3253.  
  3254.      To give a character attribute, select the text first using either
  3255. Block or Line Selection. When the desired text is highlighted, you can
  3256. apply Bold, Underline or both Bold and Underline attributes to your
  3257. text. Bring up the Graphic menu by pressing (ALT+G).  Move the cursor to
  3258. one of the attribute types such as "Bold & Underline" and press (Enter).
  3259.  
  3260.      If you have a monochrome monitor, notice that the text is displayed
  3261. as it would be printed.  On a color monitor, notice that the text
  3262. becomes blue while the background becomes green. If you had chosen
  3263. "Underline", on a color monitor, notice that the background of the text
  3264. is green.
  3265.  
  3266.      If you change your mind about making text bold or underlined, you
  3267. can return it to its natural state by first selecting it and then
  3268. choosing "Normal" from the Graphic menu.
  3269.  
  3270.  
  3271. Special Characters
  3272.  
  3273.      For the times when you are using foreign words, mathematical
  3274. symbols, fun symbols or special graphical elements such as characters to
  3275. join lines and boxes, you will be using special characters.  These
  3276. characters are available from the Special Characters window from the
  3277. Graphic menu.  They are grouped by type and you choose them by
  3278. positioning the cursor over one of them and pressing (Enter).  Once a
  3279. character has been chosen, you can access it without bringing up the
  3280. menu by pressing (Ctrl+S).  This inserts the previously selected special
  3281. character into your text in the same manner as if you just selected it
  3282. from the window.  The Special Character window is shown below.
  3283.  
  3284.      Surefire is intended to be used for English documents and foreign
  3285. characters are available when you need to add a foreign word to an
  3286. English document.
  3287.  
  3288. Indenting Lines and Paragraphs
  3289.  
  3290.      Another way to set off text visually on the page is by indenting
  3291. it.  It makes it interesting and gives the reader an idea about the
  3292. relative importance of the text he is reading.
  3293.  
  3294.      The first lines of paragraphs are the most commonly indented text.
  3295. To do this, you simply type (Tab) before entering text for a paragraph.
  3296. If you have already entered the text for a paragraph and find later that
  3297. you want to indent the first line, move the cursor to the beginning of
  3298. the line and insert a (Tab).  With Word Wrap on, the rest of the
  3299. paragraph will adapt to the adjustment by reflowing.  Otherwise, it will
  3300. shift if there is enough space on the line to accommodate the inserted
  3301. characters.
  3302.  
  3303.      If you find that you want to indent a whole paragraph, simply add
  3304. tabs to the beginnings of all of the lines.  If you have already entered
  3305. the text, you can also indent the paragraph.  In this case, it is
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311.  
  3312.  
  3313.  
  3314.             Surefire User's Guide         Page 52
  3315.  
  3316.  
  3317. important to start at the top of the paragraph and then work your way
  3318. down the left-hand margin, indenting all of the lines one-by-one.
  3319. Otherwise, the paragraph may not flow correctly.
  3320.  
  3321.      The standard or default size for a tab is five characters.  If you
  3322. wanted to change this to a different size, you'd need to change the tab
  3323. size in the Setup window.  To do this, bring up the Setup window from
  3324. the File menu by pressing (ALT+F), (E).  The Setup window will appear.
  3325. Use the (End) key to move the cursor to the "Tab Size:" text entry field
  3326. and type in the new value.  When you are done, press (Ctrl+Enter) to
  3327. close the window and change the tab size of the tabs you will type in
  3328. the future.  Keep in mind that this will not change previously typed tab
  3329. sizes.  If you want the new tab size to become the default, then instead
  3330. of pressing (Ctrl+Enter), move the cursor to the "SAVE" action button
  3331. and press (Enter) to close the window and change the tab size.
  3332.  
  3333.  
  3334. Drawing Boxes and Lines
  3335.  
  3336.      Drawing Boxes and Lines to emphasize text is easy to do in
  3337. Surefire.  Horizontal lines are drawn from left-to-right.  You simply
  3338. position the cursor at where you want the line to start on the left,
  3339. choose a style of line in the Graphic menu and then move the cursor to
  3340. the right until the line is the desired length.  Now, press (Enter).
  3341. When you draw a vertical line, you do the same except in this case, you
  3342. move the cursor from top to bottom and press (Enter).
  3343.  
  3344.      When you draw a box, you also draw it from left-to-right and
  3345. top-to-bottom.  You start in the upper left-hand corner of the box,
  3346. choose a line style, move the cursor to the lower right-hand corner and
  3347. press (Enter).  Notice that the mechanics of this is very similar to
  3348. Block selecting text.
  3349.  
  3350.      Keep in mind that lines and boxes, always replace whatever was
  3351. underneath them.  Therefore, if you are using a line or a box, it is
  3352. important to allow one character blank space for the lines to be drawn.
  3353.  
  3354.      In addition to using lines and boxes to set paragraphs off in
  3355. documents, you can do many kinds of business graphics: charts, graphs
  3356. and diagrams.
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.             Surefire User's Guide         Page 53
  3380.  
  3381.  
  3382. Constructing Tables
  3383.  
  3384.      A table is two or more columns of text and numbers and is used for
  3385. referencing information quickly.  Whenever you want to arrange two or
  3386. more columns of information side-by-side, you use a table.
  3387.  
  3388.      For example, you may want to set up columns of data that list your
  3389. monthly sales so you can determine your commission at the end of the
  3390. quarter and report it to your employer.  These figures will be easy to
  3391. read and manipulate if you present them in a table.  In addition, your
  3392. tables are more readable if you use the techniques you learned in the
  3393. last section to add lines and boxes to them.
  3394.  
  3395.     Tables are best entered and edited using Typeover mode.  Word Wrap
  3396. should be off so that is doesn't create a lot of formatting problems.
  3397.  
  3398.      The easiest way to enter a table is to use the (Tab) key to align
  3399. the columns.  For example, you could have a 20 character first column
  3400. for names, a 10 character second column for salaries, and a 5 character
  3401. third column for hiring dates.  Since each of these column widths line
  3402. up with the default tab stops (5 spaces per tab), then it is a simple
  3403. matter to hit one or two tabs after each entry to position the cursor at
  3404. the next column.
  3405.  
  3406.      To line up your columns nicely, choose your columns so that they
  3407. are all multiples of some number (5 in the above example).  Then, set
  3408. your tab size to that number.  To change the tab size, you simply enter
  3409. the new size in the "Tab size:" text entry field in the Setup window.
  3410. Now you can use tabs to align your columns.  Use the column indicator on
  3411. the status line to figure out exact cursor positions, as shown below.
  3412.  
  3413.      Remember that changing the tab width only affects the width of the
  3414. tabs that you are going to type in the future.  Therefore, if you have
  3415. already entered a table earlier in the document using a different tab
  3416. size, it will be unaffected by your change.
  3417.  
  3418.      After you have entered your text into the table, and are satisfied
  3419. with the widths of the columns, you can add lines and boxes to make the
  3420. tables easier and more interesting to read.  See "Drawing Boxes and
  3421. Lines" for more information.
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.             Surefire User's Guide         Page 54
  3445.  
  3446.  
  3447. Chapter 9      -    PAGE LAYOUT
  3448.  
  3449.      In business, presentation matters.  Present something well, and its
  3450. merits become more visible than its flaws.  Present something badly, and
  3451. its weaknesses show up more clearly than its strengths.  In writing, the
  3452. word for presentation is "layout".  It simply means the physical design
  3453. and appearance of your document.
  3454.  
  3455.      There are no strict laws governing the layouts for pieces of
  3456. writing, although there are many standards.  The documents you are
  3457. likely to write in Surefire fall into many different categories:  sales
  3458. reports, business letters, notices to employees, reports of meetings,
  3459. product announcements and so forth.  Each of these categories has been
  3460. around for a long time and has its own requirements for content and
  3461. layout.  For example, when reading a memo describing a change in policy,
  3462. most people expect to see how the new policy will affect their jobs.
  3463. Whereas, when reading a report of a meeting, most people expect to hear
  3464. who said what and how the final vote went.  And, with this expected
  3465. content comes an expected layout.
  3466.  
  3467.      Therefore, when you start designing the layout for your documents,
  3468. look at other documents from the same category.  When you uncover the
  3469. most effective layout for the piece you're writing and it is the most
  3470. appropriate for the reader you have in mind--simply duplicate the
  3471. layout.  Of course, you may want to make some minor changes to suit your
  3472. own unique purpose and audience.  Go right ahead.  When you've finished,
  3473. if your own piece of writing looks well presented to you, it will also
  3474. look well presented to your audience.
  3475.  
  3476.      In this chapter you will learn some of the many methods Surefire
  3477. affords for customizing the layout to suit the needs of your document.
  3478. Specifically, you will learn how to use Surefire's formatting commands
  3479. to control how your document is printed; and then how to take advantage
  3480. of the Clipboard to design a more sophisticated layout using desk-top
  3481. publishing techniques.
  3482.  
  3483.      There's always something that you can do to make your manuscript
  3484. visually more appealing and effective than you thought of when you were
  3485. concentrating on getting the ideas straight, rather than how they'd look
  3486. when printed.  We hope that you will be able to use the information in
  3487. this chapter to produce pages that are attractive and delight the eye.
  3488. Pages that are inviting and easy to read.
  3489.  
  3490.  
  3491. Formatting Choices
  3492.  
  3493.      Whenever you set formatting options, you tell Surefire how you want
  3494. the printed page to look.  Surefire gives you many formatting options to
  3495. choose from so that you have the most readable setting for your printer
  3496. and the most effective layout for your document.
  3497.  
  3498.      When choosing formatting options, you select the size of paper you
  3499. want to use, and how wide the margins should be.  You specify where you
  3500. want the printer to start printing, and what size characters to use.
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.             Surefire User's Guide         Page 55
  3510.  
  3511.  
  3512. You also tell Surefire whether or not you want text printed in the
  3513. margins such as page numbers, titles and dates.  You can also add pages
  3514. or remove them and adjust your text accordingly.
  3515.  
  3516.      Because all of the formatting alternatives add up to a manuscript's
  3517. total appearance, it's vital that a change made to one aspect of
  3518. formatting of the document will add and not interfere with the
  3519. effectiveness of another aspect.  For example, if you had wide margins,
  3520. and tiny text, you could fit a lot of information on the page, but it
  3521. would be difficult to read without eye-strain.  Therefore, the two main
  3522. concerns when choosing a format for your document is that it is
  3523. consistent and appropriate to the content.
  3524.  
  3525.      The final thing to think about when choosing a format is whether or
  3526. not your printer can print your ideas.  Many of the formatting choices
  3527. you'll be making will depend on the limitations of your printer.
  3528. Obviously, you can print a more finished-looking documents with a laser
  3529. printer or a letter-quality printer than you can with a 9-pin dot
  3530. matrix.  For the lower-resolution printers your goal might be just
  3531. making your document readable, while on the higher-resolution printers
  3532. you might be changing the appearance of a document meant for
  3533. publication.
  3534.  
  3535.  
  3536. Changing Character Spacing
  3537.  
  3538.      As you know, text consists of the characters that you enter into
  3539. Surefire.  Characters include letters, symbols, numbers and spaces.
  3540. Standard characters are available by typing on the keyboard, and special
  3541. characters are selected from the Special Character window (see "Chapter
  3542. 8: Adding Emphasis").  In addition, you can alter the horizontal spacing
  3543. of the characters in the Format window.  And as you saw in the last
  3544. chapter, you can change their attributes (bold or underlined) in the
  3545. Graphic menu.
  3546.  
  3547.      Although you can have isolated areas of boldface or underlined
  3548. text, when you change the size of characters in Surefire, you do so for
  3549. the whole document.  Therefore, all of the characters in a document will
  3550. be the same height and distance apart.  The term for character spacing
  3551. is called font and it is represented by pitch.
  3552.  
  3553.      Pitch is the horizontal spacing of the characters on a line and is
  3554. expressed in "characters-per-inch".  Since Surefire only uses fixed
  3555. fonts (as opposed to proportional fonts), the pitch of a font determines
  3556. how close together characters are on the line, but not how far apart the
  3557. lines are in the vertical direction.  Therefore, on some printers, the
  3558. characters themselves will shrink when they are printed closer together;
  3559. but for many printers, as you fit more characters on the line, the
  3560. characters will stay the same height and will be printed smashed
  3561. together as opposed to reduced in size.  The printers that have variable
  3562. character height are daisy-wheel, letter quality dot matrix and laser
  3563. printers.
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.             Surefire User's Guide         Page 56
  3575.  
  3576.  
  3577.      The number of fonts Surefire lets you choose from varies from
  3578. printer to printer.  For some printers, Surefire lets you choose between
  3579. elite (12-pitch), pica (10-pitch) and small print (16.66-pitch).  You
  3580. will notice how selecting a different font will change the readability
  3581. of your text and makes more or less text fit on the page.  You should
  3582. have Surefire set to Insert mode with Word Wrap on.
  3583.  
  3584.      To set a different font, bring up the Format window by pressing
  3585. (ALT+P) (O). Move the cursor to the "Print Font:" multiple choice
  3586. button. Use the (End) key until the cursor lands on the default font you
  3587. have selected for your printer.  Press (ALT+Z) to view the list of fonts
  3588. you have available for your printer. A font is a typestyle, and
  3589. depending on your printer it can be represented in "pitch",
  3590. "characters-per-inch", or some name unique to your printer.  To view all
  3591. of the fonts in the list, move the cursor by pressing the (up arrow) and
  3592. (down arrow) keys.
  3593.  
  3594.      Select one of the fonts in the list by pressing (Enter).  Close the
  3595. Format window by pressing (Ctrl+Enter). Because the new font is either
  3596. wider or narrower than the one you had before, Surefire will "rewrap"
  3597. the "wrapped" pages to adjust for the new font.  Notice how the amount
  3598. of text that fits on the page changes for pages where the text is in
  3599. paragraphs. If the font is very small, all the text may fit on fewer
  3600. pages and extra pages will be removed.
  3601.  
  3602.      Now, you can print with the new font. If you have a daisy-wheel
  3603. printer, put in the pinwheel corresponding to the font selected.  This
  3604. is usually very simple, and your printer manual has instructions. Bring
  3605. up the Print window by pressing (Alt+F) (P).  Press (Ctrl+Enter) to
  3606. choose PRINT.  If you need more information on using the Print window,
  3607. or your document doesn't print, see "Chapter 23: More About Printing".
  3608.  
  3609.      You may notice that choosing a smaller font (larger pitch) will
  3610. make more characters fit on a line.  Recall that the smaller font was
  3611. displayed with exactly the same number of characters per line that will
  3612. be printed.  In addition, the margins are kept the same width for
  3613. printing.  The margins appear larger on the screen because more
  3614. characters are needed to occupy the same space.  For example, if the
  3615. left margin was 1" and you are using a pica (10-pitch) font, you will
  3616. see the margin represented as 10 characters.  In contrast, choosing a
  3617. larger font (smaller pitch) will result in fewer characters fitting on
  3618. a line, and the margins will shrink accordingly.  Keep in mind that this
  3619. is done because Surefire does not display the change in the size and
  3620. spacing between characters on the screen (characters are fixed width).
  3621. Therefore, the margins are displayed as growing or shrinking to
  3622. accommodate more or less characters fitting on a line.
  3623.  
  3624.      Remember that the margins will not be wider or narrower when
  3625. printed, but are only displayed that way on the screen to display the
  3626. new font.  The number of characters occupying the page width, length and
  3627. margins is always the same as it is printed.
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.             Surefire User's Guide         Page 57
  3640.  
  3641.  
  3642.      In addition, you will get different results depending on whether
  3643. you have Word Wrap on or not.  Suppose you select a larger font (smaller
  3644. pitch) than the one you used to type the document and Word Wrap is off.
  3645. When you reformat with the new font, and your document has some text
  3646. that no longer fits on a line, Surefire will automatically add another
  3647. line just below the original line to put the extra text.  This will
  3648. result in very interesting-looking tables and paragraphs!
  3649.  
  3650.      You can return the document to the default font using the Format
  3651. window.  Move the cursor to the "RESET" action button and press (Enter).
  3652.  
  3653. This will reset the Format window to the default settings.  Close the
  3654. window by pressing (Ctrl+Enter) and watch the text "rewrap".
  3655.  
  3656. Changing Printers
  3657.  
  3658.      Many people use two printers:  one for proofreading and one for
  3659. final copies.  For example, the final copy of a document may be printed
  3660. on a letter-quality or laser printer, but all of the rough drafts where
  3661. printed on a 9-pin dot matrix printer.
  3662.  
  3663.      Usually switching between printers is not a problem--all you have
  3664. to do is select another printer in the Setup window.  However, when the
  3665. printer you are switching to supports different fonts than the first
  3666. printer you used, you will have to choose a font that is supported by
  3667. the second printer before it will print.  To illustrate, let's say that
  3668. you previously printed a document on a HP Laserjet using an small print
  3669. font (16.66 cpi).  Later, you revise the document and want to print out
  3670. the new copy on a EPSONLQ.
  3671.  
  3672.      After switching printers in the Setup window, you'd soon discover
  3673. that in this case, the document will not print on the EPSONLQ.  This is
  3674. because a 16.66 cpi font is not supported by the EPSONLQ.  To be able to
  3675. print on the EPSONLQ, you will need to change the font setting to one
  3676. the EPSONLQ will print and reformat the document by selecting a font in
  3677. the Format window.  Incidentally, if the EPSONLQ did support the 16.66
  3678. cpi font, Surefire would have automatically choose that font for you
  3679. when you changed printers.
  3680.  
  3681.      To continue the story, let's suppose that now you want to see what
  3682. the document looks like when you use the smaller font supported by the
  3683. HP.  You can reformat the document by typing in "16.66" in the "Not
  3684. Supported:" text entry field while the EPSONLQ is still the selected
  3685. printer.  When you are ready to print on the HP, you can simply change
  3686. printers in the Setup window and 16.66 will again become a supported
  3687. font.
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.             Surefire User's Guide         Page 58
  3705.  
  3706.  
  3707. Rewrapping Paragraphs
  3708.  
  3709.      When you changed fonts, you will notice that only the paragraphs
  3710. were "rewrapped" when you reformatted the document.  This is because
  3711. only the groups of text Surefire considers to be paragraphs will be
  3712. "rewrapped" in Word Wrap mode.  Therefore, when you have a "mixed"
  3713. document which has tables, charts and diagrams and "wrapped" paragraphs,
  3714. only the paragraphs will be "rewrapped" when you reformat.
  3715.  
  3716.      In contrast, if you reformat with Word Wrap off to a smaller font,
  3717. space will be added between the right-hand margin and the end of the
  3718. text for each line, so your lines will not reach the margin anymore.
  3719. Reformatting with a larger font will cause extra lines to be added to
  3720. accommodate the new text.
  3721.  
  3722. What is a Paragraph?
  3723.  
  3724.      To predict whether or not a group of lines will be "rewrapped" when
  3725. you reformat with Word Wrap on, you will need to decide whether or not
  3726. the consecutive lines are a paragraph.  In Surefire, two conditions must
  3727. be met before a group of lines is considered to be a paragraph:
  3728.  
  3729.      1. The lines are separated from the text above them by either one
  3730.      or more blank lines, or the first line of the group is indented.
  3731.  
  3732.      2. All lines after the first line must start at the first character
  3733.      position (next to the left-hand margin).
  3734.  
  3735.      Whenever you have a group of lines with one or more blank
  3736. characters between the text and the left-hand margin, or more than 18
  3737. characters between the end of the text and the right-hand margin, you do
  3738. not have a paragraph.
  3739.  
  3740.      If you have tables and charts in your document, you will want to
  3741. indent them at least one character from the left-hand margin to protect
  3742. them from being wrapped.
  3743.  
  3744.      As you saw in earlier chapters, you can join lines by moving the
  3745. cursor to the end of the first line and pressing Delete (Del).  If the
  3746. next line is not indented, and Word Wrap is on, you can "force wrap" the
  3747. group of lines into a wrapped paragraph.  Here, the second line will
  3748. "wrap up" to join the first and all remaining lines will "wrap" until
  3749. Surefire encounters either a blank or indented line.
  3750.  
  3751. Changing Margins
  3752.  
  3753.      Like changing the font, changing margins can improve the look of
  3754. your document if used with care.
  3755.  
  3756.      There are a number of reasons why you may decide to change the
  3757. margins of your document.  In the editing or rewriting sections, text
  3758. may have been added or deleted.  The difference in length may cause you
  3759. to want the appearance on paper to change.  Your draft may be on plain
  3760. paper, and you want your finished copy on letterhead.
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.             Surefire User's Guide         Page 59
  3770.  
  3771.  
  3772.      You may have a letter where all the text fits on the first page
  3773. except for the signature and you want  to get the signature to "wrap
  3774. up".  Or, you could have a table that is split between the first and
  3775. second pages of a 2-page document, and you want to put the whole table
  3776. on the next page.
  3777.  
  3778.      The "safest" margins to change are the top and bottom.  When you
  3779. change the left and right margins with Word Wrap on, Surefire
  3780. automatically rearranges the text to fit.  Once again, only paragraphs
  3781. will rewrap to fit between the margins.  Therefore, if you have a
  3782. document with indented text or wide tables and charts, these items may
  3783. get "clipped" when the margins are made wider (space between the margins
  3784. gets smaller).
  3785.  
  3786.      To change margins, simply bring up the Format window by pressing
  3787. (Alt+P) (O).  Press (End) or (Home) to move the cursor to the margin
  3788. setting area.  Type in the new dimensions in the "Margins" data entry
  3789. fields: "Left:", "Right:", "Top:", and "Bottom:".  Press (Ctrl+Enter) to
  3790. close the window and accept the new margins.
  3791.  
  3792.      If you don't like the results and you want to return to the default
  3793. settings, simply open the Format window again by pressing (Alt+P) (O)
  3794. and the press (End) to move the cursor to the "RESET" action button.
  3795. Press (Enter).
  3796.  
  3797.      Keep in mind that like changing fonts, changing margins will affect
  3798. all of the pages in the document.  If you don't want the new margins for
  3799. all of the pages, you will need to find a different solution if you want
  3800. to change margins to correct a formatting problem such as inserting
  3801. spaces to find homes for "orphans" and "widows", breaking a long table
  3802. into two tables or rearranging text via the Clipboard (see "Chapter 7:
  3803. Clipboard Editing").
  3804.  
  3805. Page Breaks
  3806.  
  3807.      As you know, when entering text, new pages are automatically added
  3808. as you need them.  Likewise, as you remove text, pages are automatically
  3809. removed as the text in your document contracts.  In addition, text
  3810. entered with Word Wrap on, automatically flows across the page breaks.
  3811.  
  3812.      However, there are times when you'll want more control over what
  3813. ends up on each page than just letting Surefire automatically handle it.
  3814. There are times when you want to begin a section on a new page, and you
  3815. want all the text from that point on to be independent from the text
  3816. before.  Or, you may want to add a graph to the end of the document and
  3817. want to make sure that no text wraps onto it.  In addition, you may want
  3818. to "lock down" tables embedded in "wrapped" text to prevent them from
  3819. shifting too far as lines are added and deleted above them.  In these
  3820. cases, you can have more control over page boundaries by using "stop".
  3821.  
  3822.      For example, you may have some "wrapped" text, and then a table
  3823. followed by more "wrapped" text.  As the "wrapped" text before the table
  3824. grows and shrinks, the table will shift position.  To prevent it from
  3825. being shifted to the extent that half of it is on the bottom of one page
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.             Surefire User's Guide         Page 60
  3835.  
  3836.  
  3837. and the rest on the top of another, you simply enter spaces before it,
  3838. by pressing (Ctrl+O) to move the whole table to the next page.
  3839.  
  3840.      After the table has been moved to the next page, you may want it to
  3841. remain independent from being shifted whenever the text on the page
  3842. before it changes.  To do this, you put a "stop" between the two pages
  3843. to keep them separate.  The effect of this will be to "split" the
  3844. document in half, as Surefire will insert new pages before the "stop" if
  3845. the text on the page before grows beyond the page's length.  Therefore,
  3846. it is a good idea to put "stops" before tables if you know that the text
  3847. on the previous page is likely to get smaller or bigger.
  3848.  
  3849.      To make a "stop" (or "hard" page break), move to the page break (a
  3850. differently-colored area where the two pages join) and press (Spacebar).
  3851.  
  3852. You will see "STOP" displayed, indicating that text will not flow
  3853. between these two pages.
  3854.  
  3855.      If at a later time you change your mind about the "stop", you can
  3856. remove it by placing the cursor on the page break and pressing
  3857. (Spacebar).  The text from the page after the break can now "reflow"
  3858. back across the "soft" page break, joining with the text on the previous
  3859. page.  Now if there is enough room on the previous page for your table,
  3860. you may bring it back to the previous page either by using Line Select
  3861. or Block Select and Delete from the Edit menu, or by pressing (Ctrl+D)
  3862. enough times to delete the spaces added earlier.  As you do this, the
  3863. table will "flow" from the top of the page to the bottom of the previous
  3864. page, filling in the gap you just created.
  3865.  
  3866. Adding and Deleting Pages
  3867.  
  3868.      As you can see, adding "stops" to your document results in breaking
  3869. your document up into independent sections.  If you are entering text
  3870. into a document, and are ready to start a new section, you can force
  3871. Surefire to manually add a page after the current one instead of using
  3872. the above technique of adding enough lines to fill up the page to make
  3873. Surefire automatically add one for you.
  3874.  
  3875.      To add a page after the current one, simply press (ALT+P) to bring
  3876. up the Page menu, move the cursor to "Add Page", and press (Enter).  The
  3877. cursor will now start at the beginning of the new page.  If you want the
  3878. page to be independent of previous pages, simply move the cursor up to
  3879. the place where the two pages join and press (Spacebar) until you see
  3880. "STOP" displayed.
  3881.  
  3882.      If at a later time, you decide that some pages are unnecessary--a
  3883. redundant section is just a repeat of earlier arguments, a graph is too
  3884. confusing and subtracts from your point or a page is mostly blank and
  3885. its contents can be incorporated into other text--you can remove them by
  3886. choosing "Delete Page" from the Page menu.  This will remove the page,
  3887. but not the "stop" unless the page is the last one in the document.
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.             Surefire User's Guide         Page 61
  3900.  
  3901.  
  3902. Headers and Footers
  3903.  
  3904.      Imagine typing at the top of every page, "Financial Statement of
  3905. the Albuquerque Sewage and Waste Water Treatment Facility".  After
  3906. several pages, this could become quite tedious.  But by adding a single
  3907. header at the top of the first page, you can have Surefire do it for
  3908. you.
  3909.  
  3910.      Headers and Footers are text that appears in the top and bottom
  3911. margins and are printed on every page of the document.  There are many
  3912. uses for headers and footers such as titles, company names, report
  3913. footnotes, dates and page numbers.  You can even add lines across the
  3914. top and bottom to accent the text on the page.
  3915.  
  3916.      To place text in the top margin, you simply choose "Header" from
  3917. the Page menu, move the cursor into position and type.  When you are
  3918. done typing, press (Esc) to return the cursor to the main typing area of
  3919. the document.  Footers are made in the same way except that you choose
  3920. "Footer" from the Page menu.
  3921.  
  3922.    Automatic Page Numbering
  3923.  
  3924.      Many people, when first trying out word processing, do something
  3925. very understandable but totally useless.  Something in fact that causes
  3926. them problems:  they type in page numbers wherever a page breaks, just
  3927. the way they would on a typewriter.
  3928.  
  3929.      That's fine as long as the page breaks stay the same.  But the
  3930. minute you add or delete text, change margins, or enforce a page break
  3931. where there was none before, all the page numbers have to be laboriously
  3932. relocate, one at a time.
  3933.  
  3934.      Luckily, you can have Surefire number the pages automatically for
  3935. you in a header or footer.  Only the first page needs to be specified--
  3936. then all the rest of that document is numbered sequentially, no matter
  3937. how much it shrinks or bulges in the editing process.
  3938.  
  3939.      To insert a page number, you press (ALT+P) to display the Page menu
  3940. and choose either "Header" or "Footer"--depending on whether you want
  3941. the number to appear at the top or bottom of the page.  Once the cursor
  3942. is in the desired margin, you simply move it to the desired location and
  3943. type #.  When you return the cursor to the regular typing area by
  3944. pressing (Esc), you will see a "1" displayed where you put the number
  3945. sign.
  3946.  
  3947. Page and Paper Sizes
  3948.  
  3949.      In Surefire, page size and paper size are not necessarily the same.
  3950. Page size is the size of the pages aligned end-to-end on Surefire's
  3951. "electronic paper" (see "Chapter 5:  Revising a Document").  This may or
  3952. may not correspond to the size of paper you are using in your printer.
  3953.  
  3954.      There are many times when you'll want to have a page larger or
  3955. smaller than the size of the paper loaded into your printer.  For
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.             Surefire User's Guide         Page 62
  3965.  
  3966.  
  3967. example, you might be printing one side of a series of half-page thank
  3968. you notes that are going to be folded in half.  Or you might be printing
  3969. mailing labels, name tags or envelopes.  In addition, you may be
  3970. printing one wide page on two sheets of paper called tiles.
  3971.  
  3972.      To select a new page size, you first bring up the Format window by
  3973. pressing (ALT+P) (O).  Now, move the cursor to the "Page Size" multiple
  3974. choice button in the Format window and press (ALT+Z) to bring up a list
  3975. of choices.  Choose one from the list by pressing (Enter).
  3976.  
  3977.      As you saw in the list, you can either print "tall" or "wide" pages
  3978. if your printer supports it.  In addition, you can print an oversized
  3979. (13-7/8 by 11") document in two sections of 8 1/2 by 11" paper (tiles)
  3980. when the page size is larger than the paper size.  If you want to try
  3981. this, notice that if you have a header or footer on the page in
  3982. Surefire, it will be printed on both tiles.  In addition, you can select
  3983. a custom page size by choosing "Specific Setting" and entering the
  3984. dimensions in a special window.
  3985.  
  3986.      The "Specific Setting" is good for setting the page size to
  3987. correspond to custom pages such as invoices and order forms.  In
  3988. addition, you can use it to create a continuous column of text in a
  3989. document as you will see later in this chapter.
  3990.  
  3991.      You may have also noticed that you can set the page size to
  3992. "screen".  This is useful for making data entry forms and is explained
  3993. later in this manual.  Likewise, printing mailing labels and envelopes
  3994. is also found in a later chapter.
  3995.  
  3996.      Generally, printers can not print to the edge of the paper.  For
  3997. example, the HP laser-jet printer uses 1/4 inch of the left and right
  3998. edges of the paper to grab and move the paper through the printer.  You
  3999. can tell what part of the page is "printable" in Surefire by pressing
  4000. (ALT+P) (O).  Doing this will display the Format window.  At the top,
  4001. you will  see "Print Region:".
  4002.  
  4003.      The "Print Region:" gives the area of the page that will be printed
  4004. and corresponds to what you see on the screen.  For example, although
  4005. the dimensions of the paper you have loaded in the printer may be 8 1/2
  4006. by 11 inches, the actual width of the document page as displayed on the
  4007. screen is only 80 characters or 8 inches.  If you place text in a header
  4008. or foot flush left or right, it will be printed on the paper 1/4 of an
  4009. inch to the left or right of the edge of the paper.  Keep in mind, that
  4010. the print region is independent of the type of paper you have in the
  4011. printer.  As long as the paper is the size of the page you specified in
  4012. the Format window, everything you can type on the screen  will be
  4013. printed.
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.             Surefire User's Guide         Page 63
  4030.  
  4031.  
  4032. Printing Your Document
  4033.  
  4034.      Now that you have the layout you want on the screen, see how it
  4035. looks on paper.  Keep in mind that you may still need to make some final
  4036. adjustments such as allowing room for the letterhead; putting in the
  4037. right pinwheel for the font you've selected; and figuring out how many
  4038. copies you want; etc.
  4039.  
  4040.      When all of the considerations are addressed, and you're ready to
  4041. print, bring up the Print window by pressing (Alt+F) (P) if it is not
  4042. already displayed.  Once again, you move around in the window by
  4043. pressing (Home) and (End).  See "Chapter 23 - More About Printing" for
  4044. a complete discussion of the options in the Print window.
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.             Surefire User's Guide         Page 64
  4095.  
  4096.  
  4097. Chapter 10     -         The Calculator
  4098.  
  4099.      The pop-up calculator is handy and easy to use. In fact, it offers
  4100. you a way to do even more powerful calculations than you can do with
  4101. your pocket calculator. It can be used simply to sum a group of numbers
  4102. or obtain a more complex result such as the payment amount for a loan.
  4103. The result can even be pasted right into your document.
  4104.  
  4105.      To bring up the calculator window, Calculator is selected from the
  4106. Operate Menu, or the short cut (Alt+H) is typed. The calculator has one
  4107. line into which you can type. This "entry line" is at the middle of the
  4108. calculator. The simplest use is to type in numbers in the entry line.
  4109. You may also use the operators (+, -, *, /) to add, subtract, multiply
  4110. and divide.  Whenever (Enter) is typed, the current value or expression
  4111. that you have typed is evaluated. The result is added to the value
  4112. already shown in the result area. The "result area" is located at the
  4113. upper left corner of the window.
  4114.  
  4115.      When you first display the Calculator, the result area will be
  4116. cleared. As you use the Calculator during your Surefire session,  the
  4117. result area will contain the value that was there when the Calculator
  4118. was last visible. Press (Esc) to close the Calculator and return to your
  4119. document.
  4120.  
  4121.      To start a new calculation we should first clear the previous
  4122. result.  This is done by selecting the CLEAR button. Use the (End) or
  4123. (down arrow) key to position on CLEAR and press (Enter). Notice that the
  4124. result area is cleared.  The entry line will be cleared when you begin
  4125. to type a new expression. You can also clear the entry line expression
  4126. by pressing (Ctrl + K) when the cursor is on the entry line.
  4127.  
  4128.      You can use parentheses () to group parts of an "expression".
  4129.  
  4130. Mathematical Expressions
  4131.  
  4132.      Mathematical expressions are formulas that use numbers, numeric
  4133. operators and numeric functions. Surefire supports the following numeric
  4134. operators:
  4135.  
  4136.      Two number operators     One number operators
  4137.  
  4138.      +    Addition             -         Negation
  4139.      -    Subtraction
  4140.      *    Multiplication
  4141.      /    Division
  4142.  
  4143.      The operators in the first column are used with two numbers. For
  4144. example, you can multiply two numbers like "3 * 2". The following is
  4145. also valid: "3 * 2 + 4".  This will multiply 3 with 2 and add 4 to the
  4146. result, which is 10.
  4147.  
  4148.      What if you wrote "4 + 3 * 2"?  Well, the result is still 10 since
  4149. 4 + 6 is 10.  This is because division and multiplication have a higher
  4150. precedence than addition and subtraction.  Precedence means that numbers
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.             Surefire User's Guide         Page 65
  4160.  
  4161.  
  4162. with "*" (multiplication) or "/" (division) between them are calculated
  4163. first, even if they appear to the right of other values.  You can tell
  4164. Surefire to override the precedence rules by enclosing parts of an
  4165. expression in parentheses ().
  4166.  
  4167.      Suppose you really wanted to add 3 with 4 and then multiply by 2.
  4168. This can be done by associating  the expression "4 + 3". To do this,
  4169. parentheses are put around this part of the expression. The expression
  4170. is now: "(4 + 3) * 2" and the new result is 14, since 7 multiplied by 2
  4171. is 14.  Any number of matched left and right parentheses can be used in
  4172. expressions.
  4173.  
  4174.       The negation operator is nothing more than a minus sign (-) before
  4175. a number or expression.  It is used to specify a negative number such as
  4176. "-10" or "-(30*2 - 10)" which evaluates to "-50".  Once you have a
  4177. negative value, you can use it in an expression. For example, if you
  4178. wanted to multiply -10 by 4 you could enter either: "-10 * 4" or "4 *
  4179. -10". This expression would give the result of -40.
  4180.  
  4181. Using Functions
  4182.  
  4183.      Mathematical expressions can also contain functions. Functions
  4184. allow you to perform more sophisticated operations on values than you
  4185. can with numeric operators alone.  For example, you can use a function
  4186. to calculate the present value of your mortgage loan or sine of some
  4187. angle. Functions in the Surefire Calculator work with numeric values.
  4188. All functions in Surefire start with the special character "@". If a
  4189. function uses arguments, these arguments are specified within
  4190. parentheses and each is separated by a comma. The function @SQRT(n) uses
  4191. one argument while the function @PV(pmt, int, term) requires three
  4192. arguments.
  4193.  
  4194.      Two other numeric functions available in the calculator are @ABS(n)
  4195. and @SIN(n). These functions are used to determine the absolute value
  4196. and sine of a number respectively.  They are used by substituting "n"
  4197. with the number you want to evaluate. There are many functions that can
  4198. be used in the calculator.
  4199.  
  4200.      To see what functions are available for use in the calculator, type
  4201. (Alt+Z) when the cursor is positioned in the calculator's entry line.
  4202. This will display a pop-list of all available functions with
  4203. placeholders for their arguments.  You may scroll through this list
  4204. using the (down arrow) and (up arrow) keys to find the one you want. 
  4205. When the desired function is highlighted, you can choose it.  Press
  4206. (Enter), and that function will be put into the entry line starting
  4207. where the cursor is when you typed (ALT+Z).  You can then replace the
  4208. arguments with the right numbers or other smaller expressions. When the
  4209. expression is complete, press (Enter) once more to have the result of
  4210. the expression added to the value in the result area.
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.             Surefire User's Guide         Page 66
  4224.  
  4225.  
  4226.      All functions that are available in Surefire and in the calculator
  4227. are summarized in "Appendix A: Surefire Function Reference" located near
  4228. the end of this manual.  You may use any of the General Mathematical
  4229. Functions, Trigonometric Functions, Logarithmic Functions and Financial
  4230. Functions described on pages A-1 to A-3 within the calculator.
  4231.  
  4232.      All the expressions and functions available for the calculator can
  4233. also be used as field commands.  Field commands can do many more complex
  4234. things like manipulate text and dates,  perform database operations and
  4235. even link databases together.  After you gain an understanding of fields
  4236. in Surefire, you may read "Chapter 14: Introducing Field Commands" for
  4237. complete information.
  4238.  
  4239.  
  4240. Calculator Errors
  4241.  
  4242.      If the Calculator cannot evaluate what was typed in the entry line,
  4243. the word ERROR is displayed in the upper right corner of the window. The
  4244. previous result is not disturbed.  This error message will go away when
  4245. the next good expression is evaluated or the result area is cleared. To
  4246. clear a calculator error, press (down arrow) to move the cursor to the
  4247. CLEAR button. Press (Enter). ERROR will disappear. You can now return to
  4248. the entry line to type a valid expression.
  4249.  
  4250.  
  4251. Pasting a Result
  4252.  
  4253.      The resulting value of a calculation can be put directly into your
  4254. document by choosing the PASTE button.  For the time being let's assume
  4255. that your document does not have any fields.  Since you are therefore
  4256. working in Text edit mode, the value in the result area will be put onto
  4257. the document page at the location where the cursor was when you opened
  4258. the Calculator window. The value is inserted or overtyped depending on
  4259. the current Insert or Typeover status.  If Word Wrap is on, normal
  4260. wrapping will occur.
  4261.  
  4262.      For information on pasting a result when there are fields in a
  4263. document, read the appropriate section of "Chapter 13: Working With
  4264. Fields".
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.             Surefire User's Guide         Page 67
  4289.  
  4290.  
  4291. Chapter 11     -    Introduction to Fields
  4292.  
  4293.      A field is an area in the document that can contain a value or
  4294. formula. It can hold the monthly payment of a property lease or the
  4295. totaled expenses for a recent trip. It can act as a placeholder in a
  4296. form letter or a way to enter information into a database. A field can
  4297. contain today's date, your friend's  name or enable you to view another
  4298. document. Fields are the key to making Smart Documents. These documents
  4299. can act like fill-in-the-blank forms or control complete applications.
  4300.  
  4301.      You are already somewhat familiar with fields because you have used
  4302. them in Surefire system windows. Except for multiple choice buttons, the
  4303. fields that you can create are the same. For example, if you look at the
  4304. Get File window, you will see three fields: one data entry field or text
  4305. field, and two action buttons or button fields.
  4306.  
  4307.      There are five types of fields that you can create and use in a
  4308. document. They are text, numeric, date, logical and button fields.
  4309.  
  4310.      In the next two chapters you will learn about each of the different
  4311. field types; numeric, text, date, logical and button and their
  4312. attributes. These attributes determine how field values are displayed
  4313. and stored. In the chapter "Working with Fields", you will learn how to
  4314. move fields around, modify the attributes of existing fields and work
  4315. with fields and their values.
  4316.  
  4317.  
  4318. Fields and Forms
  4319.  
  4320.      We introduce fields by showing how you can use them to make
  4321. documents that look like forms. Most of you are already familiar with
  4322. pre-printed paper forms. On these forms, most of the words are already
  4323. on the page. You need to just fill in the blanks with additional
  4324. information to complete a form. Examples of common forms are lease
  4325. agreements, order forms, expense  reports and standard contractual
  4326. agreements.
  4327.  
  4328.      With Surefire, you design and lay out a form by first using
  4329. Surefire's word processing capabilities to enter text and graphics on
  4330. the document page. Then you combine this with the fields that you place
  4331. anywhere within your document.  These fields will hold the data that is
  4332. important to you and the task that your document will help you solve.
  4333.  
  4334.  
  4335. Editing and Using Documents
  4336.  
  4337.      The basic concepts for editing documents with fields are the same
  4338. as for editing documents without fields. Inserting and wrapping text,
  4339. cut & paste, and saving and getting documents are among the operations
  4340. that are essentially the same.  And you can use the (End) and (Home)
  4341. keys to conveniently move around your document via fields just as you do
  4342. in Surefire system windows. The only new concept is how to create and
  4343. modify the fields' formatting capabilities.
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.             Surefire User's Guide         Page 68
  4354.  
  4355.  
  4356.      The concepts of editing and using a document are very important in
  4357. Surefire. Very simply, editing a document allows you to change the
  4358. format or layout of a document with fields, while using a document
  4359. allows you to enter, display, store, calculate and otherwise manipulate
  4360. the values in fields.
  4361.  
  4362.      Later in the manual, we will discuss how to edit the actual values
  4363. that these fields may hold. These values may be manipulated by commands
  4364. and may be stored in a database. And, you can use commands to cause
  4365. actions to happen, such as displaying other documents, searching a
  4366. database, etc. This is just like the action buttons in system windows.
  4367. To start, you will learn how to create fields and use them in simple
  4368. ways.
  4369.  
  4370.  
  4371. Moving Around a Document via Fields
  4372.  
  4373.      When there are fields present in a document, you can move around in
  4374. two different ways.  The cursor can be "tied to fields" or the cursor
  4375. can be "free".  This is true whether you are "editing" the document
  4376. (i.e. Document edit mode) or "using" the fields of the document (i.e.
  4377. Use mode). You switch between these two ways of moving around by
  4378. pressing the free cursor key, (F3).
  4379.  
  4380.      When the cursor is free, an "F" can be seen on the status line.
  4381. Otherwise, the cursor is tied to the fields.
  4382.  
  4383.      There always is a field called the "current field".  This is the
  4384. field that is highlighted. A field becomes highlighted, and thus, the
  4385. current field when the cursor is moved onto it.
  4386.  
  4387.    Cursor Tied To Fields
  4388.  
  4389.      When the cursor is tied to the fields, basic movement is identical
  4390. to the way you move around among fields in the Surefire windows. The
  4391. arrow keys will move you to the next field up, down, left and right as
  4392. long as they are lined up.  (Home) and (End) will move you to the
  4393. previous or next field in the same direction as you would read text.
  4394. This is generally from left to right and top to bottom. (Ctrl + Home)
  4395. and (Ctrl + End) will bring you to the first or last field on a line.
  4396.  
  4397.       The above keys work only within a single page except for (Home)
  4398. and (End).  Pressing these keys will continue to bring you to the next
  4399. or previous field even if it exists on some other page of your document.
  4400.  
  4401. In addition, (Ctrl + Page Up) and (Ctrl + Page Down) will bring you to
  4402. the first field of the previous or next page. This is similar to using
  4403. these keys when the cursor is free. These keys are listed in the table
  4404. on the following page.
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.             Surefire User's Guide         Page 69
  4419.  
  4420.  
  4421.    Free Cursor
  4422.  
  4423.      When the cursor is free, you may move around a document with fields
  4424. in exactly the same way as you move around a document with only text.
  4425. The cursor is free to be positioned anywhere.  What you can do once you
  4426. position the cursor is different depending upon whether you are editing
  4427. the document or using the document to enter values into fields.  The
  4428. sections Editing Fields and Entering Information into Fields in the
  4429. chapter "Working with Fields" will point out these differences. The keys
  4430. that you may use to move the cursor are listed in the table below.
  4431.  
  4432.      To Move                                      Press
  4433.  
  4434.      Left one field                               Home
  4435.      Right one field                              End
  4436.      Up one field                                 Page Up
  4437.      Down one field                               Page Down
  4438.      To the start of the line in a text field     Ctrl + Home
  4439.      To the end of the line in a text field       Ctrl + End
  4440.      To  the previous page                        Ctrl + Page Up
  4441.      To the next page                             Ctrl + Page Down
  4442.  
  4443.                     Key Usage - Cursor Tied to Fields
  4444.  
  4445.      To Move                                      Press
  4446.  
  4447.      To the beginning of the line                 Home
  4448.      To the end of the line                       End
  4449.      To the previous screen                       Page Up
  4450.      To the next screen                           Page Down
  4451.      To the beginning of the document             Ctrl + Home
  4452.      To the end of the document                   Ctrl + End
  4453.      To the previous page                         Ctrl + Page Up
  4454.      To the next page                             Ctrl + Page Down
  4455.  
  4456.                          Key Usage - Free Cursor
  4457.  
  4458.  
  4459. Creating Fields
  4460.  
  4461.      Fields are created by using the Field Create window. Before opening
  4462. the Field Create window, position the cursor in the document to where
  4463. the upper left corner of the field will be put. Then, open the Field
  4464. Create window by choosing "Create" on the Field menu or pressing
  4465. (ALT+C).
  4466.  
  4467.      The first multiple choice button allows you to flip through all the
  4468. types of fields that can be created, displaying all the field attribute
  4469. options for each.  You may press (Spacebar) repetitively to show the
  4470. available field types or you may press (ALT+Z) to show a pop-list with
  4471. these types. After the desired field type is found, you may specify the
  4472. individual field attributes by moving to the various attribute settings
  4473. in the window.  These initial values may easily be changed after the
  4474. field is created.
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.             Surefire User's Guide         Page 70
  4484.  
  4485.  
  4486.      The field is then created by selecting OK.  If the field being
  4487. created is a date, logical or button field, it will have a pre-defined
  4488. size. This type of field is immediately inserted into the page or
  4489. overwritten onto the page depending on whether Insert or Typeover mode
  4490. is on. The size of date and logical fields are determined by the format
  4491. that you have chosen. The size of a button field is determined by the
  4492. label that you have given it.
  4493.  
  4494.      Note:   Surefire will not allow you to create a new field on top of
  4495. an existing field.
  4496.  
  4497. Sizing Text and Numeric Fields
  4498.  
  4499.       Text and numeric fields are sized when they are created after the
  4500. Create Window is closed. When you choose OK for these fields, the cursor
  4501. is placed at the starting position that you have indicated for the
  4502. field.  At this time, using the (right and down arrow) keys allows you
  4503. to specify the exact size of the field on the page.  When the sizing is
  4504. finished, press (Enter). If you wish to cancel the field create
  4505. operation, you can press the (Esc) key. If you bump up against another
  4506. field, Surefire will not allow you to continue in that direction.  Just
  4507. use the (left and up arrows) to make the field smaller.  You can move
  4508. the field or change its size later.
  4509.  
  4510.      The sizing operation will be affected by the current insert mode.
  4511. If Insert  is on, every time the field is sized to the right, the text
  4512. and fields to its right are moved over.  If Wrap is on, wrapping is also
  4513. done. A text or numeric field may be a multiple line field. Multiple
  4514. line fields cannot be created when Insert is on.  You must switch to
  4515. Typeover  mode before you open the Create Window to create a multiple
  4516. line field.  When a field is created in Typeover mode, any text under
  4517. the field will be overwritten.
  4518.  
  4519. Field IDs
  4520.  
  4521.       You do not need to worry about naming or labeling each field that
  4522. you create. If you want, you may type descriptive text near a field so
  4523. that you know what the field is used for. Surefire assigns an ID  to a
  4524. field when it is created. This ID is a name that Surefire uses to
  4525. distinguish one field from another. Within a document, no two fields
  4526. will have the same ID. IDs are discussed in greater detail in the
  4527. chapters Using Field Commands and Spreadsheets.
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.             Surefire User's Guide         Page 71
  4549.  
  4550.  
  4551. Chapter 12     -    Field Types and Attributes
  4552.  
  4553.      A field restricts the type of information  that is put into it.
  4554. Generally, the type of information that can be put into a field
  4555. corresponds to the type of field it is.  A field can be numeric, text,
  4556. date, logical or button. Numeric, text and date fields allow only
  4557. numbers, text and dates in them.  Logical fields allow only yes or no
  4558. (or true or false) as their information.
  4559.  
  4560.      Button fields are somewhat different in that they do not allow any
  4561. information to be entered into them. Think of a button that you would
  4562. press on your VCR or stereo.  This button may turn on the device or
  4563. cause a tape to be rewound. A button field in Surefire has a similar
  4564. purpose. They provide a means for doing specific actions when they are
  4565. "pressed".  These actions are specified as field commands which are
  4566. discussed in detail in later chapters.
  4567.  
  4568.      The precise way in which fields handle information is determined by
  4569. their field attributes.  There are two types of field attributes: format
  4570. attributes and data attributes.  Field attributes are set by using the
  4571. Create Field or Modify Field windows.  These windows are opened by
  4572. choosing "Create... Alt+C" or "Modify..  Alt+M" from the Field menu and
  4573. are described in this and the following chapters. You must be in
  4574. Document Edit mode to give or change field attributes
  4575.  
  4576.  
  4577. Format Attributes
  4578.  
  4579.      The exact way in which a field accepts and displays information is
  4580. determined by the specification of its format attributes. For example,
  4581. format attributes for the numeric field include whether numbers are to
  4582. be displayed with $'s and commas for currency and where the decimal
  4583. point is to be placed.  All the format attributes of all fields are
  4584. described later in this chapter.
  4585.  
  4586.      Many format attributes such as text and numeric justification,
  4587. currency symbol placement, etc., take effect after entry of a value into
  4588. a text field. Entry occurs when you move the cursor out of the field or
  4589. press (Enter).
  4590.  
  4591.  
  4592. Data Attributes
  4593.  
  4594.      The data attributes describe whether the information stored within
  4595. a field is stored in a database or not.  These data attributes are fully
  4596. described later in this manual in the chapter entitled "Introduction to
  4597. Databases".
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.             Surefire User's Guide         Page 72
  4614.  
  4615.  
  4616. Text Fields
  4617.  
  4618.      Text fields provide the most general way of entering information.
  4619. Any text that you can normally put in a document can be put in a text
  4620. field in the exact same way. There are three main differences. One
  4621. difference is that the boundaries for the text are the field limits
  4622. rather than the margins on the page. Another difference is in the
  4623. flexibility of  formatting the text after entry. The last difference is
  4624. that text field values can be stored in a database and used  in
  4625. formulas. The following sections describe the format attributes
  4626. available for text fields.
  4627.  
  4628.    Justified Text Formats
  4629.  
  4630.      Text justification can occur after entry of a value into a text
  4631. field. The text can be left justified, right justified or centered
  4632. within the field.  This is done by setting the first format multiple
  4633. choice button to Left Justify, Right Justify or Center.
  4634.  
  4635.    Unjustified Text Formats
  4636.  
  4637.      There are two other format options on this multiple choice button.
  4638. They are Don't Justify and Wrap Text.  Nothing happens on entry when
  4639. either of these attributes is set. When Don't Justify is set, the text
  4640. stays wherever you type it within the field. When Wrap Text is set, word
  4641. wrap occurs whenever the text needs to, just like within a page.
  4642. Changing this attribute to Wrap Text after there is already some text in
  4643. the field does not remove white space or break words for you. Rather, it
  4644. changes the way the field organizes the text during subsequent editing
  4645. in the field.
  4646.  
  4647.    Single vs Multiple Lines
  4648.  
  4649.      Text Fields can have one or more lines in them. All format
  4650. attributes except wrap apply to single line text fields. Wrap and Don't
  4651. Justify behave identically for single line fields.
  4652.  
  4653.      For multiple line text fields, justification occurs on a line by
  4654. line basis.  For example, if Center is specified, every line will be
  4655. centered when it is entered.  If Wrap is set, text is formatted
  4656. according to the same wrap rules discussed for general word processing
  4657. except it occurs within the boundaries of the field.
  4658.  
  4659.  
  4660. Numeric Fields
  4661.  
  4662.      Numeric fields provide the means to enter various types of numbers.
  4663. These can be decimal or integer numbers, percentages or dollars, etc.
  4664. When entering information into a numeric field, only numbers and a few
  4665. specific characters such as the minus sign ("-") and the decimal point
  4666. (".") are allowed.  All other characters are ignored.
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.             Surefire User's Guide         Page 73
  4679.  
  4680.  
  4681.    Numeric Appearance
  4682.  
  4683.      The first format multiple choice button in the Create or Modify
  4684. Field window allows you to choose the general appearance of the number
  4685. that will be displayed in your field. These choices are summarized as
  4686. follows:
  4687.  
  4688.      Appearance          Description
  4689.  
  4690.      Decimal             This is a number containing a single decimal
  4691.                          point somewhere within it.
  4692.  
  4693.      Comma               This is the same as Decimal except commas are
  4694.                          inserted automatically at every third place.
  4695.  
  4696.      Percent             This is a number that always displays the
  4697.                          percent sign ("%") and always divides the
  4698.                          contained number by 100.  This is very
  4699.                          convenient when the field is referenced by a
  4700.                          formula. Field Commands and formulas are
  4701.                          described later in this manual.
  4702.  
  4703.      Currency            Currency will always display a dollar sign '$'
  4704.                          at the left of the number.  It will also
  4705.                          provide commas at every third digit.
  4706.  
  4707.    Negative Representation
  4708.  
  4709.      The second format multiple choice button provides two ways in which
  4710. a negative value can be displayed. The normal way is with a minus sign
  4711. '-'. This is specified by choosing "-Negative".  The other way puts the
  4712. number inside a set a parentheses.  This is generally desirable when
  4713. working with accounting information. This is specified by choosing
  4714. "(Negative)".
  4715.  
  4716.    Numeric Justification
  4717.  
  4718.      The third multiple choice button allows you to set the
  4719. justification for the field. Numbers can be left or right justified. As
  4720. with text fields, the justification occurs after you enter a value in
  4721. the field.
  4722.  
  4723.    Other Numeric Format Settings
  4724.  
  4725.      In addition to the three multiple choice buttons, there are three
  4726. other items that you may specify for numeric fields. The first is
  4727. labeled "Decimal Place:". The number entered here indicates how many
  4728. places to the right of the decimal point should be maintained in the
  4729. field. Surefire will use this setting to display the value.
  4730.  
  4731.      The second item is labeled "Integer?".  Here one can choose Y for
  4732. Yes or N for No.  Yes indicates that the number is to be rounded
  4733. automatically to the nearest whole number before being displayed.
  4734. Internally, however, the number is remembered to be the exact value
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.             Surefire User's Guide         Page 74
  4744.  
  4745.  
  4746. entered.  If the number of decimal places is set to one or greater and
  4747. you typed in a number with a fractional part (i.e some digits to the
  4748. right of the decimal point), after you finished entering it, the
  4749. fractional part would not be displayed.
  4750.  
  4751.      The third item is labeled "Pad". You use this attribute to say
  4752. whether the number is displayed with leading zeros or blanks to fill up
  4753. the width of the field. If you choose "Blank if Zero", the field will
  4754. display the number zero as a blank or empty field. This setting is
  4755. useful if you have a form with many 0 values and you want to improve
  4756. readability.
  4757.  
  4758.    Single vs Multiple Cells
  4759.  
  4760.      Numeric fields can contain more than one "cell". Each cell can
  4761. contain one number.  Multiple cell numeric fields have more than one
  4762. cell stacked vertically.  All cells for any one numeric field are always
  4763. the same size and have the same format attributes. A multiple cell
  4764. numeric field is created by using Typeover mode and the (down arrow) key
  4765. to show that the field occupies more than one line. Multiple cell
  4766. numeric fields are useful for designing smart documents that look like
  4767. spreadsheets.
  4768.  
  4769. Date Fields
  4770.  
  4771.      Date fields provide ways to enter and display dates.  Date fields
  4772. always assure that the dates contained within them are valid dates.
  4773. That is, only 12 months can be represented and the appropriate valid
  4774. days for a month can be represented.  In addition, you can only specify
  4775. February 29th for leap years.
  4776.  
  4777.    Date Styles
  4778.  
  4779.      There are three styles of date format.  The format is specified by
  4780. using the format multiple choice button on the Create or Modify Fields
  4781. windows. The three formats are as follows:
  4782.  
  4783.      Date Style     Description
  4784.  
  4785.      mm/dd/yy       This format allows you to enter the month, day and
  4786.                     year by the 2 digit number that represents it.
  4787.           Example: 5/4/32
  4788.  
  4789.      dd-mmm-yy      This format specifies the day first as a two digit
  4790.                     number, then the month as the three letter
  4791.                     abbreviation and finally the last two digits of the
  4792.                     year.
  4793.           Example: 13-sep-67
  4794.  
  4795.      Month dd, yyyy This format completely spells out the name of the
  4796.                     month followed by the day and then the year.
  4797.           Example: November 23, 1945
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.             Surefire User's Guide         Page 75
  4809.  
  4810.  
  4811.      With the first two formats you will be able to enter dates within
  4812. the current century Generally, these dates will be between Jan 1, 1900
  4813. and Dec 31, 1999. The last format allows entry and display of dates that
  4814. are from January 1, 0001 through December 31, 9999.
  4815.  
  4816.    Default to Today
  4817.  
  4818.      The "Default to Today?" option is specified by toggling this
  4819. logical choice button to Y for yes or N for no.  You toggle by pressing
  4820. the (Spacebar) until you see the desired value.  If this value is set to
  4821. Yes, the field will contain today's date, in the style you specified,
  4822. when the document is read in.  This is convenient for forms and letters
  4823. that need to be dated with the current date. You would not have to look
  4824. at your calendar each time and fill it in.  If necessary, however, you
  4825. could change it.
  4826.  
  4827.      Even if this option is not set for a field, you can easily enter
  4828. today's date. With the cursor positioned in the date field, type a
  4829. letter 't' or 'T'. You will see today's date displayed in this field in
  4830. the appropriate format. This is a shortcut for entering today's date in
  4831. a date field.
  4832.  
  4833.  
  4834. Logical Fields
  4835.  
  4836.      Logical Fields provide a way of limiting the information to either
  4837. a yes/no or true/false answer.  A logical field is like a simple
  4838. multiple choice button with two choices.  The style of the choices can
  4839. be specified.  There are four logical styles.  These are selected by
  4840. choosing the appropriate style with the format multiple choice button.
  4841. The available styles are "Y/N", "Yes/No", "YES/NO" and "True/False".
  4842.  
  4843. Button Fields
  4844.  
  4845.      As mentioned earlier, nothing can be directly entered into a button
  4846. field.  A button field can be "pushed" by pressing the (Enter) key when
  4847. the cursor is on the button.  This can cause an action to occur. A field
  4848. command describes the action that will take place when the button is
  4849. pushed.  An example of such a command is one that displays another
  4850. document when the button is pushed. Without a command, pushing a button
  4851. will do nothing. Field commands are described later in this manual.
  4852.  
  4853.      There is only one attribute to specify for buttons.  This is a
  4854. label.  The label is any text that will represent the button in the
  4855. document.  You type the label that you desire next to the word Label: in
  4856. the Field Create Window. Then choose OK or press (Ctrl+Enter) to create
  4857. the button.
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.             Surefire User's Guide         Page 76
  4874.  
  4875.  
  4876. Fixed vs Auto Sized Fields
  4877.  
  4878.      Text, Numeric and Date fields can be set to be Fixed Size or Auto
  4879. Sized. When a field is set to Fixed Size, it always takes up the same
  4880. amount of space on the page no matter what the content of the field is.
  4881.  
  4882.      If Auto Sizing is set however, the document will automatically
  4883. adjust based on the width of the value in the field.  For a text field
  4884. with multiple lines, empty blank lines at the bottom of the field will
  4885. also be removed causing the document to contract further. This automatic
  4886. adjustment is done when you change to Text mode.  If no changes are made
  4887. in Text mode, returning to Use the document will cause Auto Sized fields
  4888. to expand back to their maximum length. The notions of Using a document
  4889. versus editing a document as text or as a document are covered in the
  4890. following chapter.
  4891.  
  4892.      Auto Sizing can be used to personalize letters with people's names,
  4893. for example.  The name is put in an auto sized field so that when the
  4894. document is printed, the spacing will be adjusted appropriately to
  4895. produce a letter that looks like it was typed on a typewriter. Auto
  4896. sizing will occur automatically during a Search & Print operation.  This
  4897. operation is often referred to as "Mail-Merge".  See Chapter 20:  "Forms
  4898. and Form Letters" for a complete description of this process.
  4899.  
  4900.      With regard to date fields, auto sizing only affects date fields
  4901. formatted where the month name is fully spelled out.
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.             Surefire User's Guide         Page 77
  4939.  
  4940.  
  4941. Chapter 13     -    Working With Fields
  4942.  
  4943.      In the previous two chapters you were introduced to the concept of
  4944. fields and how to create them. In this chapter you will learn how to
  4945. change a field's formatting characteristics and how to move fields
  4946. around in a document.
  4947.  
  4948.  
  4949. Editing Fields
  4950.  
  4951.      At some point, you may want to revise a document that has fields.
  4952. You can edit just the fields or the fields and the text of the document
  4953. at the same time. Editing fields in a document means changing the way
  4954. they look, changing their size, moving them around or removing them
  4955. altogether. You will not be changing their values. Any values that are
  4956. in the fields will be preserved. To edit a document that is a
  4957. combination of text and fields you must switch to document edit mode. To
  4958. do this, you choose "Document" from the Operate menu or press (ALT+F9).
  4959.  
  4960.      When you look at a document while in Document Edit mode, the fields
  4961. are shown filled with letters that indicate their type: n for numeric,
  4962. c for text, L for logical, d, m and y for date and B for button. This
  4963. provides additional feedback that you are going to be editing the layout
  4964. of the document and not field values. You can edit both the textual
  4965. portions of the document and the fields together.
  4966.  
  4967.      As you switch between using and editing the document, some fields,
  4968. such as a numeric field with a Currency attribute carry more information
  4969. than the fact that it is a number. For example, $nnnnn.nn means that the
  4970. field is a currency value ($) with 2 decimal places (.nn).
  4971.  
  4972.      Fields can be edited only when the Operate mode is Document edit.
  4973. When there are no fields in the document, the Operate mode is Text edit
  4974. since only text can be edited. The Operate mode becomes Document edit
  4975. automatically after you create the first field in a document. You can
  4976. also explicitly choose "Document" from the Operate menu at any time when
  4977. there are fields in the document.
  4978.  
  4979.      If you type text when the cursor is not on a field, the text will
  4980. be put on the page just as if you were doing only word processing.  All
  4981. the word processing rules apply. Conversely,  when you type while the
  4982. cursor is on a field, nothing will happen.
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.             Surefire User's Guide         Page 78
  5004.  
  5005.  
  5006. Single and Multiple Line Fields
  5007.  
  5008.      Fields that occupy a single line are treated like words.  Inserting
  5009. text, wrap and all the word processing operations move the field just as
  5010. if it were a word.  This lets you enter text easily without having to
  5011. worry about positioning in-line fields. For example, in a lease or
  5012. contract, many fields are found in paragraphs with normal text on either
  5013. side. Changing the wording of the paragraph should move the field
  5014. automatically.
  5015.  
  5016.      Multiple line fields, or fields that occupy more than one line are
  5017. handled a little differently.  You can insert text around these fields
  5018. as long as there is enough white space to accommodate the new
  5019. characters. Multiple lined fields are moved up and down as lines are
  5020. inserted and deleted above and below them.  You cannot move these fields
  5021. left or right in this manner.  This must be done by using Cut and Paste. 
  5022. See the section Moving and Copying fields later in this chapter for a
  5023. complete discussion of this process.
  5024.  
  5025.      Note:  There is one other limitation to placing multiple line
  5026. fields. That is, multiple line fields cannot be broken up between pages.
  5027. As a result, if you force a multiple line field across a page boundary,
  5028. by inserting or deleting lines, all lines that the field crosses will be
  5029. pushed up or down across the page boundary  together.
  5030.  
  5031. Modifying Field Attributes
  5032.  
  5033.      You can change the attributes of a field by putting the cursor on
  5034. the field that you wish to modify and choosing "Modify...  Alt+M" on the
  5035. Field menu. This will display the Modify Field window. You will note
  5036. that this window is the same as the Create Field window except that you
  5037. can not change the field type. All of the currently set field attributes
  5038. for the field you have selected are displayed and any of them can be
  5039. changed. The changes take effect when you choose OK. You can change your
  5040. mind, as usual, by choosing CANCEL.
  5041.  
  5042. Resizing Fields
  5043.  
  5044.      Text and Numeric fields can be resized interactively.  You do this
  5045. by placing the cursor on the field that you wish to resize. Then, by
  5046. using the arrow keys to move the cursor, you can redefine the extents
  5047. or size of the field. When you choose "Size" on the Field menu or press
  5048. (ALT+V), the cursor is placed on the lower right corner of the field.
  5049. You adjust the size by using the arrow keys in the same way as you did
  5050. when you created the field. You can always cancel a resize operation by
  5051. pressing the (Esc) key. As usual, press (Enter) to accept the new size.
  5052.  
  5053.      The resizing operation obeys Insert and Wrap modes accordingly.
  5054. This means that when you make a single line field longer or shorter, the
  5055. text or other fields following this field on the page, will be moved
  5056. over and wrapped down or up just as if you were inserting characters.
  5057.  
  5058.      When you resize multiple line fields, you must first make sure that
  5059. Typeover is set. And, if you are enlarging the field, you should see
  5060.  
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.             Surefire User's Guide         Page 79
  5069.  
  5070.  
  5071. that there are no other fields to the right or below that will be
  5072. covered by the larger field. It is a good idea to first insert extra
  5073. lines below a multiple line field that you wish to make larger.
  5074.  
  5075.      Note:   You may not delete a field by sizing it smaller than 1
  5076. character. Read the section below for information on how to delete
  5077. fields that are no longer needed or desired.
  5078.  
  5079. Deleting Fields
  5080.  
  5081.      Fields can be deleted along with text that has been Line or Block
  5082. selected.  You do this by choosing "Delete" on the Edit menu.  The
  5083. currently selected field or current field can be deleted directly by
  5084. choosing "Delete" on the Edit menu. Notice that the Delete choice does
  5085. not have a shortcut. This is a precaution. If you delete a page, by
  5086. choosing "Delete Page" from the Page menu, all the fields as well as the
  5087. text on that page will be deleted.
  5088.  
  5089.      Because Surefire does not want you to lose important data, you will
  5090. be warned if you try to delete a database field. In addition, you will
  5091. not be able to delete a field by deleting the current line or end of
  5092. line with (Ctrl+D) or (Ctrl+E) respectively.
  5093.  
  5094.      If you delete all of the fields in a document, Surefire will
  5095. automatically return you to Text edit mode. You will note that the "Use
  5096. Alt+F7" and "Document Alt+F9" choices on the Operate menu are disabled.
  5097. When you again add fields to the document, these choices will become
  5098. available once more.
  5099.  
  5100. Editing a Document with Fields as Text
  5101.  
  5102.      The choice "Text  Alt+F8" on the Operate menu allows you to edit
  5103. the document as if it were nothing but text. This means that the values
  5104. currently displayed in the fields, become simply text on the document's
  5105. pages. Once changes are made to a document during Text edit, the
  5106. placement and characteristics of the fields are no longer maintained.
  5107. You can no longer edit the document as a document or use the document to
  5108. manipulate field values unless you Get the saved version of the
  5109. document.
  5110.  
  5111.      Editing a document as text is useful to make annotations or add
  5112. specific wording or emphasis for one-time usage.  You can then print the
  5113. document or save it as a Report  without altering the general make-up of
  5114. your original document. See "Chapter 22: Generating Reports" for
  5115. information on how to save documents as reports.
  5116.  
  5117. Moving and Copying Fields
  5118.  
  5119.      You can move and copy (duplicate) fields that are interspersed with
  5120. text by using Cut & Paste just as you would with text alone. The only
  5121. difference is that the selection of the mixed text and fields must fully
  5122. contain the fields.  In other words, you cannot try to select part of a
  5123. field.  If you do, a message will let you know that the operation cannot
  5124. be done.
  5125.  
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.             Surefire User's Guide         Page 80
  5134.  
  5135.  
  5136.      Fields that are cut or copied will be put in a clipboard object
  5137. along with any text that was also selected. The contents of the
  5138. clipboard object can be pasted elsewhere in the document or even into
  5139. another document.
  5140.  
  5141.      If you are in document edit and choose Cut or Copy from the Edit
  5142. menu without doing a selection first, the current field will be cut or
  5143. copied. You use the Cut operation to move fields and the Copy operation
  5144. to copy them.
  5145.  
  5146.      When fields are cut, the fields contained in the cut will still
  5147. retain their unique identifiers, all attributes and associated field
  5148. commands.  Later, when you paste the clipboard object, the fields in the
  5149. new location will be exactly as they were before.   This means that the
  5150. fields were moved with everything else intact.  If, however, you use a
  5151. paste & keep operation instead, the initial paste will work as a move
  5152. but any secondary paste operations will cause new similar fields to be
  5153. created with new IDs. These new fields will not retain any field
  5154. commands that were associated with the original field.
  5155.  
  5156.      When fields are copied, the fields in the clipboard object will
  5157. retain their format attributes but not their unique identifiers, values
  5158. or field commands. A Paste or Paste & Keep operation will cause new
  5159. fields to be created with new IDs. If any of the original fields had a
  5160. data attribute set to Stored,  the new duplicate fields would have their
  5161. data attributes set back to be Not Stored.
  5162.  
  5163.      When you Paste or Paste & Keep fields between documents, the fields
  5164. will retain their format attributes but not their unique identifiers,
  5165. data attributes or their associated commands.  This is because the
  5166. command references and data storage specifications can no longer be
  5167. valid in the other document.
  5168.  
  5169. Entering Information into Fields
  5170.  
  5171.      When documents are not being edited, they can be Used.  This allows
  5172. you to use the document so that only the information within fields (its
  5173. values) can be changed or manipulated. Fields provide a way to enter
  5174. information in an easy and rapid manner. As discussed in the previous
  5175. chapter, the way in which you enter information into fields depends on
  5176. the type of field and the field's specified formatting attributes.
  5177.  
  5178.      You could use a document as a pre-made form, as a spreadsheet to
  5179. perform calculations or as a way to enter or view information in a
  5180. database. Using a document is what really distinguishes a Smart Document
  5181. from an ordinary document.
  5182.  
  5183.       During Use mode, even though you can put the cursor anywhere in
  5184. the document, you can only enter information into a field.  Attempting
  5185. to type anywhere else will result in nothing happening.  The cursor must
  5186. first be positioned on a field.  You can use a free cursor or a cursor
  5187. that is tied to fields to position your cursor.
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.             Surefire User's Guide         Page 81
  5199.  
  5200.  
  5201.      If the current field or cell contains a field command, a '#' will
  5202. be displayed at the far right of the status line. This let's you know
  5203. quickly that the current field or cell has a command. Any value you
  5204. enter in the cell will most likely be overwritten when that field
  5205. command is executed. Just bypass the field and move on to another one.
  5206.  
  5207.    Entering Dates
  5208.  
  5209.      In order that you do not have to type every character of a date,
  5210. you follow simple rules for entering values in date fields of each of
  5211. the three date formats. In addition, today's date can always be
  5212. specified by simply typing the letter 't' or 'T' when the cursor is in
  5213. a date field. Date fields always assure that the dates contained within
  5214. them are valid dates.  That is, only 12 months can be represented and
  5215. the appropriate valid days for a month can be represented.  Of course,
  5216. you can only specify February 29th for leap years.
  5217.  
  5218.      When you enter values into a date field, use the (left and right
  5219. arrow) keys to move between the month, day and year parts of the date.
  5220. With the first two formats you will be able to enter dates that are in
  5221. the current century, that is between Jan 1, 1900 and Dec 31, 1999. The
  5222. last format allows entry and display of dates that are from January 1,
  5223. 0001 through December 31, 9999.
  5224.  
  5225.      The rules for each of the formats are as follows:
  5226.  
  5227.      Date Style     Description
  5228.  
  5229.      mm/dd/yy       This format allows you to enter the month, day and
  5230.                     year by the 2 digit number that represents it.
  5231.                     Type the month number when the cursor is over the
  5232.                     mm part, the day number when the cursor is over dd
  5233.                     and the last two digits of the year when the cursor
  5234.                     is over yy.
  5235.  
  5236.      dd-mmm-yy      This format specifies the day first as a two digit
  5237.                     number, then the month as the three letter abbrev
  5238.                     and finally the last two digits of the year.  The
  5239.                     day and year are entered by typing the appropriate
  5240.                     number when the cursor is over the dd or yy part.
  5241.  
  5242.                     The month is specified by typing in the first
  5243.                     character of the month name. If the cursor is in
  5244.                     the month part of the field and you type the letter
  5245.                     's', the month will become 'sep' If you type the
  5246.                     letter 'j' you will get 'jan'; to get 'jun' type
  5247.                     'j' again; type 'j' one more time to get 'jul'.
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.             Surefire User's Guide         Page 82
  5264.  
  5265.  
  5266.      Month dd, yyyy This format completely spells out the name of the
  5267.                     month followed by the day and then the year. You
  5268.                     type in a two digit day and then you can type in a
  5269.                     four digit year.
  5270.  
  5271.                     The month is specified by typing in the first
  5272.                     character of the month name. The remaining
  5273.                     characters are filled in automatically. If the
  5274.                     cursor is at the start of the field and you type
  5275.                     the letter 'n', the month will become 'November'.
  5276.                     If you type the letter 'A' you will get 'April'; to
  5277.                     get  'August', type 'A' one more time.
  5278.  
  5279. Pop-Lists
  5280.  
  5281.      Any single line text field can have a pop-list associated with it.
  5282. This pop-list contains pre-set values for the text field and can be
  5283. used, created or edited at any time while you are using  the document.
  5284. Pop-lists are useful for storing pre-set text strings that are used
  5285. often for a particular text field. You will avoid unnecessary
  5286. keystrokes, you won't make as many spelling mistakes, and you will be
  5287. certain of using only one version among similar values.  For example, a
  5288. pop-list for a field with people's titles might include: President,
  5289. Secretary, Administrator, His Royal Highness, etc.
  5290.  
  5291.      If the current field is a text field with a pop-list, a 'P' will be
  5292. displayed in the upper right corner of your screen. This lets you know
  5293. that there are available selections before you start typing a value.
  5294.  
  5295.    Creating a Pop-list
  5296.  
  5297.      To create a pop-list, position the cursor on the text field and
  5298. press (Ctrl+Z).  A window is opened in the center of the screen. You may
  5299. add or change as many items as you wish using the same editing commands
  5300. you are already familiar with. Just type each value that you want on a
  5301. line of its own and press (Enter) to move down to the next line. Up to
  5302. 30 items can be put in a pop-list. When you are finished, press (Esc).
  5303. You can then define or change pop-lists for any other single line text
  5304. fields in your document.  The pop-lists you create are immediately
  5305. available but you must save the document if you want the pop-lists to be
  5306. retained for subsequent sessions.
  5307.  
  5308.    Using a Pop-list
  5309.  
  5310.      To use a pop-list, you zoom it like any other zoomable item in
  5311. Surefire.  With the cursor positioned on the text field, press (Alt+Z)
  5312. to display the pop-list. Then, you can move around with the (up and down
  5313. arrow) keys or (Page Up) and (Page Down), until the item that you wish
  5314. is highlighted. Choose this item with the (Enter) key.  When you choose
  5315. an item, that text will be copied into the current text field and the
  5316. pop-list will be closed.  You can leave the pop-list without selecting
  5317. anything by using the (Esc) key.
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.             Surefire User's Guide         Page 83
  5329.  
  5330.  
  5331. Clearing Field Values
  5332.  
  5333.      You can clear the values in individual fields or all fields in the
  5334. document at one time. An individual field is cleared by pressing (Ctrl
  5335. + K) when that field is the current field.  You can clear all fields in
  5336. the document by choosing "Clear Fields " from the Field menu or pressing
  5337. (ALT+Y).
  5338.  
  5339.  
  5340. Locating Specific Field Values
  5341.  
  5342.      Because of Surefire's unique design there is no special mechanism
  5343. for finding specific field values in your document. When you are using
  5344. the document, you can select "Find... " from the Page menu or press
  5345. (ALT+T) to open the Find window. This is exactly how you use Find
  5346. without fields. You can type in a pattern and choose NEXT or PREVIOUS to
  5347. search forward or backward in the document for that value.
  5348.  
  5349.      Surefire will locate matching patterns anywhere in the document ,
  5350. whether or not it occurs in a field.  You can use this feature to search
  5351. for and change incorrect field values by skipping matches that do not
  5352. occur in a field.
  5353.  
  5354.  
  5355. Printing a Document with Fields
  5356.  
  5357.      There are three ways that you might want to print a document with
  5358. fields.  Each of these results follow naturally from the way you are
  5359. looking at your document on the screen.
  5360.  
  5361.      1) You can have your form look the way it does on the screen when
  5362. you fill it out, with underlines defining each field. If you wanted to
  5363. print out a "blank" form to be filled in by pencil, you can clear all
  5364. fields by choosing "Clear Fields" on the Field menu before you print.
  5365.  
  5366.      2) You can see the definition of your form with text surrounding
  5367. field placeholders.
  5368.  
  5369.      3) You can see the field values, auto-sized as needed, without
  5370. underlines.  Notice on the first line that the excess space between
  5371. "Alice Fay Jones" and "of" has been removed. This happened because
  5372. autosizing was set for the text field containing "Alice Fay Jones".
  5373.  
  5374.      To print your document the first way, make sure you are in Use
  5375. mode before printing. To achieve the second type of output, print while
  5376. you are in Document edit mode and finally the third result will occur
  5377. while you are viewing your document in Text edit mode.  In all three
  5378. cases, you print the same way as you would for documents without fields.
  5379. You choose Print from the File menu, change any options in the Print
  5380. window and choose OK.
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.             Surefire User's Guide         Page 84
  5394.  
  5395.  
  5396. Copying and Pasting Values Among Fields
  5397.  
  5398.      While using the document, you can Cut or Copy field values and
  5399. Paste these values into other fields in the same or a different
  5400. document. For example, you may have a large block of text in a field
  5401. that you want echoed in another field. You really don't want to retype
  5402. the text word for word. To copy the value, move the cursor to the field
  5403. and press (ALT+F2) to put the value in a clipboard object. Then, move
  5404. the cursor to the field that will get the value and press (ALT+F3) to
  5405. paste the value.
  5406.  
  5407.      You may also Cut the original value if you no longer want it in the
  5408. original field. And, of course you may Paste & Keep the clipboard object
  5409. if you want the value copied to more than one field.
  5410.  
  5411.      Note: When you paste text into a multiple line text field the text
  5412. will be pasted into all lines of the field starting at the first line no
  5413. matter which line of the field the cursor is on.
  5414.  
  5415.  
  5416. Copying and Pasting Values To the Calculator
  5417.  
  5418.      If the current field is a numeric field, you can place the value of
  5419. the current cell in that field directly into the entry line of the
  5420. Calculator.  To do this just type (Ctrl + Enter) when the Calculator is
  5421. visible. The same value that was displayed in the numeric cell is
  5422. inserted into the entry line of the Calculator just as if it were typed.
  5423.  
  5424.      Likewise, the resulting value of a calculation can be put directly
  5425. into your document by choosing the PASTE button. The value will be
  5426. pasted differently depending on whether you are currently using or
  5427. editing the document. Choosing PASTE closes the Calculator window.
  5428.  
  5429.      If you are using the document and the current document field is a
  5430. numeric field,  choosing PASTE will put the current value from the
  5431. result area of the Calculator into the current cell of the numeric
  5432. field.
  5433.  
  5434.      If, however, you are currently working in Document edit  or Text
  5435. edit mode, the result is put onto the page at the location where the
  5436. cursor was when you opened the Calculator. The value is inserted or
  5437. overtyped depending on the current Typeover status.  If you are editing
  5438. the document, you will not be able to paste a value on top of a field.
  5439. If Word Wrap is on, normal wrapping will occur.
  5440.  
  5441.  
  5442.  
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.             Surefire User's Guide         Page 85
  5459.  
  5460.  
  5461. Chapter 14     -    Introducing Field Commands
  5462.  
  5463.      As you've seen in the previous chapters, fields by themselves are
  5464. very useful in constructing and entering data in forms such as time
  5465. cards, property leases, orders and other standard contracts.  But
  5466. you need to enter a value in each field or cell. With field commands,
  5467. some field entries could be automatically determined from information
  5468. you already entered in other parts of the document.  You could even
  5469. access an often used form letter or search for a specific type of
  5470. information by the push of a button.  With field commands you can create
  5471. the most intelligent Smart documents that can even become entire
  5472. applications.
  5473.  
  5474.  
  5475. What is a Field Command?
  5476.  
  5477.      A field command consists of one or more lines of text connected to
  5478. a field or cell. This text tells Surefire specifically what to do.
  5479. Generally, this is an action or calculation which occurs when the
  5480. command is executed.  Most of the time, commands are executed after
  5481. information has changed in one or more fields.
  5482.  
  5483.      The lines of text that make up a field command contain expressions
  5484. and functions that are appropriate for the type of field that contains
  5485. the command. You have already seen expressions and functions in the
  5486. Calculator. While in the Calculator you can only have mathematical
  5487. expressions and functions, field commands are much more varied.
  5488.  
  5489.      For a numeric field, a mathematical expression is the simplest form
  5490. of field command.  For example, "2 + 2" can be defined as a command in
  5491. a numeric field.  When the command is executed, the result "4" is
  5492. displayed in that field.  This is very similar to the operation of
  5493. expressions in the Calculator. In fact, any numeric expression or
  5494. function that can be used by the Calculator, can also be a numeric field
  5495. command.
  5496.  
  5497.      For other types of fields, there are additional functions and
  5498. operators that allow you to manipulate the data values  or information
  5499. contained in those fields.  For instance, a date field function allows
  5500. you to calculate a date that is 15 days from today; a text field
  5501. operator allows two text strings to be combined together to produce a
  5502. third. Operators available for each field type will be described in the
  5503. next chapter.
  5504.  
  5505.      In this chapter you will learn the basics of using field commands.
  5506.  
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.             Surefire User's Guide         Page 86
  5524.  
  5525.  
  5526. What Can Be Done with Field Commands?
  5527.  
  5528.      Your document can accomplish much more with field commands than
  5529. simple addition. Extensive capabilities involving numbers and
  5530. mathematical functions are available.  In addition to numbers, one can
  5531. also manipulate dates and text. Determining a date so many days before
  5532. or after today is an example of a date expression.  The result of a date
  5533. expression is displayed in a date field in the format that you have
  5534. chose for that field. As for text, you can use field commands to
  5535. substitute a portion of one string of text with another, change case,
  5536. combine strings to form a new string and various other text
  5537. manipulations.
  5538.  
  5539.      Commands can also be used to control what happens.  This is done
  5540. using conditions and control functions. An example of a simple condition
  5541. is to display "Balance Overdue" if today is after the due date for Joe
  5542. Smith's monthly loan payment. Conditions are often used with logical
  5543. fields.  Control functions can cause something to happen when a button
  5544. is "pushed", or when a specific value is entered into some field. This
  5545. might be the display of another document, searching a data base or even
  5546. running a DOS command or another application. Control functions are
  5547. generally used with button fields.
  5548.  
  5549.      A complete description of field commands and examples of how they
  5550. can be used, can be found in Appendix A.
  5551.  
  5552. Field IDs
  5553.  
  5554.      A field ID is automatically assigned by Surefire when a field is
  5555. created and is guaranteed to be unique for the document. This ID is used
  5556. in commands to reference or represent each individual cell in a
  5557. document. Single line fields have only one cell whereas a multiple line
  5558. field has one cell per line. Since only text and numeric fields can be
  5559. multi-lined, only text and numeric fields can have more than one cell.
  5560.  
  5561.      IDs consist of one or two capital letters optionally followed by
  5562. one or two digits.  The letters describe a field uniquely while the
  5563. numbers identify the line or cell within the field.
  5564.  
  5565.      Examples of IDs:
  5566.  
  5567.      L                        B3
  5568.      AA1                      Q11
  5569.  
  5570. Specifying Commands
  5571.  
  5572.      You specify field commands using the Command Edit window which is
  5573. displayed by selecting "Commands " on the Field menu or by pressing
  5574. (ALT+F10). This window is actually a pane that appears at the top of you
  5575. screen so that your document is not obscured. Among other things, this
  5576. window allows you to enter the actual command, view commands that
  5577. already exist in fields, and copy similar existing commands to other
  5578. fields. You can also give a field a more memorable name if desired.
  5579.  
  5580.  
  5581.  
  5582.  
  5583.  
  5584.  
  5585.  
  5586.  
  5587.  
  5588.             Surefire User's Guide         Page 87
  5589.  
  5590.      
  5591.      In the Command Edit window there is a label called "ID:".  To the
  5592. right of this label is the field ID of the current field cell.  This is
  5593. the unique identifier assigned by Surefire when the field was created or
  5594. enlarged. The command contained by the current cell is shown next to the
  5595. label "Cmd:".  You can edit field commands on the two lines labeled as
  5596. "Edit:".  This is called the edit area.
  5597.  
  5598.    Entering Field Commands
  5599.  
  5600.      You can enter a field command by typing the command into the edit
  5601. area. Once the command is in the edit area, you put it in the current
  5602. field or cell (whose ID is shown) by using a paste or paste & keep
  5603. operation.  These are the same paste operations that you learned in
  5604. word-processing. Paste will put the command into the cell and clear the
  5605. edit area while paste & keep will put the command into the cell but will
  5606. not clear the edit area. Generally, paste & keep is used to put the same
  5607. or similar commands into other fields. You will learn more sophisticated
  5608. methods for entering and manipulating commands in the next chapter.
  5609.  
  5610.      Except for numeric fields, there can only be one field command per
  5611. field. Each cell of a multiple line numeric field, however, may have its
  5612. own field command.
  5613.  
  5614.    Executing Field Commands
  5615.  
  5616.      When a command is executed, it does what it was specified to do. If
  5617. it is to add two numbers, then the numbers are added and the result is
  5618. displayed in the numeric field containing that command. If, however, the
  5619. command had a function to go to another page, execution would mean that
  5620. Surefire would scroll the document to the specified page. Execution of
  5621. a command can also mean putting the value of one cell or the result of
  5622. some function into another cell in the document.
  5623.  
  5624.      There are various ways in which a command can be executed.  The
  5625. best way depends on the type of command and the size of the document.
  5626. Commands can be executed individually or, all commands on a page or the
  5627. entire document can be executed at the same time.  Each of the methods
  5628. of command execution will be discussed in the next chapter.
  5629.  
  5630.      If a command was specified incorrectly, Surefire will not know what
  5631. you want it to do so it will fill the field with E's to indicate an
  5632. error.  The E's go away if the field is cleared or the command is
  5633. corrected and re-executed.
  5634.  
  5635. Specifying Functions
  5636.  
  5637.      Functions allow you to perform more sophisticated operations on
  5638. field values than you can with operators alone. All functions in
  5639. Surefire start with the special character "@". If a function uses
  5640. arguments, these arguments are specified within parentheses and each is
  5641. separated by a comma. Arguments supply the data or information needed by
  5642. the function to do its job. The function @SQRT(n) requires one argument
  5643. while the function @SUBSTR(text, start, len) requires three.
  5644.  
  5645.  
  5646.  
  5647.  
  5648.  
  5649.  
  5650.  
  5651.  
  5652.             Surefire User's Guide         Page 88
  5653.  
  5654.  
  5655.      To see which functions are available for building your commands you
  5656. can display a pop-list of functions while the cursor is in the edit area
  5657. of the Command Edit window. This is similar to the way you can list
  5658. functions in the Calculator except here the functions are not just
  5659. numeric functions. Type (ALT+Z) to display a pop-list of all available
  5660. functions with placeholders for their arguments. You may scroll through
  5661. this list to find the one you want. Typing (Enter) will cause the
  5662. highlighted function to be put into the edit area starting where the
  5663. cursor was when you typed (ALT+Z). You can then replace the dummy
  5664. arguments with the right values or field IDs and continue.
  5665.  
  5666.      All functions available in Surefire are described in "Appendix A:
  5667. Surefire Function Reference".
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.  
  5690.  
  5691.  
  5692.  
  5693.  
  5694.  
  5695.  
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701.  
  5702.  
  5703.  
  5704.  
  5705.  
  5706.  
  5707.  
  5708.  
  5709.  
  5710.  
  5711.  
  5712.  
  5713.  
  5714.  
  5715.  
  5716.  
  5717.             Surefire User's Guide         Page 89
  5718.  
  5719.  
  5720. Chapter 15     -    Using Field Commands
  5721.  
  5722.      We introduced you to field commands in the previous chapter. In
  5723. this chapter you will learn and practice more sophisticated concepts
  5724. involving commands. These include viewing and editing existing commands,
  5725. and formulating specific types of commands to do different tasks. Below
  5726. is a list of topics that are covered.
  5727.  
  5728.                Viewing and Editing Commands
  5729.                IDs and References
  5730.                Tracing References
  5731.                Assignment Statements
  5732.                Multiple Statements
  5733.                Field Operations
  5734.                Control Operations
  5735.                More About Command Execution
  5736.  
  5737.  
  5738. Viewing and Editing Commands
  5739.  
  5740.      You may view and edit field commands using the Command Edit window.
  5741. As you saw in the previous chapter, this window is displayed by
  5742. selecting "Commands.. " on the Field menu or by pressing (ALT+F10).
  5743. Among other things, this window allows you to enter the actual command,
  5744. view commands that already exist in fields, and copy similar existing
  5745. commands to other fields. You can also give a field a more memorable
  5746. name if desired.
  5747.  
  5748.      As you may recall, if a '#' is displayed at the far right of the
  5749. status line, the current field or cell contains a command. This lets you
  5750. know if a command exists without the Command Edit window being open.
  5751. This is often very handy.
  5752.  
  5753.    IDs and Names
  5754.  
  5755.      Any cell in your document can optionally be named. When you give a
  5756. cell a name, this name can be used instead of its pre-assigned ID.
  5757. Giving a name improves the readability of expressions and database
  5758. queries.  For example, if A1 represented number of hours worked and B2
  5759. represented the hourly pay rate, the expression  "A1 * B2" may now read
  5760. as "hours * rate" after you name the cells A1 and B2.
  5761.  
  5762.      Note:   A multiple line text field may have only one name for the
  5763. entire field.
  5764.  
  5765.      You specify a field name by typing it in next to the label "Name:"
  5766. in the Command Edit window. Surefire ensures that names are also unique
  5767. within a single document.  Names must begin with 3 lower case letters
  5768. optionally followed by letters, numbers or an underscore (_).
  5769.  
  5770.      Examples of Names
  5771.      salary
  5772.      phoneline1
  5773.      lease_date
  5774.  
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.  
  5782.             Surefire User's Guide         Page 90
  5783.  
  5784.  
  5785.    Viewing Field Commands
  5786.  
  5787.      Through the Command Edit window you can view every cell's command.
  5788. To do this you move to the document while the Command Edit window is
  5789. open. Once here, you may move around the document as usual, using the
  5790. cursor movement keys. While the cursor is in the document, moving from
  5791. cell to cell will cause the field ID and field command information in
  5792. the Command Edit window to reflect the current cell. You may move the
  5793. cursor to the document and back to the Command Edit window by pressing
  5794. (Shift + Tab).
  5795.  
  5796.    Editing Field Commands
  5797.  
  5798.      In the Command Edit window, the command contained by the current
  5799. cell is shown next to the label "Cmd:".  You can edit field commands in
  5800. the edit area which is to right of the two lines labeled "Edit:".
  5801.  
  5802.      To edit a command that is already in a cell, you use the Cut and
  5803. Copy operations that you became familiar with in the Word Processing
  5804. chapters. When the cursor is in the edit area, Cut (ALT+F1) will remove
  5805. the command from the current cell and place it in the edit area.  Copy
  5806. (ALT+F2) will put a copy of the command into the edit area.
  5807.  
  5808.      Once the command is in the edit area, you may change it by using
  5809. any of the text editing operations with which you are already familiar.
  5810. Afterwards, you can put the command back in the cell by using a Paste or
  5811. Paste & Keep operation.  Paste (ALT+F3) will put the command into the
  5812. cell and clear the edit area while Paste & Keep (ALT+F4) will put the
  5813. command into the cell but will not clear the edit area. You can use
  5814. Paste & Keep to put the same or similar commands into other fields.
  5815.  
  5816.      More than two lines are available for commands, however.  If more
  5817. room is needed, you can scroll the edit area.  Up to ten lines can be
  5818. used for field commands. When there is more text in the edit area than
  5819. you can see, an arrow on the edit area's right side indicates the
  5820. direction in which there is more text. You can use the arrow keys to
  5821. access up to a full ten lines for more complex command statements.
  5822.  
  5823.      Say a cell has a rather complex command that actually takes four
  5824. lines. Initially, the first line is next to the Cmd: label.  The
  5825. right-pointing arrow at the far right of this line indicates that there
  5826. is more to the command than you can see. If you copy the command from
  5827. the cell to the edit area and press (down arrow) to scroll down one
  5828. line, the edit area will display lines 2 and 3 of the command. The up
  5829. and down arrows at the far right of the edit area indicate that there is
  5830. more of the command both before and after the two lines that can be seen
  5831. in the edit area. You can use the (up and down arrow) keys to scroll the
  5832. text in the edit area and access all of the command.
  5833.  
  5834.  
  5835.  
  5836.  
  5837.  
  5838.  
  5839.  
  5840.  
  5841.  
  5842.  
  5843.  
  5844.  
  5845.  
  5846.  
  5847.             Surefire User's Guide         Page 91
  5848.  
  5849.  
  5850.      The command in the edit area of the Command Edit window can also be
  5851. edited when the cursor is in the document. When the Command Edit window
  5852. is open and the cursor has been moved to the document by pressing
  5853. (Shift+Tab), you can move through the document without altering either
  5854. the document or field values.
  5855.  
  5856.      The characters that you type at the keyboard will be put directly
  5857. into the command edit area.  As you move around in the document, you can
  5858. "point" to cells that you want in your expression in order to obtain
  5859. their IDs. That is, you can enter the ID of a cell by pressing
  5860. (Ctrl+Enter) when the cursor is on that cell. This is especially useful
  5861. for building expressions based on fields in the document whose IDs you
  5862. do not know.
  5863.  
  5864. Pasting Values From the Calculator
  5865.  
  5866.      If you display the Calculator while the Command Edit window is
  5867. opened, you may enter the result of your calculation directly into the
  5868. edit area.  Just use the Calculator as described in Chapter 10. When the
  5869. result you desire is in the result area of the Calculator, choose PASTE.
  5870. The value will be entered into the edit area of the Command Edit window
  5871. at the current cursor location.
  5872.  
  5873.  
  5874. IDs and References
  5875.  
  5876.      As you recall, a field ID is automatically assigned by Surefire
  5877. when a field is created and is guaranteed to be unique for the document.
  5878. This ID is used in commands to reference or represent each individual
  5879. cell in a document.  IDs consist of one or two capital letters
  5880. optionally followed by one or two digits.  The letters describe a field
  5881. uniquely while the numbers identify the line or cell within the field.
  5882.  
  5883.      A simple use of referencing is to take the value in one cell and
  5884. display it in another cell.  If the fields L and M are the same data
  5885. types, the value in  L can be displayed in M by defining "L" as the
  5886. command for M. When the field command in cell M is executed, whatever
  5887. value is currently contained in L will be displayed in M.
  5888.  
  5889.      A field ID can also be used to reference an entire field whether it
  5890. is a multiple or single line field.  This is done by using only the
  5891. letter prefix of the ID.  Since date, and logical fields can only be
  5892. single line or have one cell, the letter prefix, with or without the
  5893. digit '1', can be used interchangeably. The digit part is usually
  5894. dropped. For example, if a date field is C, then either C or C1 can
  5895. reference the field. The same holds for single line text and numeric
  5896. fields.
  5897.  
  5898.      There are different rules for referencing numeric versus text
  5899. multiple line fields depending on what you want to happen.  In some
  5900. cases you can use the complete field ID and in others you use the letter
  5901. prefix only. These differences are described later in the sections on
  5902. numeric and text fields.
  5903.  
  5904.  
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.             Surefire User's Guide         Page 92
  5913.  
  5914.  
  5915.    Ranges
  5916.  
  5917.      A range is a way of specifying a group of fields or cells. You
  5918. specify a range by typing the ID's of two fields or cells with a colon
  5919. (:) between them.  These two cells define a rectangle in which all cells
  5920. that are completely contained within the rectangle make up the range of
  5921. cells.  The first cell is the upper left corner and the second cell is
  5922. the lower right corner of this rectangle. If multi-lined fields are used
  5923. to define a range, you must specify the individual cells that bound the
  5924. rectangle.
  5925.  
  5926.      Ranges can be used to copy commands or assign values to more than
  5927. one field at a time or as a short-hand way to indicate a numeric sum.
  5928.  
  5929.      Range Example 1
  5930.  
  5931.      Say you have two 3-cell numeric fields called A and B that are side
  5932.      by side.
  5933.                          A1        B1
  5934.                          A2        B2
  5935.                          A3        B3
  5936.  
  5937.      The range A1:B3 contains all 6 cells. Because A and B are
  5938.      multi-lined fields, A:B is not a valid range.
  5939.  
  5940.      Range Example 2
  5941.  
  5942.      Say you have four single cell fields: Q, R, S, and T positioned
  5943.      like this:
  5944.                          Q         S
  5945.                          R         T
  5946.  
  5947.      Q:T represents the range of the four fields.
  5948.  
  5949.  
  5950.      Note:  All the cells of a range must be on the same page. That is,
  5951. ranges cannot span pages.
  5952.  
  5953.  
  5954.    Numeric Fields
  5955.  
  5956.      You use the complete field ID to reference a specific cell of a
  5957. numeric field. This is done by specifying the cell number as part of the
  5958. ID.  For example, if we have a 3-cell numeric field called A, each cell
  5959. is referred to as A1, A2 and A3.  When used in a command, each of these
  5960. references correspond to the value contained in each cell of field A.
  5961.  
  5962.    Sum of Numbers
  5963.  
  5964.      For numeric fields you may use only the letter prefix  of a field
  5965. ID by itself  to imply a sum of all the cells in that field.  This is
  5966. convenient way to do the very common operation of summing groups of
  5967. numbers.
  5968.  
  5969.  
  5970.  
  5971.  
  5972.  
  5973.  
  5974.  
  5975.  
  5976.  
  5977.             Surefire User's Guide         Page 93
  5978.  
  5979.  
  5980.      Shorthand Summation 1
  5981.  
  5982.      If field D contained the cells D1, D2, D3, D4, and we put just D as
  5983.      a field command for field B, B would display the sum of the numbers
  5984.      in D, or "D1 + D2 + D3 + D4".
  5985.  
  5986.      You can also use a reference to a range of numeric cells to
  5987.      indicate a sum.
  5988.  
  5989.      Shorthand Summation 2
  5990.  
  5991.      If there are two 3-cell numeric fields, A and B, side by side, the
  5992.      sum "A1 + A2 + B1 + B2" can be expressed as the range "A1:B2". The
  5993.      command A1:B2 can be put into field C to display the sum.
  5994.  
  5995.      Note:   Text fields and date fields within a range are ignored,
  5996. however the range must be specified by two numeric (or logical) cells.
  5997. Logical fields with a True value will have the numeric value 1. Logical
  5998. fields with a False value will have the numeric value 0.
  5999.  
  6000.    Text Fields
  6001.  
  6002.      When you use only the letter prefix of a text field, you will be
  6003. using or setting the value of the entire field.  You may reference an
  6004. individual line of the field if you are interested in the text in that
  6005. particular line. For text fields the number part of the ID corresponds
  6006. to a line. number. This is useful when you want to assign a string value
  6007. to a specific line of the field. Or, you may want the text of a given
  6008. line only to be used in a command.
  6009.  
  6010.      Note:   If the string does not fit in the particular line of the
  6011. field, it will be truncated. Truncation means that the part that does
  6012. not fit will be lost.
  6013.  
  6014.      The following example shows how text fields can be referenced.
  6015.  
  6016.      Text field M has 3 lines: M1, M2 and M3. M is 12 characters wide:
  6017.  
  6018.           M1 "first line  "
  6019.           M2 "second line "
  6020.           M3 "third line  "
  6021.  
  6022.      The command M2 = "this is a happy day" sets M2 to "this is a ha".
  6023.  
  6024.      The command C = M3 would set the value of the single line field C
  6025.      to the text in M3 or the third line of field M. That is, C would
  6026.      get the text "third line".
  6027.  
  6028.      If C were 36 characters wide, the command C = M would set C to
  6029. "first line  second line third line" or the text from all lines of M
  6030. strung out end to end.
  6031.  
  6032.      But if C were an 18 character 2 line field, the command C = M would
  6033. put all three lines of M into the 2 lines of C.
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.             Surefire User's Guide         Page 94
  6043.  
  6044.  
  6045. Tracing References
  6046.  
  6047.      Sometimes you may have a rather complex expression in your field
  6048. command with references to various fields. It then becomes difficult to
  6049. know which field in the document corresponds to each reference in this
  6050. command. Surefire alleviates this problem by allowing you to highlight
  6051. the cell in the document that corresponds to a reference. This is called
  6052. tracing. Tracing will work for references by field ID and references by
  6053. field names.
  6054.  
  6055.      To trace a command you can use (Ctrl + N), (Ctrl + P) and (Ctrl +
  6056. T) while the cursor is in the edit area of the Command Edit window.
  6057. Pressing (Ctrl + N) will cause Surefire to scan the command string, find
  6058. the next reference to a cell in your document, then scroll the document
  6059. and highlight the corresponding cell. By looking at the context of the
  6060. cell in the document and how that cell is used in a command, you have
  6061. better control of your field commands.  (Ctrl + P) will scan the command
  6062. backward instead, looking for the previous reference.  And, (Ctrl + T)
  6063. will locate the reference that is at the cursor.
  6064.  
  6065.           To Highlight             Press
  6066.  
  6067.           The next reference       Ctrl + N
  6068.           The previous reference   Ctrl + P
  6069.           The current reference    Ctrl + T
  6070.  
  6071. Assignment Statements
  6072.  
  6073.      Normally, the result of a command in a field or cell is displayed
  6074. in the field or cell that contains the command. Sometimes you may want
  6075. to put the result elsewhere.  This is done by assignment.  The following
  6076. table lists the types of assignments that may be used in field commands.
  6077.  
  6078.      Assignment Form     Meaning
  6079.  
  6080.      cell = n            Numeric Assignment - Put n in field.
  6081.      field = date        Date Assignment - Put date in date field.
  6082.      field = string      Text Assignment - Put string in text field.
  6083.      cell = string       Text Assignment - Put string in specific line
  6084.                          of text field.
  6085.      range = n           Numeric Range Assignment - Put n in all
  6086.                          numeric cells in range.
  6087.      range = date        Date Range Assignment - Put date in all date
  6088.                          fields in range.
  6089.      range = string      Text Range Assignment - Put string in all text
  6090.                          fields in range.
  6091.  
  6092.  
  6093.    Implicit Assignment
  6094.  
  6095.      You use implicit assignment (no '='), to put an expression or
  6096. function result into the cell containing the field command. When you
  6097. have a field command without an assignment, the result of the command
  6098. will be entered into the same field or cell that contains that command.
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.             Surefire User's Guide         Page 95
  6108.  
  6109.  
  6110.     Explicit Assignment To a Field
  6111.  
  6112.      You use explicit assignment (with an '=') to put the result of an
  6113. expression somewhere explicitly.  Assignment is done by specifying the
  6114. ID or name of the cell or field into which you want a result put,
  6115. followed by "=", which is then followed by the command expression. For
  6116. example, "A = B*10" will multiply the value of B by 10 and put the
  6117. result in A.
  6118.  
  6119.    Assignment To a Range of Cells
  6120.  
  6121.      Assignments can also be made to a range of cells. This is done by
  6122. using the range operator ":" to describe the range, followed by an equal
  6123. sign '=', which is then followed by the command expression. For example,
  6124. if you want all cells in the range A1:D3 to be cleared to zero when
  6125. button X is pushed, the command in X would be "A1:D3 = 0".
  6126.  
  6127. Multiple Statements
  6128.  
  6129.      Occasionally you may want to put more than one expression or
  6130. statement in a command line. All of these statements will be evaluated
  6131. before evaluating the command in another cell. To have multiple
  6132. statements, separate each statement with a semicolon ';'. There must be
  6133. no semicolon after the last statement.
  6134.  
  6135.      If a field command with multiple statements uses implicit
  6136. assignment more than once, the result of the last such command will be
  6137. displayed in the cell.
  6138.  
  6139. Operating with Numbers
  6140.  
  6141.      Mathematical expressions result in numbers which are usually
  6142. displayed as values in one or more numeric fields. They can also be used
  6143. in some cases as arguments to functions for other data types. As
  6144. discussed earlier in the Calculator chapter, mathematical expressions
  6145. are generally created from numbers, numeric operators and functions.
  6146. Surefire supports the following numeric operators:
  6147.  
  6148.      Two number operators     One number operators
  6149.  
  6150.      +    Addition            -         Negation
  6151.      -    Subtraction
  6152.      *    Multiplication
  6153.      /    Division
  6154.  
  6155.      Numeric field commands include simple expressions like 54 * 10 and
  6156. expressions that contain field references, like (A - 45)/B * 100. In the
  6157. second expression, A and B represent the numbers that are contained in
  6158. other numeric fields with IDs of A and B respectively.  Numeric commands
  6159. can also contain functions.  For example, @PI * A * A calculates the
  6160. area of a circle where the radius is the value in the field called 'A'.
  6161. @PI is a function.
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.             Surefire User's Guide         Page 96
  6173.  
  6174.  
  6175.      There are general mathematical functions including one to obtain
  6176. the absolute value of a number and one that determines a number's square
  6177. root.  There are trigonometric functions like @SIN and @COS and
  6178. logarithmic functions.  There are also financial analysis and
  6179. statistical functions. All numeric functions are also available in the
  6180. Calculator. They are all completely described in "Appendix A: Surefire
  6181. Function Reference".
  6182.  
  6183. Operating with Text
  6184.  
  6185.      While numeric expressions result in a number, textual expressions
  6186. result in a string of text.  This implies that a textual expression can
  6187. be a field command for a text field.  The simplest text expression
  6188. involves concatenation.  Concatenation is as simple as adding two
  6189. numbers together but instead it combines two text strings into one by
  6190. putting one after the other.  The operator "&" is used for
  6191. concatenation.
  6192.  
  6193.      Example Joining Strings
  6194.  
  6195.      The two strings "foot" and "ball" can be concatenated with the
  6196.      command "foot" & "ball".  When executed, the single string
  6197.      "football" will be the result displayed in the text field.
  6198.  
  6199.      Any string can be specified in a command by being in quotation
  6200. marks. This is called a string constant. Let's look at another example
  6201. of operating on text that will combine concatenation with field values
  6202. and string constants. Suppose you wanted to construct a sentence like
  6203. "Big girls          " where some information was already set and some
  6204. could be filled in.
  6205.  
  6206.      Another Example Joining Strings
  6207.  
  6208.      Let's set things up so that you can specify the third word of the
  6209.      sentence in a separate field. We will enter the missing word in
  6210.      text field A. Text field B will display the resulting sentence. To
  6211.      do this, you put this command into B: "Big girls " & A & "."
  6212.  
  6213.      The resulting string is the concatenation of 3 strings; one from
  6214.      another text field, A, and two from within the command itself.
  6215.      Notice that the period '.' which ends the sentence is a string.
  6216.  
  6217.      Surefire provides many text functions to manipulate text values.
  6218. The result of a text function or at least one argument is a text string
  6219. or reference to a text field.  For example, the function @SUBSTR() finds
  6220. a string within a string (or substring), of a given text field or text
  6221. constant.  If field R has the value "mission", the command @SUBSTR(R, 0,
  6222. 4) would result in the string "miss".
  6223.  
  6224.  
  6225.  
  6226.  
  6227.  
  6228.  
  6229.  
  6230.  
  6231.  
  6232.  
  6233.  
  6234.  
  6235.  
  6236.  
  6237.             Surefire User's Guide         Page 97
  6238.  
  6239.  
  6240.      Some text functions yield numeric results which can be used in
  6241. mathematical expressions. For example, the function @LENGTH(string)
  6242. returns the number of characters in a string. This number can then be
  6243. divided into 80 to see how many times the string would fit on a line of
  6244. a page. Likewise, if a text function required a number as an argument,
  6245. this argument can be any mathematical expression. All text functions are
  6246. described in "Appendix A: Surefire Function Reference".
  6247.  
  6248. Conditions and Logical Expressions
  6249.  
  6250.      You use a condition to do some action or assign some value "IF"
  6251. something is either true or false. For example, in calculating your
  6252. taxes, you would want the amount owed to always be zero if you had a
  6253. loss. Alternatively if you made a profit then you would make sure that
  6254. the amount owed was some number greater than zero.
  6255.  
  6256.      Logical expressions are used to determine the value of a condition
  6257. or a value to be displayed in a logical field. They always yield the
  6258. result of True or False. If the value is displayed in a logical field,
  6259. it will be in one of the 4 formats that you had chosen for that field.
  6260. The table below shows what will be displayed in a field.
  6261.  
  6262.      Format         Display if True          Display if False
  6263.  
  6264.      Y/N            Y                        N
  6265.      On/Off         On                       Off
  6266.      YES/NO         YES                      NO
  6267.      True/False     True                     False
  6268.  
  6269.      Any mathematical expression can be a logical expression.  This is
  6270. because the value zero is always defined to be the same as False and all
  6271. other numbers are defined to be True.
  6272.  
  6273.      After you know how to enter field commands, you can verify this
  6274. with the following exercise. Create a numeric field A and a logical
  6275. field B.  Put the command "A" in the field B. When you type 0 in field
  6276. A, you will see the word "False" or "No", etc. displayed in B.  Any
  6277. other number will produce the opposite result.
  6278.  
  6279.      A logical value can also be explicitly defined by using the
  6280. functions @TRUE and @FALSE.  These are in fact equivalent to using the
  6281. numbers 1 for True and 0 for False, but are much more readable.
  6282.  
  6283. Logical Operators
  6284.  
  6285.      Logical values can result from logical expressions which are
  6286. constructed by using logical operators and possibly logical functions.
  6287. Surefire supports the following operators:
  6288.  
  6289.      Operator  Meaning
  6290.  
  6291.      =         Equal To
  6292.      <         Less Than
  6293.      < =       Less Than or Equal To
  6294.  
  6295.  
  6296.  
  6297.  
  6298.  
  6299.  
  6300.  
  6301.  
  6302.             Surefire User's Guide         Page 98
  6303.  
  6304.  
  6305.      Operator  Meaning (cont)
  6306.  
  6307.      >         Greater Than
  6308.      > =       Greater Than or Equal To
  6309.      <>        Not Equal To
  6310.  
  6311.      Note:   These operators require a number or mathematical expression
  6312. on either side of the operator in order to be evaluated.
  6313.  
  6314.      Examples of Logical Expressions
  6315.  
  6316.      age < 50
  6317.      balance < = 0
  6318.      emplnum = 468
  6319.  
  6320. Complex Logical Expressions
  6321.  
  6322.      You can make even more complex logical expressions by using the
  6323. logical operators #AND# and #OR# to combine logical expressions
  6324. together. You can also use an additional operator #NOT#. This takes
  6325. the logical expression right after it, evaluating it as if it were just
  6326. the opposite. True expressions are looked at as False and vice-versa.
  6327.  
  6328.      Examples of Complex Logical Expressions
  6329.  
  6330.      salary < 15000 #AND# dept <> 15
  6331.      age > 60 #OR# weight > 200
  6332.  
  6333. Logical Condition Function
  6334.  
  6335.      A logical condition function does something different based on
  6336. whether the given logical expression is True or False. To do this there
  6337. is a special function:
  6338.  
  6339.      @IF(condx, true, false)
  6340.  
  6341.      The condition condx is a logical expression. If condx evaluates to
  6342. True, then the function specified as the argument true is executed,
  6343. otherwise the condition must be false, so the function specified as the
  6344. argument false is executed instead.
  6345.  
  6346.      Logical Condition Function Example
  6347.  
  6348.      Make sure a negative tax is never calculated. Assume we have a
  6349.      simple tax rate of 10% and the following command:
  6350.  
  6351.           @IF( A1 > 0,A1 *.10,0 )
  6352.  
  6353.      Surefire will take the value in cell A1, the income, and see
  6354.      whether it is greater than 0.  If it is, it is multiplied by .10 to
  6355.      give 10 percent of it.  Otherwise, the result is set to the third
  6356.      argument, zero.
  6357.  
  6358. Note:  Multiple statements are not supported within @IF functions.
  6359.  
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.  
  6366.  
  6367.             Surefire User's Guide         Page 99
  6368.  
  6369.  
  6370. Control Operations
  6371.  
  6372.      Control operations are field commands that cause some action to
  6373. take place. These actions include moving to a particular page or field
  6374. of your document, and displaying a different document altogether.
  6375. Control functions are functions that perform an immediate action.
  6376. Because the result is an action, these functions are generally used with
  6377. button fields or in commands with the Execute on Enter prefix "[".
  6378. You can even use button fields and their commands to do such things as
  6379. pass a field value between documents.
  6380.  
  6381.      There are various types of control functions. There are functions
  6382. to run a DOS command from a Surefire document, to define help contexts
  6383. for your own Surefire applications and to display Surefire document
  6384. screens one after the other as an automatic presentation. All control
  6385. functions are fully described in "Appendix A: Surefire Function
  6386. Reference". The following sections discuss topics that are important
  6387. when using control functions.
  6388.  
  6389. Errors in Control Functions
  6390.  
  6391.      Control functions generally return a logical value.  If this is a
  6392. True value, the function was executed as expected.  If a False was
  6393. returned, there was some sort of problem. A False returned from an
  6394. @GODOC, @RETURN, or the database control function @JOIN will stop
  6395. execution of the remaining statements for that command string, if there
  6396. are any.  For all other control functions,  Surefire will display
  6397. "COMMAND ERROR" in the status line but will attempt to continue
  6398. processing the remaining statements of the command.
  6399.  
  6400. Document Levels
  6401.  
  6402.      Some control functions cause Surefire to display a different
  6403. document than the one currently displayed. These functions are @GODOC,
  6404. @RETURN, and the database command function @JOIN. Each time @GODOC or
  6405. @JOIN is successfully executed, Surefire displays a document.  This
  6406. document is considered to be at a new document level.
  6407.  
  6408.      You return to the document at the previous level by executing
  6409. @RETURN or by indicating an implicit  return by pressing (Esc). The
  6410. @RETURN function also has an optional argument that allows you to return
  6411. by more than one level. This will skip the display of intervening
  6412. documents.
  6413.  
  6414.      Surefire maintains the hierarchy of document levels until you exit
  6415. Surefire or explicitly read a document by choosing Get or New from the
  6416. File menu.
  6417.  
  6418. Changing Directories
  6419.  
  6420.      The same control functions that affect document levels may also
  6421. cause Surefire to change directories. You can specify that a document
  6422. named in an @GODOC or @JOIN command is in a different directory by
  6423. specifying "name" as a relative path name. When the @GODOC or @JOIN are
  6424.  
  6425.  
  6426.  
  6427.  
  6428.  
  6429.  
  6430.  
  6431.  
  6432.             Surefire User's Guide         Page 100
  6433.  
  6434.  
  6435. successfully executed, Surefire will change directories prior to looking
  6436. for and reading the document.
  6437.  
  6438.      Once the document is displayed, all references to other documents
  6439. are expected to be in the new directory just as if you had used the
  6440. Setup window to change the directory. One difference between changing
  6441. directories this way and using Setup is that you will eventually return
  6442. to a document in the original directory.  You will return to the
  6443. previous directory when you return from the first document that you
  6444. displayed in this other directory.
  6445.  
  6446.  
  6447. More About Command Execution
  6448.  
  6449.      There are various ways in which a command can be executed.  The
  6450. best way depends on the type of command to be executed and the size of
  6451. the document.  Sometimes you may desire to have an individual command
  6452. executed by pressing a button or after entering a value. Another
  6453. application may require you to occasionally recalculate all the commands
  6454. within the document.  For large spreadsheets, you want to recalculate
  6455. only the commands on the page on which you are working. You may also
  6456. choose to have Surefire execute commands in a vertical or horizontal
  6457. order. The following sections discuss the four methods of execution,
  6458. horizontal versus vertical ordering, and what happens if Surefire cannot
  6459. execute a command.
  6460.  
  6461.    Automatic Command Execution
  6462.  
  6463.      When commands are executed automatically, all commands within the
  6464. document are executed whenever the value of any field is changed. It is
  6465. necessary to execute all of them since other commands may depend on the
  6466. value that was just entered.  When the document is small or the
  6467. information within fields is changed infrequently, this is a very
  6468. satisfactory way to assure all calculations are current.
  6469.  
  6470.      This feature can be turned on or off by choosing "Auto Calc" on the
  6471. Field menu.  In addition, you may select an option in the Setup window
  6472. to have auto calc be set by default whenever you use a Surefire
  6473. document.  An "X" on the menu indicates that auto calculate is on.
  6474.  
  6475.      Note:    When Auto Calc is not on, and values have been changed in
  6476. the document, a 'C' is displayed at the far right of the status line.
  6477. This indicates that a recalculation needs to be performed.
  6478.  
  6479.    Explicit Execution by Page or Document
  6480.  
  6481.      When Auto Calc is off, you need a way to tell Surefire to go ahead
  6482. and do the calculations. You can specify that either all commands on a
  6483. single page, or that all commands in the document, are to be executed.
  6484.  
  6485.     All commands contained in fields on the currently displayed page
  6486. can be recalculated by pressing (F9).  Since you normally work on one
  6487. page at a time, this is convenient and requires comparatively little
  6488. processing overhead. You can also force the calculation of all
  6489.  
  6490.  
  6491.  
  6492.  
  6493.  
  6494.  
  6495.  
  6496.  
  6497.             Surefire User's Guide         Page 101
  6498.  
  6499.  
  6500. non-immediate commands within the document by choosing "Calc All" on
  6501. the Field menu or by pressing (Shift + F9). Immediate commands are those
  6502. that are in button fields or those set to Execute on Enter (see below).
  6503. Non-immediate commands are all others.
  6504.  
  6505.    Execution by Buttons
  6506.  
  6507.      Button fields have their own rules about when their commands are
  6508. executed.  When you push a button, be it a doorbell or a button within
  6509. a Surefire document, you expect the action performed to be immediate. In
  6510. the case of the doorbell, a sound is made.  In the case of a Surefire
  6511. button, the command is executed when you press (Enter).
  6512.  
  6513.    Execute on Enter
  6514.  
  6515.      Sometimes you may want to have a command executed just after
  6516. information is entered into the field or cell containing the command.
  6517. This is similar to the way buttons behave.  To do this, you prefix the
  6518. command by a special character '[' (left bracket).  When a [ is the
  6519. first character of the command, Surefire knows to execute the command
  6520. when you change the data in the field. This command will not be executed
  6521. at any other time.
  6522.  
  6523.      To tell Surefire that you are changing a field value, you first
  6524. type or select the new value. You then enter the value by pressing
  6525. (Enter) or by moving the cursor off of the field. For example, putting
  6526. the command [ @GOPAGE(5) in a numeric, date, text or logical field will
  6527. display page 5 of your document when you enter a value in the field.
  6528.  
  6529.    Order of Execution
  6530.  
  6531.      When you execute commands by page or document, the order  in which
  6532. the fields are traversed and the commands executed may affect the
  6533. results of some calculations.  If you understand this order, you could
  6534. prevent getting improper results. Usually commands are executed is the
  6535. same order that you read text on a page. That is, from left to right and
  6536. down or horizontally.  This is a natural way to look at information in
  6537. many Surefire documents.
  6538.  
  6539.      Sometimes, especially in spreadsheet-like applications, you want to
  6540. think of things in columns arranged from left to right.  If this is the
  6541. case, it might be more appropriate to have Surefire execute commands on
  6542. a column by column basis or vertically.  You will learn how to specify
  6543. this distinction in the following chapter entitled "Spreadsheets".
  6544.  
  6545.  
  6546. Command Errors
  6547.  
  6548.      If you specify a command incorrectly, Surefire will not know what
  6549. you want it to do so it will fill the field containing the command with
  6550. E's to indicate an error.  In addition, the status indicator "COMMAND
  6551. ERROR" will be displayed for a few moments in the upper right corner of
  6552. your screen. The E's will go away if you clear the field (press Ctrl+K)
  6553. or correct and re-execute the offending command.
  6554.  
  6555.  
  6556.  
  6557.  
  6558.  
  6559.  
  6560.  
  6561.  
  6562.             Surefire User's Guide         Page 102
  6563.  
  6564.  
  6565. Chapter 16     -         Spreadsheets
  6566.  
  6567.      In Surefire, it is not necessary to lay out your fields to look
  6568. like the rows and columns of a conventional spread sheet.  As you have
  6569. seen, you can have fields anywhere within a document page, embedded in
  6570. text paragraphs or not. Sometimes, however, you may want to use fields
  6571. that are arranged in rows and columns.  This is especially useful in
  6572. accounting applications such as expense reports, budgets and cash flow
  6573. statements.
  6574.  
  6575.      In this chapter, you will see how to create fields that present a
  6576. tabular view of information normally called spreadsheets.  Of course,
  6577. the "what-if" analysis is naturally supported by Surefire's field
  6578. commands and methods of command execution.
  6579.  
  6580. Creating a Spreadsheet
  6581.  
  6582.      To create a spreadsheet in Surefire you first create the number of
  6583. multiple line numeric fields that you desire.  Each multiline field
  6584. represents a column and each line of field cells represents a row. For
  6585. example if you want to create a 10x10 spreadsheet, you would create 10
  6586. multiline numeric fields that are side by side. Each of these fields
  6587. should have 10 cells. If you desire, you can label the columns A, B, C,
  6588. .... J, and the rows 1, 2, 3, .... 10 by editing the document. Once you
  6589. have a spreadsheet document like this, you can save it and use copies
  6590. for various purposes. You can put commands into any or all of the cells
  6591. in your document to do your analysis.
  6592.  
  6593. Using a Spreadsheet
  6594.  
  6595.      Once you have a document with fields that are laid out as a
  6596. spreadsheet, you use it the same way that you use any document in
  6597. Surefire. You give the cells of the spreadsheet any desired field
  6598. commands, enter field values as needed, and press (F9) to execute the
  6599. commands and compute your results.
  6600.  
  6601. Absolute and Relative References
  6602.  
  6603.      A command can be copied from one cell to another by using Cut &
  6604. Paste as described in the previous chapter. Normally these commands are
  6605. copied exactly as they are.  But often you find, especially in
  6606. spreadsheet-like applications, that you need the exact same formula in
  6607. many cells with only the references changed by some regular means.
  6608. Surefire and many spreadsheet programs handle this by using the concepts
  6609. of absolute and relative  references.
  6610.  
  6611.      Unlike other spreadsheet programs, Surefire's default is to use
  6612. absolute referencing. This is because, in most instances, Surefire
  6613. fields are laid out in a non-tabular way, making absolute referencing
  6614. more natural.
  6615.  
  6616.      The best way to understand the difference between Absolute and
  6617. Relative references is to describe the location of someone's house in
  6618. two ways. If you say that George is at "123 Main Street", you are giving
  6619.  
  6620.  
  6621.  
  6622.  
  6623.  
  6624.  
  6625.  
  6626.  
  6627.             Surefire User's Guide         Page 103
  6628.  
  6629.  
  6630. the absolute location of his house. No matter where you are, the
  6631. location you are talking about is the actual location of his house. On
  6632. the other hand, if you say he is "3 blocks north of here", you are
  6633. describing where he lives relative to where you are now. Keeping this in
  6634. mind will help you in the following discussions.
  6635.  
  6636.      In Surefire, the terms Absolute and Relative only have meaning when
  6637. a command is put in a field.  Absolute means that the reference remains
  6638. exactly the same no matter where a field command is copied. Say you have
  6639. fields A, B, C and D and cell A1 has the command B1 + C1. If you copy
  6640. this command to D using absolute referencing, the command in D will be
  6641. exactly the same or B1 + C1.
  6642.  
  6643.      When references in a field command are made relative, copying the
  6644. command will adjust the references in a prescribed way.  This adjustment
  6645. is done based on the relative position of the cell containing the
  6646. original command to any cells referenced relatively in that command.
  6647. Let's say you have four multi-celled fields, A, B, C, and D horizontally
  6648. on the screen, each separated from the other by the same distance.
  6649.  
  6650.      If C1 has the command A2 + B2, and you copy this command to D1 with
  6651. relative referencing, the resulting command in D1 will be B2 + C2. This
  6652. is because A2 and B2 are at the same relative position from C1 as B2 and
  6653. C2 are from D1.
  6654.  
  6655. Loading Commands with Relative References
  6656.  
  6657.      If you copy fields in Document edit mode, the field commands for
  6658. the new fields will be cleared while those of the original fields remain
  6659. unchanged. To copy the field commands you must use the Command Edit
  6660. window. When you copy commands, you have control over how the commands
  6661. are copied. You can copy commands relatively provided that the
  6662. destination field cells already exist.
  6663.  
  6664.      A relative copy is set up as follows:  You position to the cell
  6665. that has the desired command and open the Command Edit window. Then,
  6666. copy the command from that cell into the edit area. Now, set the
  6667. "Absolute/Relative" multiple choice button to Relative.  Notice that the
  6668. ID of this cell appears to the right of the button. This tells Surefire
  6669. that all subsequent pastings of this command into other cells will be
  6670. done relative to the cell from which you copied the command. As you copy
  6671. this command into other cells, all the references of the command will be
  6672. adjusted accordingly. This will continue until you either toggle the
  6673. button back to Absolute, Paste the command in a cell or change the
  6674. command in the edit area.
  6675.  
  6676.      If you want to make a relative copy of a command into more than one
  6677. cell, use Paste & Keep instead of Paste. The references will be adjusted
  6678. for each cell until one of the above conditions happen.
  6679.  
  6680.      Note:  If there is a relative reference that can not be adjusted to
  6681. an actual cell in your document with respect to the destination field or
  6682. cell, the absolute cell reference will be copied to that field or cell.
  6683.  
  6684.  
  6685.  
  6686.  
  6687.  
  6688.  
  6689.  
  6690.  
  6691.  
  6692.             Surefire User's Guide         Page 104
  6693.  
  6694.  
  6695. Vertical and Horizontal Relative References
  6696.  
  6697.      Let's think about the analogy of where George lives one more time.
  6698. Suppose we say George is "3 blocks north on Main Street".  Main Street
  6699. could be east or west of us but that doesn't matter because we have
  6700. described its absolute location. However, "3 blocks north" is still
  6701. relative to where we are.  We gave a relative vertical  (eg.
  6702. north/south) direction and an absolute horizontal direction (eg. Main
  6703. Street is either east or west). You can do the same with Surefire
  6704. fields.
  6705.  
  6706.      Now suppose you want some references to be relative and some to be
  6707. absolute.  This may be desirable when you copy formulas that contain
  6708. some "constant" values that should not change no matter where the
  6709. formulas are copied. For example, suppose we added a field E to our
  6710. spreadsheet. The value in E needs to be added to each of the commands in
  6711. all the other cells. When you copy A2 + B2 + E relatively from cell C1
  6712. to cell D1 you want to end up with B2 + C2 + E.
  6713.  
  6714.      Alternatively, suppose you want a reference to be relative only in
  6715. one direction. A reference that is relative vertically and absolute
  6716. horizontally results in the copy being adjusted to a cell that is
  6717. vertical to the cell with the copied command.  This vertical distance is
  6718. the distance of the original cell to its original vertical reference.
  6719. Likewise, a reference that is relative horizontally and absolute
  6720. vertically results in the copy being adjusted to a cell that is
  6721. horizontal to the cell with the copied command.  This horizontal
  6722. distance is the distance of the original cell to its original horizontal
  6723. reference.
  6724.  
  6725.      To limit how Surefire does a relative copy, you use dollar signs
  6726. ($) in the part of the reference that you want to keep absolute. The
  6727. following table shows the four possibilities of referencing for the cell
  6728. A1. Other cells such as BQ12, A5, etc. change in a similar way:
  6729.  
  6730.      Cell Reference      Meaning
  6731.  
  6732.      A1                  Relative both vertically and horizontally
  6733.      $A1                 Relative vertically only
  6734.      A$1                 Relative horizontally only
  6735.      $A$1                Absolute
  6736.  
  6737. Note:   The use of dollar signs ($) only applies when you are doing a
  6738. relative command copy That is when the button in the command window is
  6739. set to Relative. If the button is set to Absolute these specifications
  6740. are ignored and an absolute copy is done in all cases.
  6741.  
  6742. Note:   Changing the reference type will not occur with named references
  6743. but only with Surefire's unique field ID's.
  6744.  
  6745.  
  6746.  
  6747.  
  6748.  
  6749.  
  6750.  
  6751.  
  6752.  
  6753.  
  6754.  
  6755.  
  6756.  
  6757.             Surefire User's Guide         Page 105
  6758.  
  6759.  
  6760.    Absolute/Relative Toggle Key
  6761.  
  6762.      You can enter the dollar signs by typing them at the appropriate
  6763. locations in the cell reference as shown above. There is, however,  a
  6764. more convenient way to change reference types from within the command
  6765. edit area of the Command Edit window. With the cursor over the reference
  6766. to change, press (F4) successively to go through all four combinations
  6767. of references. This is known as the absolute/relative toggle key.
  6768.  
  6769.      You can use the Absolute/Relative toggle key to make a reference
  6770. relative in the vertical direction only.  This means that the letter
  6771. part of the reference will stay the same but the number part will
  6772. change.
  6773.  
  6774. Enlarging A Spreadsheet
  6775.  
  6776.      Since Surefire fields are not constrained to a fixed row and column
  6777. grid, you need an easy way to enlarge your spread sheet. Using a
  6778. combination of techniques that are available for manipulating fields,
  6779. you can easily enlarge your spreadsheet by switching to Document Edit
  6780. mode and enlarging each of the multi-lined fields. At the same time you
  6781. may create additional fields for your spreadsheet.
  6782.  
  6783. Using a Range of Fields
  6784.  
  6785.      When you want to load a command with relative references into many
  6786. cells, putting it into each cell one by one would be a tedious task.
  6787. You can accomplish this very quickly by first selecting a range of
  6788. fields and then doing a Paste operation on the command.
  6789.  
  6790.    Selecting a Range of Fields
  6791.  
  6792.      Range selections are initiated by choosing the "Field Select
  6793. Alt+J" menu item on the Edit menu while you are in Use mode and the
  6794. Command Edit window is displayed.  (Conversely, the Block selection you
  6795. did to enlarge the spreadsheet was done during Document edit. ).
  6796.  
  6797.      If the cursor is free, all cells that are completely contained
  6798. within the bounds of the start position and the current cursor position
  6799. become selected.  The selection occurs as the cursor is moved down and
  6800. to the right with the arrow keys.  The range shrinks when the cursor is
  6801. then moved up or to the left.
  6802.  
  6803.      If the cursor is not free, a rectangle of fields are selected
  6804. corresponding to the left corner of the cell in which the selection was
  6805. started and the right corner of the current cell. The selection occurs
  6806. as the cursor is moved down and to the right with the arrow keys or with
  6807. a combination of (End) and (down arrow).  The range shrinks when the
  6808. cursor is then moved up or to the left.
  6809.  
  6810.      In either case, as with any selection in Surefire, if you move the
  6811. cursor to the left or above the initial cursor position, the field
  6812. selection operation is canceled. You can also cancel the operation
  6813. directly by pressing (Esc).
  6814.  
  6815.  
  6816.  
  6817.  
  6818.  
  6819.  
  6820.  
  6821.  
  6822.             Surefire User's Guide         Page 106
  6823.  
  6824.  
  6825.    Copy Commands Using Range Selection
  6826.  
  6827.      To copy commands using range selection you first must set the
  6828. original command. Move to cell one cell of your spreadsheet and press
  6829. (ALT+F10) to open the Command Edit window.  Enter the command to be
  6830. copied in the edit area and press (ALT+F4) to Paste & Keep it.
  6831.  
  6832.      Now, Press (Home) to move to the Absolute/Relative button and press
  6833. (Spacebar) to make the command Relative. Define the range by pressing
  6834. (Shift+Tab) to go back to the document. Move the cursor to the upper
  6835. left-most cell to receive the adjusted command. Choose "Field Select"
  6836. from the Edit menu or press (ALT+J) to start Field selection. Move the
  6837. cursor to the lower right-most cell. These cells will be the destination
  6838. of the pasted commands.
  6839.  
  6840.      Press (ALT+F4) to paste and keep the commands. If you now look at
  6841. the commands in the cells you will see that each has a similar command
  6842. with the references adjusted according to their position.
  6843.  
  6844. Horizontal vs Vertical Execution Order
  6845.  
  6846.      The order of execution determines whether field commands will be
  6847. calculated in a row by row (i.e. horizontal) or column by column (i.e.
  6848. vertical) order. This order may affect the resulting values in your
  6849. fields because some expressions may depend on field values already being
  6850. known. If these particular fields are above, below, to the left or right
  6851. of the field containing the command then the execution order may affect
  6852. your results. The default order in Surefire is horizontal but it is up
  6853. to you to determine the best order for your needs.
  6854.  
  6855.      You can change the order of execution on a page by page basis.  To
  6856. do this, you use a multiple choice button located in the Command Edit
  6857. window. This button displays the current execution order as either Vert
  6858. or Horiz corresponding to a vertical and horizontal order respectively.
  6859. You toggle this button to set the execution order for the current page.
  6860. It does not matter what the current field is when this button is set.
  6861. All fields on the same page will have the same execution order.
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.  
  6872.  
  6873.  
  6874.  
  6875.  
  6876.  
  6877.  
  6878.  
  6879.  
  6880.  
  6881.  
  6882.  
  6883.  
  6884.  
  6885.  
  6886.  
  6887.             Surefire User's Guide         Page 107
  6888.  
  6889.  
  6890. Chapter 17     -    Introduction to Databases
  6891.  
  6892.      Any Surefire document that has fields has data associated with
  6893. those fields. Data is simply the values contained in Surefire fields. In
  6894. the simplest sense, the current values of fields are saved automatically
  6895. with a document when you save the document. So one set of data, the
  6896. displayed field values, is always associated with a document. This set
  6897. of data is known as a data record or simply a record.  Sometimes you may
  6898. want to work with more than one set of data. Being able to do just that
  6899. is the basic idea of a database.
  6900.  
  6901.      You generally keep sets of similar information about something in
  6902. a database. In many ways a database is like a file cabinet. It may
  6903. contain folders of information about each of your clients, recipes,
  6904. employees, patients, suppliers, etc.  For each employee, you may keep
  6905. personal information including their name, address and social security
  6906. number.  For each recipe, you might keep a title and list of major
  6907. ingredients. And for your rental property, you will want to easily
  6908. access information about all tenants and leases.
  6909.  
  6910.      To define a database in Surefire, you indicate those fields of your
  6911. document which are to contain more than one value. That's all there is
  6912. to it!  Surefire will automatically create your database!  You can now
  6913. add, change or delete records at any time. After records have been
  6914. added, you can selectively look at specific records.
  6915.  
  6916.      In this and the following two chapters you will learn how to
  6917. manipulate data records and how to find the ones in which you may be
  6918. interested. In addition, you will learn how to calculate information and
  6919. generate statistics based on your stored data. You will also learn how
  6920. to enlarge fields that are too small, add additional fields, and remove
  6921. fields that you no longer need. Later, in the chapter "Generating
  6922. Reports", we will expand on these concepts so that you learn how to look
  6923. at and print multiple data records at one time with a Surefire document.
  6924.  
  6925. Storing Data
  6926.  
  6927.      Naturally, the first thing that you will want to do is to create a
  6928. database and start adding information. In Surefire, the creation of a
  6929. database is as simple as creating a field and adding your first data
  6930. record. You will see a natural progression from storing a single data
  6931. record directly in a document to storing many data records in a
  6932. database.
  6933.  
  6934.    Specifying a Database Field
  6935.  
  6936.      The values of all Surefire fields, except buttons, may be stored in
  6937. a database. To indicate that a field's data is to be stored in a
  6938. database, you must set or modify the data attribute for that field using
  6939. the Create Field or Modify Field windows.  To do this you must be in
  6940. Document Edit mode. If the field already exists, select Modify from the
  6941. Field Menu or press (ALT+M). Otherwise, for a new field press (ALT+C).
  6942. Press (End) enough times to move the cursor down to the multiple choice
  6943. button just below the heading Data. It should indicate "Not Stored".
  6944.  
  6945.  
  6946.  
  6947.  
  6948.  
  6949.  
  6950.  
  6951.  
  6952.             Surefire User's Guide         Page 108
  6953.  
  6954.  
  6955.      Press (ALT+Z) to display the button's pop-list and highlight
  6956. "Stored".  Press (Enter) and then (Ctrl + Enter) to set the change.
  6957.  
  6958.      You need to set the choice to Stored for each field that you wish
  6959. to store. Since button fields do not contain data, they cannot be
  6960. Stored. When all fields are properly set, you can proceed to add data to
  6961. your database. When you add your first record in the manner described in
  6962. the next section, Surefire will create your database automatically. You
  6963. may add other fields to your database at a later time.
  6964.  
  6965.      Note:   Each cell of a Stored multiple cell numeric field is stored
  6966. separately in the database.
  6967.  
  6968.    Database Limits
  6969.  
  6970.      The visible size of your field generally determines the maximum
  6971. amount or value of Stored data that field may contain. However, while
  6972. non-stored text fields may have up to 4096 characters, a Stored text
  6973. field may have no more than 254 characters. Likewise, the maximum size
  6974. of a Stored numeric field is 16 characters wide.
  6975.  
  6976.      Various field formats may remove available characters from the
  6977. visible field. For example, the value that a numeric field can contain
  6978. is limited by the formatting specified for that field (eg. Currency
  6979. format, number of decimal places, etc.). No matter which format you have
  6980. chosen to display logical fields, they can have only 2 possible values:
  6981. 'T' or 'F'.
  6982.  
  6983.      While Stored dates may range from year 1 thru year 9999, a century
  6984. other than 1900 may only be entered in long date format.  Even in long
  6985. date format, if you use indexed or sorted searches to retrieve records,
  6986. dates before Jan 1, 1900 or after Dec 31, 1999 will not be correctly
  6987. ordered. The current century (ie. 1900) is assumed for the other date
  6988. formats.
  6989.  
  6990.      Note:  You may designate up to 128 stored fields in a document.
  6991.  
  6992.    Adding a Data Record
  6993.  
  6994.      You can add your first record to a database once you have given a
  6995. name to your document. This means you must first save a new document (to
  6996. give it a name). Existing documents already have names. Surefire uses
  6997. this name to create a separate place to keep the data records associated
  6998. with the document.  You can then enter values into fields and store
  6999. these values. You can add records as long as you have enough disk space.
  7000.  
  7001.      Remember that some fields have field commands in them to calculate
  7002. their values. Field commands are automatically executed before a record
  7003. is added to the database so that any stored fields with calculated
  7004. values will have their correct values stored. In order not to waste time
  7005. typing a value in a "calculated" field, you can usually skip fields when
  7006. an '#' appears at the far right of the status line.
  7007.  
  7008.  
  7009.  
  7010.  
  7011.  
  7012.  
  7013.  
  7014.  
  7015.  
  7016.  
  7017.             Surefire User's Guide         Page 109
  7018.  
  7019.  
  7020.      To add a record, you must be Using your document. Now, enter values
  7021. into the fields you want stored in the database. Choose "Add Record"
  7022. from the Data Menu or press (ALT+A).  You have now added a record into
  7023. a newly created database.
  7024.  
  7025. Clearing All Fields
  7026.  
  7027.      You can clear the values of all the fields in your document to
  7028. start afresh by choosing "Clear Fields" from the Field menu or pressing
  7029. (ALT+Y). This will not affect data records stored in the database. If
  7030. much of the information is the same from record to record, do not use
  7031. this option and simply enter new values in only those fields that should
  7032. have different values.
  7033.  
  7034. Simple Data Search
  7035.  
  7036.      Now that there are records in the database, you will want to look
  7037. at them. There are two simple ways that your data records may be
  7038. retrieved. You can view each of the records in the same order that you
  7039. added them to the database. Or, you can enter a value in one field and
  7040. tell Surefire to display all the records that have that same value. In
  7041. the next chapter, you'll learn more complex ways to retrieve your data.
  7042.  
  7043.      Before you start a search, you should Get the document that you
  7044. used to add your records, if it is not already displayed. Since the
  7045. document fields will be used to display the values stored in the
  7046. database, you should also be Using the document (i.e. in Use mode).
  7047.  
  7048.    Viewing All Records
  7049.  
  7050.      The simplest way to look at your data is to retrieve your records
  7051. in the order that they were added to the database. This is done by
  7052. pressing (F8) (i.e. Next Record). The first record that was added will
  7053. be displayed in your document. You can continue to press (F8) to view
  7054. each successive record until you hear a beep. As each record is
  7055. displayed, Surefire will also calculate the values of fields that are
  7056. Not Stored.
  7057.  
  7058.      You may reverse the direction of the retrieval by pressing (F7)
  7059. (i.e. Previous Record). When you again see the first record, another
  7060. (F7) sounds a beep to indicate that you can't go any farther.
  7061.  
  7062.      Note:   If you add a record while viewing database records, that
  7063. record will be appended to the end of the database and will become the
  7064. currently displayed record.
  7065.  
  7066.    Database Status Information
  7067.  
  7068.      As each record is retrieved from the database, Surefire gives you
  7069. important status information. When you press (F8), the status line
  7070. showing the current document name and the current cursor position will
  7071. change to show that a record is being displayed.
  7072.  
  7073.  
  7074.  
  7075.  
  7076.  
  7077.  
  7078.  
  7079.  
  7080.  
  7081.  
  7082.             Surefire User's Guide         Page 110
  7083.  
  7084.  
  7085.      The "1" means that you are looking at the first record and the "?"
  7086. means that Surefire doesn't know at this point how many records you will
  7087. eventually see. As each successive record is displayed, the "1" becomes
  7088. 2, 3, etc. When all the records have been displayed, the "?" will be
  7089. replaced to show how many records have been displayed. When you are
  7090. finished looking at these records, the normal status information (i.e.
  7091. document page, line and column) can be redisplayed if you press (F3).
  7092.  
  7093.    Getting Specific Records
  7094.  
  7095.      You have just seen how to retrieve all the data records, one by
  7096. one, from the database. You may, however, want to look at certain
  7097. records only. This is especially true when your database becomes large.
  7098. To do this, you can start a search based on a specific document field.
  7099. For example, you may be interested in all persons named "Smith", or all
  7100. children aged 10, or all recipes that call for chicken, or all invoices
  7101. with payment due dates of 01/15/90, etc. You qualify or weed out these
  7102. records by giving the conditions that the desired records must match.
  7103. Once you have set your search conditions, you can start a search.
  7104.  
  7105.      You specify the simplest kind of condition by entering a particular
  7106. value in any single stored field.  You then choose "Search" from the
  7107. Data menu to start the search based on this condition. The status
  7108. indicators "INDEXING" or "SEARCHING" may appear at the right side of the
  7109. status line until the search is finished. If you see the status
  7110. indicator "NOTHING FOUND", there are no records in the database which
  7111. match your conditions.
  7112.  
  7113.      Text field conditions are even more powerful. Typing only a few
  7114. characters in the field will match records where the field begins with
  7115. those characters. If the field is blank, Surefire will find all records
  7116. sorted alphabetically by that field.  And, to make things even easier,
  7117. case is not important in database searches.
  7118.  
  7119.      When you start a database search, Surefire will process all
  7120. records, display the first one that matches, and display the total
  7121. number of matching records instead of a '?'. You will learn more complex
  7122. techniques for qualifying data records in the next chapter.
  7123.  
  7124. Updating a Data Record
  7125.  
  7126.      Once you retrieve records from the database in one of the manners
  7127. described above, you can change their values. You first display a record
  7128. that needs to be corrected. After you make all desired changes, choose
  7129. "Update Record(s)" from the Data menu or press (ALT+U). The status
  7130. indicator "RECORD UPDATED" will appear briefly at the right of the
  7131. status line. Your changes will be reflected the next time that record is
  7132. displayed. Repeat this procedure for any records that need new values.
  7133.  
  7134.      If you change values in stored fields and try to leave Surefire or
  7135. Get another document, Surefire will warn you with a message window to
  7136. update or add the currently displayed data record. Choose YES if you
  7137. don't care about saving the field values. Choose NO if you want a chance
  7138. to add or update the record before moving on.
  7139.  
  7140.  
  7141.  
  7142.  
  7143.  
  7144.  
  7145.  
  7146.  
  7147.             Surefire User's Guide         Page 111
  7148.  
  7149.  
  7150. Deleting a Data Record
  7151.  
  7152.      Normally the records you can see are active records. You can delete
  7153. a record or make it inactive if you want Surefire to ignore it when the
  7154. database is searched. You do this in a similar manner to the way you
  7155. update a record. The record you wish to delete must be currently
  7156. displayed in the document. You then choose "Delete Record(s)" from the
  7157. Data menu or press (ALT + F5). That record will now be marked as
  7158. inactive and will not appear the next time that records are displayed as
  7159. a result of a search. The status indicator "RECORD DELETED" will appear
  7160. briefly at the right of the status line.
  7161.  
  7162.      If you were currently looking at successive records (i.e. pressing
  7163. F8, F8...), the next qualifying record will be displayed after you
  7164. delete a record. If you delete the last record from your search, all
  7165. fields in the document will be cleared. Likewise, if you were looking at
  7166. records in reverse order (i.e. pressing F7, F7...), the previous
  7167. qualifying record will be displayed. In this case, if you delete the
  7168. first record from your search, all document fields will be cleared.
  7169.  
  7170.      Note:  In Surefire, a deleted record is actually not deleted but is
  7171. marked inactive. This means that while these deleted records are not
  7172. normally displayed, you may at some point access them and restore them
  7173. to active status. You must perform a restructure operation to remove
  7174. deleted records permanently. You will learn how to recall records and
  7175. restructure a database later in this manual.
  7176.  
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.  
  7183.  
  7184.  
  7185.  
  7186.  
  7187.  
  7188.  
  7189.  
  7190.  
  7191.  
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.  
  7198.  
  7199.  
  7200.  
  7201.  
  7202.  
  7203.  
  7204.  
  7205.  
  7206.  
  7207.  
  7208.  
  7209.  
  7210.  
  7211.  
  7212.             Surefire User's Guide         Page 112
  7213.  
  7214.  
  7215. Chapter 18     -    Searching a Database
  7216.  
  7217.      You have already seen how to access all records one at a time from
  7218. the database. You also know how to limit the set of records based on
  7219. matching a single field value. Because some situations require more
  7220. complex data filtering, Surefire allows you to specify more complex
  7221. conditions to qualify which records are retrieved.
  7222.  
  7223.      Say you want to find all of your contacts in a certain city.
  7224. Perhaps you would also like these records to be displayed alphabetically
  7225. by the last name of each contact. You describe this as a query.  A query
  7226.  
  7227. is a set of conditions that restrict the data records that are retrieved
  7228. from the database and give a specified ordering of their display.  A
  7229. query is used to search the database.  The records resulting from the
  7230. search make up a record set.  You can look at or print the records in a
  7231. record set as well as update or delete them as a group. Working with a
  7232. record set as a group will be explained in "Chapter 21: Advanced
  7233. Database Topics".
  7234.  
  7235.      In this chapter you will learn how to specify queries and save them
  7236. for later use. You will also see how to display records that were
  7237. previously "deleted".
  7238.  
  7239.  
  7240. Specifying a Query
  7241.  
  7242.      To specify a query, first make sure you have your document in Use
  7243. mode.  You then position the cursor on the field whose value you think
  7244. would most limit the initial search. This is sometimes called the key
  7245. field or the primary key.
  7246.  
  7247.      Now suppose you have about 200 contacts, most of whom live in one
  7248. of five cities. The city field might be a good choice as the key field
  7249. since only about 20% of your contacts are likely to live in a given
  7250. city. Of course, any field that is stored in the database can be used as
  7251. a key field. In fact, you may use different keys at different times
  7252. depending on the type of record you are looking for.
  7253.  
  7254.      Once you have chosen a key field and have positioned the cursor to
  7255. it, choose "Build Query..." from the Data menu or press (ALT + Q). This
  7256. will open the Query window. The Query window appears as a pane at the
  7257. top of your screen, like the Command Edit window, and does not obscure
  7258. the document.
  7259.  
  7260.      When you specify a query in the Query window,  a 'Q' will appear in
  7261. the status line to the left of the document name. This 'Q' means that
  7262. you are specifying a new query. Therefore the current record set that
  7263. you are viewing using (F7) and (F8) do not correspond to the new query.
  7264.  
  7265.      After you do a search based on this query (eg. by pressing ALT+S),
  7266. the 'Q' will be replaced by an 'S'. This indicates that the database was
  7267. searched according to the current query in the Query window and that the
  7268. current record set now corresponds to the query.
  7269.  
  7270.  
  7271.  
  7272.  
  7273.  
  7274.  
  7275.  
  7276.  
  7277.             Surefire User's Guide         Page 113
  7278.  
  7279.  
  7280.    Query Lines
  7281.  
  7282.      Once you display the Query window, information about your field is
  7283. on the first line of the window. So that we can refer to it more easily,
  7284. let's call this a query line.   Each query line represents a single
  7285. condition. A query can have up to 20 query lines.  As with any window in
  7286. Surefire, you use the (Home), (End) and (left and right arrows) to move
  7287. between query lines and query line items.  You will now learn about each
  7288. item from left to right.
  7289.  
  7290.    Sort Order Multiple Choice Button
  7291.  
  7292.      The sort order multiple choice button can have values 1, 2 or
  7293. blank, to indicate how the retrieved records will be sorted. Sorting  is
  7294. the order that Surefire will use to display the records as they are
  7295. found in the database.
  7296.  
  7297.      Initially when there is only one query line, this value is 1. That
  7298. means, if no other conditions are added, the data will be sorted on the
  7299. field associated with this query line.
  7300.  
  7301.      For example, if we chose the city field of a "contacts" document
  7302. and the query said to search for all contacts, the records would be
  7303. displayed in alphabetical order by city. That means you would see the
  7304. records for people in Boston before those for Dallas which would be
  7305. before those for Denver, etc.
  7306.  
  7307.      If you add another query line, you can give it a sort order of 2.
  7308. This would mean that retrieved data records are first sorted by the
  7309. field with the sort order 1 and then sorted by the field with a sort
  7310. order of 2. This is called a nested sort. You may specify up to two
  7311. levels of nesting by setting this button to the values 1 and 2 on two
  7312. different query lines. If the choice for this button were blank, there
  7313. would be no sort order for the associated field and the records would be
  7314. displayed just as they are found in the database. We'll show you how to
  7315. add query lines later.
  7316.  
  7317.      Note:  There must always be one query line with a value of 1 for
  7318. this button.
  7319.  
  7320.      For example, say this second query line corresponds to the field
  7321. 'name' of our hypothetical "contacts" document. The records would now be
  7322. sorted first by the city and then by the name field for each city. That
  7323. means you would see all the records for Boston with names ordered from
  7324. A to Z, then those for Dallas, then those for Denver, etc.
  7325.  
  7326.    Sort Direction Multiple Choice Button
  7327.  
  7328.      Generally, sorted records are retrieved in an ascending  order.
  7329. That means that alphabetic information is ordered from A - Z, numeric
  7330. information is ordered from 0 - 9, and dates are ordered from earliest
  7331. to latest. Ascending order is indicated by an up arrow on the sort
  7332. direction multiple choice button.
  7333.  
  7334.  
  7335.  
  7336.  
  7337.  
  7338.  
  7339.  
  7340.  
  7341.  
  7342.             Surefire User's Guide         Page 114
  7343.  
  7344.  
  7345.      You may, however, choose to display your data records in descending
  7346. order. To do this, set the value of this button to a down arrow by
  7347. pressing (Spacebar) when the cursor is on the up arrow. You may also
  7348. press (ALT+Z) to zoom a pop-list with two choices as shown below. A
  7349. descending sort would sort as Z - A, 9 - 0, latest to earliest, etc.,
  7350. depending on the field type. If you were to display all contact records,
  7351. by city, in descending order, you would first see records for Portland,
  7352. then New York, Los Angeles, ... and lastly for Boston.
  7353.  
  7354.    Field Name and Type
  7355.  
  7356.      The next two items of the query line are the ID or name of the
  7357. field and the field's type. This is information only and cannot be
  7358. changed. These items provide a way to read your query more easily. They
  7359. are especially useful if you have conditions based on fields that are
  7360. not visible on the screen.
  7361.  
  7362.    Condition Multiple Choice Button
  7363.  
  7364.      This multiple choice button indicates more specifically the way a
  7365. data record will be tested against a value. The values of this button
  7366. depend on the type of field associated with the query line. Also,
  7367. depending on the field type, you can cycle through single and range
  7368. conditions. Single conditions accept one value while range conditions
  7369. accept two values.
  7370.  
  7371.    Single Conditions
  7372.  
  7373.      When the condition multiple choice button is set to accept a single
  7374. value, one data entry field is provided just to the right of the button.
  7375.  
  7376. This field is the same type as the field associated with the query line.
  7377. For example, if the condition is for a date, this would be a date field.
  7378. If this is a numeric condition, this field accepts a numeric value, and
  7379. so on. As with all multiple choice buttons in windows, you can press
  7380. (Spacebar) to see each possible value or press (ALT + Z) to see a
  7381. pop-list of all values.  With single condition query lines you can limit
  7382. the search of your data in many ways according to a specific value that
  7383. you enter.
  7384.  
  7385.      The tables here and on the next page list the single conditions for
  7386. all data types:
  7387.  
  7388.         text field conditions     numeric field conditions
  7389.  
  7390.           Is Exactly               Equal to
  7391.           Begins With              GT (greater than)
  7392.           Contains                 GT or Eq (greater than or equal to)
  7393.           All                      LT (less than)
  7394.           Is Not                   LT or Eq (less than or equal to)
  7395.           Does Not Begin With      All
  7396.           Does Not Contain         Not Equal to
  7397.  
  7398.  
  7399.  
  7400.  
  7401.  
  7402.  
  7403.  
  7404.  
  7405.  
  7406.  
  7407.             Surefire User's Guide         Page 115
  7408.  
  7409.  
  7410.         date field conditions     logical field conditions
  7411.  
  7412.           On
  7413.           After
  7414.           On or After
  7415.           Before
  7416.           On or Before             Only Y
  7417.           All                      Only N
  7418.           Not On                   All
  7419.  
  7420.  
  7421.    The 'All' Condition
  7422.  
  7423.      Text, numeric and date fields may have the special condition 'All'.
  7424. The 'All' condition does not have an associated data entry field. It
  7425. indicates, however, that it doesn't matter what the value of the field
  7426. is in the data record.  You choose 'All' when you want to display data
  7427. records that are sorted on a field but have no particular value for this
  7428. field.
  7429.  
  7430.      For example, you may want to view all of your contact records
  7431. sorted by date of the last letter that you sent.  If you had 'All' and
  7432. an ascending sort on the date sent, Surefire would first display the
  7433. person who you've been out of contact with the longest.  Alternatively,
  7434. if you had 'All' and a descending sort on the date sent, you would first
  7435. see the person to whom you most recently sent a letter. 'All' is used in
  7436. a similar fashion with both text and numeric fields.
  7437.  
  7438.    Range Conditions
  7439.  
  7440.      Range conditions are available for numeric and date fields. They
  7441. indicate that the records you are interested in have values that fall
  7442. into some range. There are two data entry fields associated with a range
  7443. condition that allow you to give the top and bottom of the range. For
  7444. example you may want to find all of your clients between the ages of 35
  7445. and 50. Or, you may want to send a follow-up letter to everyone with
  7446. whom you spoke between May and July. As with single conditions, these
  7447. fields are the same data type as the associated field of your document.
  7448.  
  7449.      Range conditions for numeric and date fields are listed below:
  7450.  
  7451.                   Numeric Field Range Conditions
  7452.  
  7453.      Both GT  condition1   and LT  condition2
  7454.      Both GT or Eq  condition1   and LT or Eq  condition2
  7455.      Both GT or Eq  condition1   and LT  condition2
  7456.      Both GT  condition1   and LT or Eq  condition2
  7457.  
  7458.                   Date Field Range Conditions
  7459.  
  7460.      Both After  date1  and Before  date2
  7461.      Both On or After  date1  and On or Before  date2
  7462.      Both On or After  date1  and Before  date2
  7463.      Both After  date1  and On or Before  date2
  7464.  
  7465.  
  7466.  
  7467.  
  7468.  
  7469.  
  7470.  
  7471.  
  7472.             Surefire User's Guide         Page 116
  7473.  
  7474.  
  7475.    Adding a Query Line
  7476.  
  7477.      When you first display the Query window, it contains a single query
  7478. line corresponding to the document field on which you selected "Build
  7479. Query". The initial condition echoes the value that was in the field at
  7480. the time. The condition multiple choice is set to indicate equivalence,
  7481. that is, "Is Exactly", "Equal to", or "On" depending on the type of the
  7482. field.  The sort order is 1 and the sort direction is ascending as
  7483. indicated by the up arrow. You may change these button values prior to
  7484. doing a search.
  7485.  
  7486.      Once the Query window is open, you may add other conditions. The
  7487. more query lines there are, the more restrictive the search will be and
  7488. the fewer records that will be displayed. You add query lines by
  7489. temporarily moving the cursor back to the document and selecting
  7490. additional fields for the conditions. Once there are query lines for
  7491. these fields, the various multiple choice buttons and values in the
  7492. Query window may be changed as desired.
  7493.  
  7494.      The procedure for adding query lines is similar to that for adding
  7495. cell references to the edit area of the Command Edit window.  After the
  7496. Query window is open, you move to the document by pressing (Shift + Tab)
  7497. and then move around using the usual keys for movement by fields, (End)
  7498. and (Home).  You move to any text, numeric, date or logical field.
  7499. Then, press (Ctrl + Enter) to make a new query line for that field.  You
  7500. may select other fields this way, or return directly to the Query window
  7501. by pressing (Shift+Tab) again.
  7502.  
  7503.      You move around the Query window with multiple query lines by using
  7504. the (End), (Home) and the (up and down arrows). You will notice that as
  7505. you move from one query line to another, the corresponding document
  7506. field will be highlighted. If needed, Surefire will automatically scroll
  7507. the document so that you can see this field.
  7508.  
  7509.      Note: You may define up to 20 query lines (i.e. conditions) for a
  7510. query.
  7511.  
  7512.    AND'ed Conditions
  7513.  
  7514.      For every different field selected, the conditions will be AND'ed
  7515. to each other.  That is, the data records will be retrieved if they
  7516. match all of the conditions in the query. For example, you may want to
  7517. display all clients who are in Dallas AND whose name begins with "Gr".
  7518.  
  7519.    OR'ed Conditions
  7520.  
  7521.      If you create two query lines for the same field, the resulting
  7522. conditions will be OR'ed together. That means that a record must match
  7523. either the value in the first such query line OR the value in another
  7524. query line for that field. Say you want to change your query to get all
  7525. persons who either live in Dallas OR Los Angeles and whose name begins
  7526. with 'Gr'.
  7527.  
  7528.  
  7529.  
  7530.  
  7531.  
  7532.  
  7533.  
  7534.  
  7535.  
  7536.  
  7537.             Surefire User's Guide         Page 117
  7538.  
  7539.  
  7540.    Deleting a Query Line
  7541.  
  7542.      By continuing to add conditions, a query can become quite complex
  7543. and restrictive. At some point, you may decide that a condition is no
  7544. longer needed. To remove a condition, simply place the cursor anywhere
  7545. on that query line and press (Ctrl+D). You may delete any query line
  7546. with the following exception:
  7547.  
  7548.      You may not delete a query line with the sort order 1 if there are
  7549. no OR'ed conditions for that query line and there is no query line with
  7550. a sort order of 2.
  7551.  
  7552.      If you delete a query line with sort order 1, and there is an OR'ed
  7553. query line for the same field, that OR'ed query line will become the
  7554. primary key. If there is no OR'ed query line but there is a query line
  7555. with a sort order of 2, that query line will be the primary key.
  7556.  
  7557.    Closing the Query Window
  7558.  
  7559.      When you have added all the conditions that you want in the Query
  7560. window, you can close it by pressing (Esc). This gives back the full
  7561. screen to the document but will not erase the contents of the Query
  7562. window. You will still know that there is a query defined by the 'Q' or
  7563. 'S' in the status line to the left of the document name. An 'S' will
  7564. replace the 'Q' when the current record set was obtained using the
  7565. currently specified query.
  7566.  
  7567.      When you start a search, the query defined in the Query window will
  7568. be used even if the Query window is not visible.  Once you have defined
  7569. a query in the Query window and you have not cleared it, choosing "Build
  7570. Query... " from the Data menu will display the Query window with the
  7571. most recently defined conditions.
  7572.  
  7573.    Clearing the Current Query
  7574.  
  7575.      To start a totally new query, you must first clear the current
  7576. query. You do this by selecting "Clear Query " from the Data menu or
  7577. pressing (ALT+K). You have already done this a few times in your
  7578. practices. The 'Q' (or 'S' if a search is in progress) will disappear
  7579. from the status line. The next time you open the Query window, the
  7580. window will contain a single query line which corresponds to the current
  7581. field of the document. This will be just like the first time you opened
  7582. the Query window.
  7583.  
  7584.  
  7585. Setting Search Options
  7586.  
  7587.      Surefire uses some default parameter settings that limit how a
  7588. search is done and how data is displayed in the document. To change
  7589. these settings, select "Set Search Options..." from the Data menu. A
  7590. window will appear that allows you to change these parameters as
  7591. described below. Any changes that you make will effect subsequent
  7592. searches.
  7593.  
  7594.  
  7595.  
  7596.  
  7597.  
  7598.  
  7599.  
  7600.  
  7601.  
  7602.             Surefire User's Guide         Page 118
  7603.  
  7604.  
  7605.    Setting the Record Type
  7606.  
  7607.      Normally only active (i.e. not deleted) qualifying records are
  7608. retrieved during a search. If you want the search to include deleted
  7609. records also, or to be limited to only deleted records, you must change
  7610. the multiple choice button to the right of the text "Record Type for
  7611. Search". This button can have the values: "Active", "Deleted", and "
  7612. All".  Select the option that you desire, then choose OK.
  7613.  
  7614.      The next time you search the database, the new setting will be
  7615. effective. If you had chosen "Deleted" or "All", you may see a 'D' at
  7616. the far right of the status line as you display each record with (F8).
  7617. This indicates that the currently displayed record was deleted at some
  7618. prior time. You may later recall  a deleted record.  Recalling deleted
  7619. records is discussed in "Chapter 21: Advanced Database Topics".
  7620.  
  7621.      The "Do Report Formatting?" option is fully described in "Chapter
  7622. 22: Generating Reports".
  7623.  
  7624.  
  7625. Named Queries
  7626.  
  7627.      After taking pains to construct a complex query that has many
  7628. conditions, you may want to save those conditions to use again at
  7629. another time. These could be queries that are run often such as:
  7630.  
  7631.      1. Show me all my accounts that are past due.
  7632.      2. Find the top earning salesman of the month.
  7633.      3. Show all contacts sorted by zip code.
  7634.  
  7635.      Once a query has been built in the Query window, you may save it
  7636. for later use. This named query will always be associated with the
  7637. current document until you decide to delete it. Once saved, you can
  7638. edit, copy, run or delete the query. To do any of these operations,
  7639. select "Edit Queries..." from the Data menu. You will see the Edit Query
  7640. window. This window contains one multiple choice button and one data
  7641. entry field. You may view the possible values for this button by
  7642. pressing (ALT+Z) to zoom the button choices.
  7643.  
  7644.    Saving a Query
  7645.  
  7646.      A named query which will be associated with a document must first
  7647. be given its name. Just as with a new document, you give the query a
  7648. name when you choose to save it. To save a query, set the button value
  7649. to "Save Current Query" and enter a name in the data entry field.  You
  7650. can use a name of up to 10 characters to help you remember what the
  7651. query does. For example, PASTDUACCT, TOPSELLER and MAINCONTAC might work
  7652. for the sample conditions above. You then choose OK. The save will not
  7653. affect the Query window. Since Surefire remembers the query information
  7654. until you delete the query, you can access this query whenever needed.
  7655.  
  7656.      If you want to see the names of queries already defined for the
  7657. current document, press the Zoom key (ALT + Z) when the cursor is in the
  7658. data entry field.
  7659.  
  7660.  
  7661.  
  7662.  
  7663.  
  7664.  
  7665.  
  7666.  
  7667.             Surefire User's Guide         Page 119
  7668.  
  7669.  
  7670.      Note:   During save, be careful not to choose a name from the
  7671. pop-list, since Surefire will now overwrite the query that was
  7672. associated with that name.
  7673.  
  7674.    Getting a Query
  7675.  
  7676.      Once you save a query, you may bring it back to review it, copy it,
  7677. or to change it. First, you need to get the query.  You can get any
  7678. query that was previously saved for the current document. If the Query
  7679. window is visible, this named query will replace the window contents
  7680. with its saved conditions. If the Query window is not visible, it will
  7681. be displayed with the query lines of the named query that you just got.
  7682.  
  7683.      When the named query is displayed in the Query window, you can make
  7684. changes to it. These changes will not become part of the named query
  7685. unless you re-save the query. When you do a search, the conditions of
  7686. the named query, along with your changes, will be used to restrict the
  7687. search. The name of the query is displayed at the top of the window.
  7688.  
  7689.      Note:   Any unnamed query that was in the Query window before you
  7690. did a Get Query, will be lost.
  7691.  
  7692.      Sometimes you may want to have a second query that is very similar
  7693. to one you already have saved. You can quickly create this second query.
  7694. First get the similar query. Now, make your desired changes and use the
  7695. "Save Current Query" option to provide a different name.
  7696.  
  7697.    Running a Query
  7698.  
  7699.      If you want to use a named query to limit your data search, without
  7700. opening or changing the contents of the Query window, you may run  the
  7701. query. To do this choose the Run Query option from the Edit Query
  7702. window. Then, enter the name in the data entry field or use the pop-list
  7703. to choose a name and choose OK. A search will be started immediately
  7704. based on the conditions of the named query.
  7705.  
  7706.    Delete a Query
  7707.  
  7708.      Because there are a limited number of named queries per document,
  7709. you may at some point want to delete queries that you no longer need. To
  7710. do this, choose the Delete Query option from the Edit Query window.
  7711. Then, type or choose the name of the query that you want deleted and
  7712. choose OK. Surefire will ask you if you really want to go ahead with the
  7713. delete operation. If you decide to proceed, that query will no longer be
  7714. available.
  7715.  
  7716.  
  7717.  
  7718.  
  7719.  
  7720.  
  7721.  
  7722.  
  7723.  
  7724.  
  7725.  
  7726.  
  7727.  
  7728.  
  7729.  
  7730.  
  7731.  
  7732.             Surefire User's Guide         Page 120
  7733.  
  7734.  
  7735. Chapter 19     -    Sharing Data Among Documents
  7736.  
  7737.      Once you start using a database, you may find it useful to access
  7738. the same data in another way through a different document. Suppose you
  7739. need to send a thank-you letter to many of the clients in your contacts
  7740. database. The letter would have fields for name, address, city, state
  7741. and salutation.  Wouldn't it be nice to share the same data that you
  7742. already have in your contacts database instead of having to type this
  7743. information all over again for each letter?  Or suppose you simply
  7744. wanted to list your contacts and their phone numbers, like in a phone
  7745. book. Wouldn't it be nice to again use the same data from the contacts
  7746. database?
  7747.  
  7748.      In Surefire, you can construct Smart documents for the thank-you
  7749. letter and phone book to project information from the contacts document.
  7750. This means you can access data from the contacts document, with a
  7751. totally different context, from a completely separate document. The
  7752. fields from these new documents would be linked to some of the fields of
  7753. the contacts document.  This linkage is achieved by projecting fields
  7754. from one document to another. With projection, you can link any two
  7755. documents together as long as one of the documents defines a database.
  7756. The result is that the second document has a different view of the
  7757. database than the original one.
  7758.  
  7759.      The notion of projection is the key to sharing data among Surefire
  7760. documents. It will allow you to perform mail-merge operations and
  7761. generate succinct reports from a database. In this chapter you will
  7762. learn how to project fields from one document to another and thus enable
  7763. this sharing to take place.
  7764.  
  7765. Base Documents vs Projected Documents
  7766.  
  7767.      A document that defines a database is called a base document.  Our
  7768. "contacts" document is a base document. A document that projects
  7769. information from a base document is called a projected document.  The
  7770. thank-you letter and contact list are examples of projected documents.
  7771. You can use a projected document when you want to see only a portion of
  7772. a data record whose fields are defined in a base document or when you
  7773. want to see all the information in a different way.
  7774.  
  7775.      You can look at the exact same data records in your thank-you
  7776. letter as you do in "contacts". In fact, you can do all the same
  7777. searching operations through the letter as you would in "contacts".
  7778.  
  7779.      As you can see, projection is a very powerful and convenient idea.
  7780. Projected documents are often used to support Mail Merge applications
  7781. (see "Chapter 20: Forms and Form Letters") and to produce formatted
  7782. reports (see "Chapter 22: Report Generation").
  7783.  
  7784.  
  7785.  
  7786.  
  7787.  
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.  
  7794.  
  7795.  
  7796.  
  7797.             Surefire User's Guide         Page 121
  7798.  
  7799.  
  7800. Projected Fields
  7801.  
  7802.      Earlier in this manual we introduced the concept of a field's data
  7803. attribute.  In the simplest sense the data attribute determines whether
  7804. a field is stored in a database or not. When you first created fields in
  7805. the property lease, this attribute was set to Not Stored. Later you
  7806. changed some of these fields to be Stored so that you could add a record
  7807. and create a database. Well, a projected field is also stored, however
  7808. its value is stored in a different document from the document that
  7809. contains the field. When a field is projected it has the data attribute
  7810. "Projected".
  7811.  
  7812.      Let's now take a closer look at the letter document. While most of
  7813. the fields are projected from the contacts document, the date field is
  7814. not. In fact, this date is set to default to today's date.  Documents
  7815. that contain projected fields may also have other fields that are not
  7816. projected. It is often very useful to have fields that contain the
  7817. result of an operation based on the projected fields. Multiplying
  7818. current sales figures by a growth rate to forecast next year's sales is
  7819. only one example.
  7820.  
  7821.      Note:  Any number of documents may share data from one base
  7822. document.  However, a document can not have both stored fields and
  7823. projected fields at the same time. That means that once a document has
  7824. one field that is Projected, it may have no fields that are Stored.
  7825. Conversely, once a document has a Stored field, it may have no fields
  7826. that are Projected. Surefire will warn you with a message window if you
  7827. try to make an invalid projection.
  7828.  
  7829.      Now let's move on and explore two ways in which you can project
  7830. fields. You will be surprised how easy it is to do.
  7831.  
  7832.    Projecting Fields Using the Clipboard
  7833.  
  7834.      You can easily project a field interactively by following a
  7835. procedure that is very similar to the combined operations of Copy and
  7836. Paste. First you edit the document that defines the fields you want
  7837. projected. Then you use Block or Line Selection to select the portion of
  7838. your document that contains the fields you want projected.  Now, instead
  7839. of choosing Copy or Cut, you choose "Project" from the Data menu. The
  7840. fields and surrounding text are copied to the Clipboard. You then Get
  7841. the destination document (or create a new document) and Paste the
  7842. clipboard object.  That's all there is to it. Even without saving the
  7843. document, you can immediately use it and access the database!
  7844.  
  7845.      As with copying fields between documents, the only information that
  7846. comes along with projected fields are the fields' types and format
  7847. attributes. Commands in the original fields will not be preserved in the
  7848. projected fields. Surefire will automatically assign new field IDs. If
  7849. you want to give these fields appropriate user names, you may do so via
  7850. the Command Edit window (see "Chapter 15: Using Field Commands").  Now
  7851. let's look at another way to specify projected fields.
  7852.  
  7853.  
  7854.  
  7855.  
  7856.  
  7857.  
  7858.  
  7859.  
  7860.  
  7861.  
  7862.             Surefire User's Guide         Page 122
  7863.  
  7864.  
  7865.    Projection as a Field Attribute
  7866.  
  7867.      You have seen that a field can be either stored in a database or
  7868. projected  from a database defined by some other document.  A field's
  7869. data attribute determines whether a field is stored in some database or
  7870. not at all. You can use the Field Create and Field Modify windows to set
  7871. the value of a field's data attribute.
  7872.  
  7873.      There may be times when you want to project fields by setting the
  7874. field's data attribute directly. If you set the value of the data
  7875. attribute multiple choice button to Projected in either of the above
  7876. windows, you will see two additional fields. These fields allow you to
  7877. enter the name of another document and the name of some field in that
  7878. document. Once you enter the name of a base document in the "Document:"
  7879. field, you can move to the "Field:" field and press (ALT+Z) to see a
  7880. pop-list of valid fields. If the field is already projected, the window
  7881. will indicate the correct base document and field.
  7882.  
  7883.      Note: If you project a field using this approach, and the projected
  7884. field is smaller than the original field, your data may be truncated
  7885. when viewed through the projected document.  On the other hand, if the
  7886. new field is larger, the excess space is appropriately padded. Any
  7887. truncation that occurs will not affect the actual data stored in the
  7888. database.
  7889.  
  7890.    Using Projected Fields vs Original Fields
  7891.  
  7892.      You may resize projected fields at any time. When they are made
  7893. smaller, truncation will occur when you view the data. When they are
  7894. enlarged, they will be padded appropriately. It is important to note,
  7895. however, that adding data to a database through a projected field which
  7896. is bigger than the corresponding field in the base document will result
  7897. in the database truncating the value to the size of the field in the
  7898. base document.
  7899.  
  7900.      While you may add records to a database using projected documents,
  7901. these records will generally be missing some information. Say you added
  7902. contact information to the contacts database using the letter. Because
  7903. the letter only has fields for name, address and salutation, the other
  7904. information such as phone number and age will be missing for this
  7905. contact. You can fill it in at a later time by updating the appropriate
  7906. database record using the contacts document itself.
  7907.  
  7908.  
  7909. Searching in a Projected Document
  7910.  
  7911.      Generally, you build queries using projected documents following
  7912. the same steps that you use for base documents. However, there are two
  7913. important differences that you need to be aware of:
  7914.  
  7915.      1.   If you build your query from fields that are projected from
  7916.      another document, the field name or ID that will appear on a query
  7917.      line is the name or ID of the field in the base document.
  7918.  
  7919.  
  7920.  
  7921.  
  7922.  
  7923.  
  7924.  
  7925.  
  7926.  
  7927.             Surefire User's Guide         Page 123
  7928.  
  7929.  
  7930.      2.   Very often, your projected document will not have all the
  7931.      fields that exist in the base document. However, you may want to do
  7932.      your query based on some of the fields that are not in the current
  7933.      document. For example, suppose you have a letter with projected
  7934.      fields for name, address and salutation. You now would like to send
  7935.      this letter to all contacts over the age of 30.  But age does not
  7936.      appear in the letter, so how do you target your clients with this
  7937.      condition?
  7938.  
  7939.      To do this, you open the Query window by choosing a projected field
  7940.      to give the initial query line. Then, you press (Ctrl+Z). This will
  7941.      display a pop-list of all database fields in the base document,
  7942.      including those that are not projected in the current document. If
  7943.      you choose one of these fields, a query line will be created for
  7944.      that field. This field may have no corresponding field in the
  7945.      current document. Or, this may be a field on a different page which
  7946.      is not currently visible.
  7947.  
  7948.      You may now change the new query line to the condition that you
  7949.      want. If you make this field the primary key, you may remove the
  7950.      query line of the field with which you initially opened the Query
  7951.      window. To do this, move the cursor to the line and press (Ctrl+D).
  7952.  
  7953.  
  7954.      In the next chapter you will use what you have learned about
  7955. projections to do the very common tasks of generating form letters and
  7956. mailing labels.
  7957.  
  7958.  
  7959. Printing Your Data
  7960.  
  7961.      Sometimes you will use a Surefire document to review information on
  7962. your screen. Often, you may want to print some of this information. Up
  7963. until now you have seen how to view only one record at a time. The
  7964. following sections discuss two ways of printing your one-at-a-time data
  7965. records.  The first method allows you to decide very specifically which
  7966. of your qualified records to print. The second method allows you to
  7967. print all of your qualifying records without any intervention.
  7968.  
  7969.      In "Chapter 22: Generating Reports", you will see how to view and
  7970. print information from more than one record at a time.
  7971.  
  7972.    Printing the Current Record
  7973.  
  7974.      No matter how you search for your data, you can always print the
  7975. document for the currently displayed record.  In fact, you can review
  7976. each record and print only those that you wish.  Suppose you just did a
  7977. search in your contacts database for everyone who lives in New York.
  7978. You can now go through these records using (F8) and (F7). As you do, you
  7979. selectively print the ones that you expect to contact while you are in
  7980. New York on business.
  7981.  
  7982.  
  7983.  
  7984.  
  7985.  
  7986.  
  7987.  
  7988.  
  7989.  
  7990.  
  7991.  
  7992.             Surefire User's Guide         Page 124
  7993.  
  7994.  
  7995.      Sometimes it may be handy to write a note about a specific contact
  7996. right on the contact record.  You do this by switching to Text edit
  7997. mode, editing the text, and then printing that record.  You can then
  7998. switch back to using the document to view other records. Before you can
  7999. use the document again two message windows will be displayed.  Just
  8000. choose YES on both of them.
  8001.  
  8002.    Printing All Qualifying Records
  8003.  
  8004.      Often, you may want to print all the records resulting from a query
  8005. without reviewing each record as it is retrieved. This may occur if you
  8006. are running a mail-merge operation where the result will be many letters
  8007. or mailing labels, each one being composed from a different database
  8008. record. To tell Surefire that you want this to occur, you must first
  8009. build a query or Get a named query. You then use a special feature of
  8010. the Print window to start a Search & Print operation.
  8011.  
  8012.      Surefire will qualify matching records according to the query
  8013. conditions, retrieve each record into your document and print that
  8014. instance of the document. Adjustments will be made for autosized fields
  8015. as well. Since this feature is most often used during form letter
  8016. generation, a full discussion will be deferred to the next chapter -
  8017. "Forms and Form Letters".
  8018.  
  8019.  
  8020.  
  8021.  
  8022.  
  8023.  
  8024.  
  8025.  
  8026.  
  8027.  
  8028.  
  8029.  
  8030.  
  8031.  
  8032.  
  8033.  
  8034.  
  8035.  
  8036.  
  8037.  
  8038.  
  8039.  
  8040.  
  8041.  
  8042.  
  8043.  
  8044.  
  8045.  
  8046.  
  8047.  
  8048.  
  8049.  
  8050.  
  8051.  
  8052.  
  8053.  
  8054.  
  8055.  
  8056.  
  8057.             Surefire User's Guide         Page 125
  8058.  
  8059.  
  8060. Chapter 20     -    Forms and Form Letters
  8061.  
  8062.      Suppose you have a letter that introduces your new product and you
  8063. would like to send it to all your clients in a particular region of the
  8064. country. However, you want to send more personal letters to your best
  8065. customers. Before the integration of word-processing and database
  8066. features this was a tedious task. You had to sit at a typewriter with
  8067. the index cards for these clients in hand, and to type each copy of the
  8068. letter with the appropriate names and addresses each time. Then, you had
  8069. to type the names and addresses again on the envelopes.
  8070.  
  8071.      Other tedious and repetitious tasks include invoices, contracts,
  8072. leases, sales agreements, order forms and reports that are done
  8073. periodically.  This includes all the standard pre-printed forms, which
  8074. require you to "fill in the blanks", that you can buy at your local
  8075. stationery store.  All of these everyday examples require you to enter
  8076. specific information into portions of a document.
  8077.  
  8078.      Many software packages available today offer some way to merge data
  8079. into your word processed documents while they are being printed.
  8080. However, you need to learn new concepts that are specific to these merge
  8081. operations. And most require the use of cryptic codes and special files
  8082. that have to be set up just right to work. This is usually referred to
  8083. as mail-merge or merge printing.
  8084.  
  8085.      In Surefire, there is no separate mechanism for specifying data
  8086. files, no cryptic merge commands and no new concepts to learn. Combining
  8087. text, data and calculations within a document, in a natural-to-use way,
  8088. is the basic idea behind Surefire. So, setting up to generate form
  8089. letters, mail labels, envelopes and pre-printed forms is no different
  8090. than composing a Smart document for a specific purpose.
  8091.  
  8092.      This chapter shows the various ways Surefire can produce form
  8093. letters, mail labels, envelopes and pre-printed forms by using some of
  8094. the basic concepts already discussed in this User's Guide.
  8095.  
  8096. What You Need to Know
  8097.  
  8098.      To conveniently produce forms or letters you need to create a Smart
  8099. document for your specific task.  After you have the right Smart
  8100. document, generating the forms or letters on you printer is a simple
  8101. matter. The first thing you do is to specify a query using the Query
  8102. window. Then, using the Print window you select Search & Print. Surefire
  8103. will retrieve each record according to your query, put it in the
  8104. document, do autosizing where specified and print. You will enjoy seeing
  8105. each form or letter composed on the screen and be able to stop the
  8106. process if you need to.
  8107.  
  8108.      There are three flavors of Smart documents that may apply. The
  8109. creation and use of these Smart documents have already been described
  8110. completely in previous chapters. We will discuss them here as they
  8111. relate specifically to forms and form letters. We will first look at the
  8112. differences between them and for what purposes each of them is best
  8113. suited.
  8114.  
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.  
  8121.  
  8122.             Surefire User's Guide         Page 126
  8123.  
  8124.  
  8125.    Documents with Fields and No Database
  8126.  
  8127.      This type of document allows you to quickly find and enter data
  8128. into the specific places you need to fill in.  This is done through the
  8129. simple use of fields. These fields may also be used to allow your input
  8130. to be only a date or a number. In addition, fields can be set to
  8131. automatically size according to the text that surrounds it. You can also
  8132. perform calculations automatically as you make entries.
  8133.  
  8134.      To produce multiple documents of this type you fill in the blanks
  8135. and print. Then you clear the fields, fill in the blanks again and print
  8136. again. Your typing is reduced to the minimum and each version comes out
  8137. perfect on the printer.
  8138.  
  8139.      This method is very useful but it assumes you will never expect to
  8140. re-use the information you've typed in. Once you've printed the document
  8141. and cleared the fields, the paper version is the only version you have.
  8142. In some cases, this may be exactly what you want.
  8143.  
  8144.      If you want to keep the data along the way, just set up your
  8145. document to have stored fields. This is the second flavor below.
  8146.  
  8147.    Documents with Stored Fields
  8148.  
  8149.      A document with stored fields is a document with a database. It can
  8150. be set up just like the one described above, but the data can be saved
  8151. while its being entered. All you need to do is to make sure you are
  8152. using stored fields.
  8153.  
  8154.      Now it becomes easy to do a lot of exciting and powerful things.
  8155. You can first type in all the information at once and then print it all.
  8156. You have all the data already entered, so later you can change the form
  8157. or letter and print the whole set again. Or, you can print only a
  8158. portion of the set.
  8159.  
  8160.      Not only that, unlike other systems that do merge printing, you
  8161. only need to work with one document. The same document that you print
  8162. from is the same document you enter data into and the same document you
  8163. can change when needed. There are no separate files that have to be
  8164. merged.
  8165.  
  8166.      Since your Smart document now has a database, you can access it to
  8167. find a specific person's address, use it for reference and even extend
  8168. the information you are collecting. You now have all the power of a
  8169. database. And, you can interact with your data directly through the form
  8170. letter or form you've created.
  8171.  
  8172.  
  8173.  
  8174.  
  8175.  
  8176.  
  8177.  
  8178.  
  8179.  
  8180.  
  8181.  
  8182.  
  8183.  
  8184.  
  8185.  
  8186.  
  8187.             Surefire User's Guide         Page 127
  8188.  
  8189.  
  8190.    Documents with Projected Fields
  8191.  
  8192.      A document with projected fields allows you to access information
  8193. from the database of another document. With this, you can do two things.
  8194. First, you can access data through a subset of all the fields that were
  8195. defined in the original document. Secondly, it gives you a way to keep
  8196. multiple letters or forms, ready to go, all accessing the same database.
  8197. Product announcements, follow-up letters and order forms can all share
  8198. the same database, eliminating the redundant entry and duplication of
  8199. information.  And don't forget, you can create buttons for immediate
  8200. access to your documents to build your own integrated application.
  8201.  
  8202.      Projected documents are very easy to create. The easiest way is to
  8203. use the Clipboard to copy the portions of your original document along
  8204. with the appropriate fields. Paste the copied portion to a new document,
  8205. edit the new document to be the way you want, save it, then start using
  8206. it. When you've done this once, you will realize there can be no easier
  8207. way.
  8208.  
  8209.      Now we will take you through a few practices to show you just how
  8210. it is done. You will see specific examples for form letters, mailing
  8211. labels and envelopes. You will also see how to set things up for a
  8212. pre-printed form.
  8213.  
  8214.  
  8215. Mailing Labels
  8216.  
  8217.      Mailing labels, form letters and envelopes are all very similar in
  8218. that they are primarily made up of the names and addresses of people
  8219. whom you contact. With one "contacts" database you can easily generate
  8220. mailing labels and the other stationery from the same data.
  8221.  
  8222.      Keep in mind, however, that if all you want to do is make labels,
  8223. the process is very simple.  If you just have a few to do, set your page
  8224. format for mailing labels and type in the text for as many labels as you
  8225. need. When you're finished, just print the document.  As an alternative
  8226. method, just create a label document with stored fields and enter the
  8227. names and addresses directly.  Since this becomes a database, you can
  8228. use "Search & Print" to generate the labels that you want.
  8229.  
  8230.      You can easily create mailing labels for your contacts database by
  8231. doing the following:
  8232.  
  8233.      1.  Edit your contacts document.
  8234.      2.  Project the fields.
  8235.      Use Block Select from the Edit menu to select the name, company and
  8236.      address fields. Choose Project from the Data menu. Press (F6) to
  8237.      hide the clipboard object. Now Block select the city, state and
  8238.      zipcode fields. This time take some of the text with it. You will
  8239.      be able to delete it later. Choose Project again from the Data
  8240.      menu. Press (F6) to hide the second clipboard object.
  8241.  
  8242.      3.  Choose New from the File menu to clear the document for a new
  8243.      mailing label document.
  8244.  
  8245.  
  8246.  
  8247.  
  8248.  
  8249.  
  8250.  
  8251.  
  8252.             Surefire User's Guide         Page 128
  8253.  
  8254.  
  8255.      4.  Paste the projected clipboard objects.
  8256.      View both clipboard objects by pressing (Shift + F6). Use the
  8257.      (Shift + Tab) key to select the first clipboard object. Move the
  8258.      object with the name, company and address to the upper left corner
  8259.      of the page and paste it by pressing (ALT+F3). Paste the remaining
  8260.      object below it. Now remove any unwanted text such as "state:",
  8261.      "zip", etc, by using the (Delete) key. Type in a comma ',' between
  8262.      the city and the state.
  8263.  
  8264.      5. Change the format for mailing labels.
  8265.      Choose "Format..." from the Page menu to open the Format window.
  8266.      Press (ALT+Z) to zoom the page sizes and choose "mailing labels".
  8267.      Make sure the margins are all set to zero. Choose OK to set this
  8268.      new format. The page size is actually a bit wider than 3 1/2 inches
  8269.      to accommodate the autosizing of certain fields.
  8270.  
  8271.      Notice that the bottom and right parts of the screen are shown with
  8272.      the same shading as a page break. This is because a mailing label
  8273.      is a very small page; not even as big as the screen.
  8274.  
  8275.      6.  Save the document with a name such as "labels".
  8276.  
  8277.  
  8278.    Printing Mailing Labels
  8279.  
  8280.      You will now see how to print mailing labels for all of your
  8281. contacts ordered alphabetically by state.  Before you start printing,
  8282. make sure that you have loaded your printer with the appropriate stock
  8283. for the type of document you are printing. For mailing labels, use the
  8284. single column 3-1/2 by 1 inch labels. Now follow this procedure:
  8285.  
  8286.      1.  Do a trial print.
  8287.      Get the your "labels" document and view any record by typing (F8).
  8288.      Choose Print from the Print window to just print the current
  8289.      record. Make sure that the printed text lines up well with the
  8290.      label.  If not, make the appropriate adjustments to your printer so
  8291.      that it starts printing at the upper left corner of your labels.
  8292.  
  8293.      2.  Build a query.
  8294.      Move the cursor to the state field before displaying the Query
  8295.      window. Choose "Build Query..." from the Data menu or press (ALT+Q)
  8296.      to display the Query window. Set the condition to find all contacts
  8297.      sorted alphabetically by state and press (Esc) to close the window.
  8298.      Query window.
  8299.  
  8300.      3.  Start the Search & Print.
  8301.      Press (ALT+F) P to display the Print window. Choose SEARCH & PRINT.
  8302.  
  8303.      Each copy of the mailing label will be briefly displayed on your
  8304.      screen before it is printed.
  8305.  
  8306.  
  8307.  
  8308.  
  8309.  
  8310.  
  8311.  
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.             Surefire User's Guide         Page 129
  8318.  
  8319.  
  8320. Envelopes
  8321.  
  8322.      Envelopes are very similar to mailing labels. You can project the
  8323. fields in exactly the same manner. The only difference is that you
  8324. format the document to have an envelope page. Do this with the Format
  8325. window. If the size you are using is in the "Page Sizes" pop-list, just
  8326. select it. If it isn't, you can specify the size explicitly by choosing
  8327. "Specific Setting". This allows you to type in the width and length of
  8328. your envelope. After setting the page size to match that of your
  8329. envelope, paste the projected fields so that they are lined up on the
  8330. page as you would like to see them on the envelope.
  8331.  
  8332.      If you already have a mailing label document, you may create an
  8333. envelope document even more easily. Just  Get the label document and
  8334. re-format the document with a page size of the proper envelope. Then,
  8335. move the fields to their appropriate places and Save the document with
  8336. a different name. The fields are automatically projected from the same
  8337. database.
  8338.  
  8339.       If you wish, you may type in your return address in the upper left
  8340. corner. The return address will then also be printed on each envelope.
  8341. Now save your document. Use (F8) to get any record. Print just one
  8342. envelope to see how things line up. Make adjustments if needed.
  8343.  
  8344. Form Letters
  8345.  
  8346.      Form letters are similar to mailing labels and envelopes except
  8347. that the address information is put on an 8 1/2 by 11 inch page with
  8348. margins. There is also a lot more text. And, of course, letters can have
  8349. more than one page in the document. Use the same procedures already
  8350. described for mailing labels to project fields. You may first type the
  8351. text of your letter and then bring in the fields or you can start by
  8352. projecting your fields.
  8353.  
  8354.      Date fields are a very handy feature in form letters. You can
  8355. create a date field to always hold today's date. To do this, create the
  8356. date field, where you want it, using the Create Field window. Make sure
  8357. the "Default to Today" attribute is set. Now, whenever you use the
  8358. document, today's date will automatically be set in the field.
  8359.  
  8360.      Form letters may also have fields embedded directly within the text
  8361. of your paragraphs. Suppose you are keeping the age of your clients in
  8362. your contacts database. Suppose further that you sell insurance and you
  8363. want to inform clients who are over the age of 65 that a special policy
  8364. is available. You would like your letter to read something like:
  8365.  
  8366.      "Being ?? years old entitles you to a very special policy..."
  8367.  
  8368.      The "??" can be substituted with the correct age just as easily as
  8369. the address information. Just project the age field, but first make sure
  8370. you select it with "Line Select" from the Edit menu. Now you may insert
  8371. it, just like a word into your letter. By the way, don't forget that
  8372. this field will behave just like a word. It will wrap and move as you
  8373. edit the document. You can access the database with the document.
  8374.  
  8375.  
  8376.  
  8377.  
  8378.  
  8379.  
  8380.  
  8381.  
  8382.             Surefire User's Guide         Page 130
  8383.  
  8384.  
  8385.      Now you can print your letters based on age and have the age appear
  8386. where it should in the sentence. Just open the Query window when the
  8387. cursor is on the age field. Make sure the condition is set to search for
  8388. contacts over age 65. (i.e. age GT    65 ). Finally, choose Search &
  8389. Print from the Print window.
  8390.  
  8391. Pre-Printed Forms
  8392.  
  8393.      In Surefire, you can make your own forms. You can set up an invoice
  8394. or sales quote form the way you want, for example. You type in the text,
  8395. draw the desired boxes and lines and create or project needed fields.
  8396.  
  8397.      Sometimes, it is more desirable or convenient to use pre-printed
  8398. forms. These forms already have all the "standard" text and lines
  8399. printed on them. Your job is to fill it out. As you might expect, you
  8400. can set up documents in Surefire to print on these forms too. There are
  8401. two things to consider when setting up for pre-printed forms. One is
  8402. that the fields need to be accurately positioned so they will line up
  8403. properly when printed. The other is that the Smart document containing
  8404. these fields should not have any other text in it.
  8405.  
  8406.      For pre-printed forms, it is best to use two Smart documents. One
  8407. will have all the needed fields lined up conveniently to be used as an
  8408. outline on the screen. Informative text will show what type of data is
  8409. expected in each field. These fields will be stored in a database. The
  8410. other form document will have a page size that is exactly that of the
  8411. paper form. You would project the fields from your outline document and
  8412. position them exactly where they need to be for printing. Use the form
  8413. document to do the printing on the paper form and use the outline
  8414. document for data entry.
  8415.  
  8416.      You can position the fields on the form by knowing your font size
  8417. and making some simple measurements. Since there are always 6 lines per
  8418. inch, you can measure the height of the form in inches and multiply by
  8419. 6. This will give you the number of lines on the form. By finding where
  8420. the first blank area is, you will have the line on which to start your
  8421. field.
  8422.  
  8423.      Now determine the pitch for your font. Look at the "Print Font"
  8424. multiple choice button of the Format window to see how many characters
  8425. per inch your font will print. Get the distance from the left edge of
  8426. the form to where there is a blank space for typing. Multiply this
  8427. distance by the characters per inch (pitch) of your font. This will give
  8428. you the column at which to place a field. Do this for each space on the
  8429. form and take note of the column numbers.  Now you have enough
  8430. information to place your fields correctly.
  8431.  
  8432.      After the fields are lined up in your form document, fill them out
  8433. completely. Fill text fields with x's, numeric fields with 1's, etc.
  8434. Then do a trial printing on a real form. Adjust your fields as needed.
  8435. If all the fields are off by the same distance, you may just need to
  8436. move the whole group of fields over a bit on the page. If not, you may
  8437. need to move some of the fields individually or you may need to adjust
  8438. the form in the printer to start at a place where things are lined up.
  8439.  
  8440.  
  8441.  
  8442.  
  8443.  
  8444.  
  8445.  
  8446.  
  8447.             Surefire User's Guide         Page 131
  8448.  
  8449.  
  8450. Chapter 21     -    Advanced Database Topics
  8451.  
  8452.      In this chapter you will learn about the more advanced features of
  8453. Surefire databases. These features will allow you to be more efficient
  8454. as your databases get larger.
  8455.  
  8456. Changing the Database Structure
  8457.  
  8458.      In Surefire, you define and create a database by indicating that
  8459. certain document fields are to be stored and by then adding your first
  8460. record.  You may still add, remove and change the sizes of these fields
  8461. in any way you wish. However, altering fields may require a new database
  8462. structure.  Sometimes this new structure will affect the data already
  8463. stored in your database. Creating this new structure is called
  8464. restructuring.  Let's illustrate with an example.
  8465.  
  8466.      Suppose the name field for our "contacts" document can only hold 15
  8467. characters. Up till now this has been sufficient, but you just met a
  8468. woman named Sharon Swenson-Tannenbaum and you realize that the name
  8469. field needs to be bigger.  Don't worry.  You can change the size of your
  8470. field and let Surefire take care of the rest.  First, you need to edit
  8471. your document to enlarge this field. (See Chapter 14: Working With
  8472. Fields). You do this in the same way as if the field were not stored.
  8473. But this time, when you try to use your document again, Surefire
  8474. displays a message window saying that a database restructure operation
  8475. is necessary.
  8476.  
  8477.      A database restructure is an automatic operation that changes the
  8478. database definition and adjusts all existing records to account for the
  8479. field changes.  Surefire will recommend a database restructure whenever
  8480. you add, delete, resize or change the name of  one or more   stored
  8481. fields.
  8482.  
  8483.      You may remember that the records that you delete are actually just
  8484. marked as inactive. This gives you a chance to reconsider whether you
  8485. actually want them permanently removed from the database. After a while,
  8486. it may become inefficient to search a database with many extra records.
  8487. You may remove these records from the database permanently through a
  8488. restructure operation. Choosing "Restructure" when you have not changed
  8489. any stored fields, will simply remove these unwanted records.
  8490.  
  8491.      A change in a Stored field's name requires a change to the database
  8492. definition and thus a restructure. If you want to change the name of a
  8493. Stored field, you must do so while editing the document. Just switch to
  8494. Document edit mode and then open the Command Edit window to change the
  8495. field names. You may change all field names as desired before choosing
  8496. the restructure operation.
  8497.  
  8498.      You tell Surefire to begin restructuring the database by choosing
  8499. "Restructure" from the Data menu while in Document edit mode.
  8500.  
  8501.  
  8502.  
  8503.  
  8504.  
  8505.  
  8506.  
  8507.  
  8508.  
  8509.  
  8510.  
  8511.  
  8512.             Surefire User's Guide         Page 132
  8513.  
  8514.  
  8515.      Surefire will preserve your existing data wherever possible.
  8516. However, sometimes a restructure may cause data loss or affect other
  8517. documents.  So, before beginning the restructure operation, Surefire
  8518. will give you a chance to reconsider in any of the following cases:
  8519.  
  8520.      If you                             Continuing may
  8521.  
  8522.      Make a stored field smaller.       Cause truncation or loss of
  8523.                                         data.
  8524.  
  8525.      Delete a stored field              Cause data loss.
  8526.  
  8527.      Delete or shrink a stored field    Affect projected documents. In
  8528.      when other documents project data  addition to the above
  8529.      from this document.                consequences, you may have
  8530.                                         projected documents with fields
  8531.                                         projected from fields that no
  8532.                                         longer exist. You must remove
  8533.                                         these fields.
  8534.  
  8535.      Note:   When you change a stored field, Surefire does not perform
  8536. a restructure automatically. This is because you may be modifying
  8537. several fields during the same period, and it may take some time. The
  8538. restructuring will take more or less time depending on the current size
  8539. of the database.
  8540.  
  8541.      Note:   You will not be able to use the document again until you
  8542. either restructure your database or exit from Surefire without saving
  8543. your changes.
  8544.  
  8545.  
  8546. Using Calculated Fields
  8547.  
  8548.      A calculated field is a field whose value depends on one or more
  8549. other fields in the document. The value of this field is set when a
  8550. field command is executed. Each time you display records from the
  8551. database, all field commands are re-executed. This allows the fields
  8552. whose values are based on stored fields to be calculated correctly for
  8553. the current record. Usually, you would not store these fields in a
  8554. database since Surefire can calculate their values as needed.
  8555.  
  8556.      In the "lease" document that we use in practices, there are some
  8557. calculated fields whose values are based on stored fields. Two of these
  8558. are the lease deposit and balance. They are both calculated to be half
  8559. the lease amount. Only the lease amount is stored. Each time that you
  8560. display a record of the lease, the deposit and balance change to show
  8561. the correct amount for that particular lease.
  8562.  
  8563.      Sometimes you may have a document that does a lot of calculations
  8564. and you notice that it takes a long time to display each record. Now,
  8565. Surefire could display your data more quickly if you stored your
  8566. calculated fields. This is because the commands used to generate the
  8567. values would not be re-executed for each displayed record.
  8568.  
  8569.  
  8570.  
  8571.  
  8572.  
  8573.  
  8574.  
  8575.  
  8576.  
  8577.             Surefire User's Guide         Page 133
  8578.  
  8579.  
  8580.      There is another reason why you may want to store a calculated
  8581. field;  you can search on the value of a calculated field only if it is
  8582. stored. For example, if you wanted to look for all the tenants who paid
  8583. a deposit of more than 400 dollars you would need to store the deposit
  8584. field in the database.
  8585.  
  8586.      If you find yourself wanting to query the database about a
  8587. calculated field, you can change the field's data attribute to Stored,
  8588. restructure the document and you have it.
  8589.  
  8590. Using Hidden Fields
  8591.  
  8592.      You can use a hidden field  to store temporary results from
  8593. calculations or to support a look-up table. A hidden field can also be
  8594. used when you want to calculate and display a value based on a database
  8595. field, yet you don't want to see the database field itself. Hidden
  8596. fields are not really hidden at all. They just reside at a place in your
  8597. document that is not normally displayed or printed.
  8598.  
  8599.      Suppose your database has a field containing a "method of payment"
  8600. code. These are two letter codes corresponding to how an order will be
  8601. paid:
  8602.           Code Meaning
  8603.  
  8604.           CK   Check
  8605.           MC   Master Card
  8606.           VS   VISA
  8607.           AM   American Express
  8608.           CS   Cash
  8609.  
  8610.      Now, you would like the full text description to be displayed.
  8611. Here's how. For each possible code, you put the appropriate text
  8612. string in a hidden field on another page of your document. When a data
  8613. record is displayed, a field command is executed that tests the
  8614. particular database field containing the code and finds the appropriate
  8615. text in the look-up table.
  8616.  
  8617.      Here's another example of using hidden fields.  Suppose you have a
  8618. projected document where you want to display data calculated from
  8619. certain database fields but you do not want the original fields to
  8620. appear. Since all field references in the calculated field must be known
  8621. (i.e. exist somewhere in the document), you will need to use hidden
  8622. fields.
  8623.  
  8624.      It is generally convenient to put hidden fields on the last page of
  8625. the document, separate from everything else. You can label them and make
  8626. notes next to them as you wish. And, when you print, if you do not want
  8627. this page printed, it is easy to say so in the Print window.
  8628.  
  8629.  
  8630.  
  8631.  
  8632.  
  8633.  
  8634.  
  8635.  
  8636.  
  8637.  
  8638.  
  8639.  
  8640.  
  8641.  
  8642.             Surefire User's Guide         Page 134
  8643.  
  8644.  
  8645. Using Database Searching Functions
  8646.  
  8647.      There are a number of functions in Surefire that specifically
  8648. relate to database operations. Some functions allow statistical
  8649. calculations on field values that span more than one database record.
  8650. These include finding the sum, average, maximum and minimum values for
  8651. a set of records. These functions are only meaningful when you display
  8652. a list of records as a report. They are therefore discussed in "Chapter
  8653. 22: Generating Reports".
  8654.  
  8655.      Other functions used with data records control searching a
  8656. database. These are typically used in field commands for button fields.
  8657. These functions are used extensively for building applications with
  8658. Surefire's Smart documents. The table below summarizes these functions.
  8659.  
  8660.      Use Function   To
  8661.  
  8662.      @QUERY    Run a named query.
  8663.      @JOIN     Run a named query in another document.
  8664.      @CNDX     Define conditions to be used in @QUERY or @JOIN.
  8665.      @UPDATE   Update the currently displayed record with all field
  8666.                values.
  8667.      @SEARCH   Search the database based on the value in the current
  8668.                field.
  8669.  
  8670.      On the following pages we show how to use the @JOIN and @CNDX
  8671. functions to join a base document with a document projected from the
  8672. same database. At the end of this chapter, you will learn how these
  8673. functions may be used to join two databases together. These functions
  8674. are fully described in the section "Database Searching Functions" of
  8675. "Appendix A: Surefire Function Reference".
  8676.  
  8677.      The use of @CNDX and @JOIN together is especially powerful. Because
  8678. of this we will explain through an illustration and a step by step how
  8679. they work. The documents "contacts" and "letters" are linked together
  8680. through the use of these commands. This command is in the Letter button
  8681. of "contacts":
  8682.                     @CNDX("letter", "curname", A, ,"name");
  8683.                     @JOIN("letter", "curname")
  8684.  
  8685. In the "letter" document is the query "curname" with a query line
  8686. looking for "the Text field 'name' Is Exactly blank". The blank data
  8687. entry field for the condition will eventually be filled in by the result
  8688. of the @CNDX function or what is in field A, the contact's actual name.
  8689.  
  8690.      Let's discuss how everything works together. When you press the
  8691. button Letter, you will see a letter with address information for the
  8692. current contact. To do this, the button has a command with both an @CNDX
  8693. function and an @JOIN function. The @CNDX function sets a value for a
  8694. specific condition of a named query. (You can use one @CNDX function for
  8695. each condition or query line of a query). The @JOIN function tells
  8696. Surefire to display the specified document and search the database using
  8697. a named query.
  8698.  
  8699.  
  8700.  
  8701.  
  8702.  
  8703.  
  8704.  
  8705.  
  8706.  
  8707.             Surefire User's Guide         Page 135
  8708.  
  8709.  
  8710.      It's not always necessary to set values for conditions of a query,
  8711. but we want to in this case. That's because we want to display the
  8712. letter showing only the address information for the currently displayed
  8713. contact. The @CNDX here has these arguments: ("letter", "curname", A, ,
  8714. "name").  The first two arguments tell Surefire to set a value for a
  8715. condition in the named query curname in the document letter.  Notice the
  8716. quote marks ("); they are required.
  8717.  
  8718.      The third argument, A, represents field A in the "contacts"
  8719. document. This field holds the  contact's name. Because this field was
  8720. given the name "name", we could have used name instead of A in the
  8721. function.  When the command is executed, Surefire will remember the
  8722. value of the contact name field. It will then use this value for one of
  8723. the conditions of the named query 'curname'.
  8724.  
  8725.      The fourth argument is missing from this function as shown by the
  8726. two commas. This argument would be used if we were setting the values of
  8727. a range condition. It can have the value for the upper end of the range.
  8728. In our example we have the single condition Is Exactly, so this argument
  8729. is not needed.
  8730.  
  8731.      The fifth argument tells Surefire the specific line of the query
  8732. whose condition you want to set. In this case, "name" relates to name
  8733. which is displayed at the left of the query line in curname. The quotes
  8734. (") here are also required.  Notice in the query that we left the data
  8735. entry field to the right of the condition button blank. This is because
  8736. we want Surefire to substitute a value from the @CNDX function before
  8737. the query is actually used. If the query curname were executed without
  8738. setting a condition value, the search would look for contact names that
  8739. are exactly all blank and would probably find no matching records.
  8740.  
  8741.      Finally, the @JOIN command says simply to display the document
  8742. letter and run the query curname. So now Surefire knows that you really
  8743. want to display the letter for the contact whose name is in the name
  8744. field. The practice on the next page gives you the steps to display the
  8745. letter for the currently displayed contact at the press of a button.
  8746.  
  8747.  
  8748. Recalling a Deleted Record
  8749.  
  8750.      The data records that you delete when you choose "Delete Record(s)"
  8751. from the Data menu are actually not removed from the database but are
  8752. made inactive.  You may recall a previously deleted record, that is,
  8753. restore it to an active status, if it is the currently displayed record.
  8754. But, since deleted records are not usually displayed, you must first
  8755. indicate that you wish to view these deleted records.
  8756.  
  8757.      You do this by changing the setting of the "Record Type for Search"
  8758. button in the Search Options window to All or Deleted. This window is
  8759. accessed from the Data menu and is described in the chapter "Searching
  8760. a Database". Then, you can define a query and start your search. The
  8761. records that interest you will be displayed.
  8762.  
  8763.  
  8764.  
  8765.  
  8766.  
  8767.  
  8768.  
  8769.  
  8770.  
  8771.  
  8772.             Surefire User's Guide         Page 136
  8773.  
  8774.  
  8775.      When the record you want to recall is visible, choose "Recall
  8776. Record(s) " from the Data menu or press (F5). The status indicator
  8777. "RECORD RECALLED" will be briefly displayed at the right side of the
  8778. status line.
  8779.  
  8780.      Note: All inactive records are finally removed from the database
  8781. when the database is restructured. Until then, you may recall them
  8782. whenever you wish.
  8783.  
  8784. Manipulating Record Sets
  8785.  
  8786.      Up until now we have been talking about how to work on one data
  8787. record at a time. Suppose you had a number of salespersons who were
  8788. responsible for different territories. The salesperson and territory
  8789. might be fields of your contacts database. If you want to reassign all
  8790. of the clients in one specific territory to another salesperson, you
  8791. certainly wouldn't want to change and update each individual record in
  8792. that territory. Surefire provides a way to update, delete and recall all
  8793. records in a record set. That means you can update, delete and recall
  8794. all the records that satisfy specific conditions at one time.
  8795.  
  8796.    Updating A Record Set
  8797.  
  8798.      Sometimes you may want to have the value of a single field updated
  8799. to reflect some new information for all records that satisfy certain
  8800. conditions. This is often called group update or mass update. For
  8801. example, you might have just sent a letter to all of your contacts in a
  8802. certain zip code. You will want to change the date of the last letter
  8803. sent, in all of these records, to today.
  8804.  
  8805.      To do this, you must first build your query or Get a named query.
  8806. Then, instead of performing a search, you move to the document field
  8807. that you want changed and enter the new value that you want all the
  8808. qualifying records to have. Choose "Update Record(s)" on the Data menu.
  8809.  
  8810.      Before the update takes place, the message "All qualifying records
  8811. will be updated" is displayed. Choose YES if you want the update to
  8812. occur or NO otherwise. After all records have been updated, the status
  8813. indicator "RECORD(S) UPDATED" will be displayed briefly at the right of
  8814. the status line.
  8815.  
  8816.      When the update is finished, all records will have the new value.
  8817. You can repeatedly use the same procedure to update other fields of the
  8818. same qualifying records.
  8819.  
  8820.    Deleting A Record Set
  8821.  
  8822.      When you delete a record, you display it first to make sure that it
  8823. is the correct one. At times, you may want to delete a group of records
  8824. that satisfy some specific condition at one time without reviewing each
  8825. one. This is sometimes called group delete or mass delete.  For example,
  8826. you may want to remove all contacts where the last correspondence was
  8827. sent more than two years ago. Or if you've just stopped eating red meat,
  8828. you may want to remove your recipes that include beef.
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.  
  8835.  
  8836.  
  8837.             Surefire User's Guide         Page 137
  8838.  
  8839.  
  8840.      To delete these records, you can follow a procedure similar to that
  8841. used for a group update. In this case, you build or Get a query but you
  8842. do not specify a new field value. Then you choose "Delete Record(s)"
  8843. from the Data menu or press (ALT+F5).
  8844.  
  8845.      Before the deletions are done, the message, "All qualifying records
  8846. will be deleted", is displayed. Choose YES if you want the deletes to
  8847. occur or NO otherwise. After all records have been deleted, the status
  8848. indicator "RECORD(S) DELETED" will be displayed briefly at the right of
  8849. the status line.
  8850.  
  8851.      If you continue after the warning message, all qualifying records
  8852. will be deleted or made inactive.  You may, of course, recover them by
  8853. restoring them to active status through a recall operation. You may
  8854. practice this using a query of your choice and then recall the deleted
  8855. records by following the procedure in the next section.
  8856.  
  8857.      Note:   You must change the "Record Type for Search" option in the
  8858. Search Options window to All or Active before deleting a record set.
  8859.  
  8860.    Recalling A Record Set
  8861.  
  8862.      Especially if you have second thoughts about records that you
  8863. deleted as a group, you may sometimes want to recall a group of records
  8864. at one time without reviewing each one. To do so, you follow a procedure
  8865. which is similar to deleting a record set. The only difference is that
  8866. you choose "Recall Records" from the Data menu or press (F5), instead.
  8867. All qualifying records will be recalled.
  8868.  
  8869.      Before the recall takes place, a warning message is displayed.
  8870. Choose YES if you want the recall to occur or NO otherwise. After all
  8871. the records have been recalled, the status indicator "RECORD(S)
  8872. RECALLED" will be displayed briefly at the right of the status line.
  8873.  
  8874.      Note:   You must change the "Record Type for Search" option in the
  8875. Search Options window to All or Deleted before recalling a record set.
  8876.  
  8877.  
  8878. Importing and Exporting Data
  8879.  
  8880.      You have seen how to use the database features of Surefire's Smart
  8881. Documents to keep your information in one handy place. Sometimes,
  8882. however, you may need to use data from other database systems. Or, you
  8883. may purchase data such as mailing lists in a format that you would like
  8884. Surefire to read.
  8885.  
  8886.      In the following sections you will learn how to use the import and
  8887. export facilities of Surefire to bring in data from other programs and
  8888. output data from Surefire to other programs. You will see that by
  8889. exporting and importing data, you can easily create new Surefire
  8890. databases and even merge many databases into one larger database.
  8891.  
  8892.  
  8893.  
  8894.  
  8895.  
  8896.  
  8897.  
  8898.  
  8899.  
  8900.  
  8901.  
  8902.             Surefire User's Guide         Page 138
  8903.  
  8904.  
  8905.    Importing Data
  8906.  
  8907.      If you have data from another program that you wish to incorporate
  8908. into a Surefire database, it must be in the form of an ASCII data file.
  8909. You need to follow the procedures for the application from which you are
  8910. getting the data. Most popular applications will be able to output data
  8911. to a file in this ASCII (text) data format. Once you have the data from
  8912. the other program in the correct format, you can import  that data into
  8913. Surefire through a document. If there is already a database associated
  8914. with the document, the imported records will be appended to the
  8915. database. If there is no associated database, one will be created. To
  8916. import the data you use the Get File window by setting the file type
  8917. button to "Data File".
  8918.  
  8919.       There are some simple formatting rules that must be followed to be
  8920. sure that both the ASCII data file and your document conform correctly.
  8921. These rules are described below:
  8922.  
  8923.      Format for the ASCII Data File
  8924.  
  8925.      1)   Each text value in the ASCII file must be surrounded by quotes
  8926.           (").  Number values may or may not have quotes.
  8927.  
  8928.      2)   All values must be delimited by a comma (,).
  8929.  
  8930.      3)   Each record or set of data values must be terminated by a
  8931.           (CR-LF) character.
  8932.  
  8933.      4)   If no filename extension is given to the ASCII file, the
  8934.           default extension, .DTA, will be assumed.
  8935.  
  8936.      Rules for Setting Up Surefire Documents for Import
  8937.  
  8938.      1)   If there are n fields to be imported into the database, the
  8939.           first n Stored or Projected fields of the document must
  8940.           correspond in order and type to the fields in the ASCII import
  8941.           file.
  8942.  
  8943.           The ordering of the fields in the document is the same as the
  8944.           way you move from field to field using the (End) key. That is,
  8945.           from left to right and then down through the document.
  8946.           Corresponding in type means that number values in the ASCII
  8947.           file go with numeric fields in the document, text values go
  8948.           with text fields, etc.
  8949.  
  8950.      2)   Any additional Stored/Projected fields in the document will
  8951.           set their associated database fields, in all records, to their
  8952.           currently displayed values in the document.  If there are
  8953.           calculated fields which are Stored, the calculated values for
  8954.           these fields will be stored in the data records.  That is, the
  8955.           calculations will be performed just before the imported data
  8956.           is added as a record.  Database fields without corresponding
  8957.           document fields will have their values cleared in all imported
  8958.           records.
  8959.  
  8960.  
  8961.  
  8962.  
  8963.  
  8964.  
  8965.  
  8966.  
  8967.             Surefire User's Guide         Page 139
  8968.  
  8969.  
  8970.      3)   There must be at least as many Stored or Projected fields in
  8971.           the destination Surefire document as the number of values you
  8972.           want imported from each record in the ASCII data file.
  8973.  
  8974.      4)   The ASCII data file may have field values that you do not want
  8975.           to import.  If this is the case, you must create a Non-Stored
  8976.           field of the appropriate type in the proper place in your
  8977.           document. This dummy field will act as a placeholder to accept
  8978.           the value. Use a dummy field also if there are empty values at
  8979.           the same place in all records of the ASCII file. Empty values
  8980.           are indicated by two adjacent commas (,,).
  8981.  
  8982.      5)   If a Surefire document field is smaller than the value for
  8983.           that field from any imported record, that value will be
  8984.           truncated.
  8985.  
  8986.      Say you want to import data from a file that we have set up as an
  8987. ASCII data file from another database. This database has the following
  8988. fields defined; person's name, age, phone number and marital status. The
  8989. first field is a text string, the second is a number and the third and
  8990. fourth are also text strings. To import the data from this database into
  8991. a Surefire document, you need to get the data written like this:
  8992.  
  8993.      "name",age,"phone number", "marital status" (CR-LF)
  8994.           or
  8995.      "name","age","phone number","marital status" (CR-LF)
  8996.  
  8997.      Notice that the age field may or may not have double quotes (").
  8998. This is because it is a simple integer number. Notice also that each
  8999. line in the example text file is terminated by a carriage return and
  9000. linefeed character shown here as (CR-LF).
  9001.  
  9002.      Now let's say that you want to import this data (which is in a file
  9003. called IMPORT.DTA) into the "contacts" document. This document contains
  9004. fields for name, address, phone, age, notes, etc. You may notice that
  9005. the order of the fields in this document doesn't match the order of
  9006. values in the data file. Also, there is no field in "contacts"
  9007. corresponding to marital status.  What you need to do is create a
  9008. projected document with projected fields for name, age and phone number
  9009. in this order. This document will have a dummy field for marital status.
  9010.  
  9011.      Note:   You could add a marital status field to your "contacts"
  9012. document and restructure your database.  Then you could also project the
  9013. marital status field and also import the marital status data.
  9014.  
  9015.      As you import data, each successive record read from the ASCII file
  9016. will be added to the Surefire database that corresponds to the document.
  9017. Any fields in the document that follow these four fields will be
  9018. unchanged by the import. If there are any Stored or Projected fields in
  9019. the document that do not correspond to values in the ASCII file, their
  9020. values that are displayed in the document at the time of the import will
  9021. be used to set default values for those fields of the new data records.
  9022. If there are no such fields, the values of these parts of the data
  9023. records will remain clear and can be filled in later.
  9024.  
  9025.  
  9026.  
  9027.  
  9028.  
  9029.  
  9030.  
  9031.  
  9032.             Surefire User's Guide         Page 140
  9033.  
  9034.  
  9035.    Exporting Data
  9036.  
  9037.      If you have data in a Surefire database that you wish to
  9038. incorporate into another program, you may do so by writing the data out
  9039. into an ASCII data file. This is known as exporting the data. In
  9040. Surefire you can export data using the same format already described for
  9041. importing data. This format is understood by most popular programs. You
  9042. may use any query to limit which data records are exported from a
  9043. database. You may use projected documents to limit which fields of data
  9044. records are exported, and to rearrange the order in which their values
  9045. will be written to the ASCII data file.
  9046.  
  9047.      To export the data, use the Save File window, setting the file type
  9048. button to "Data File". Then follow the rules described below.
  9049.  
  9050.      Rules for Exporting Surefire Data
  9051.  
  9052.      1)   No export will occur unless the associated Surefire database
  9053.           exists and there is at least one record that satisfies the
  9054.           search conditions.  An appropriate query must be specified
  9055.           before the data export is initiated.
  9056.  
  9057.      2)   The values of all fields of the current document, excluding
  9058.           buttons, will be exported.
  9059.  
  9060.      3)   The order of the fields put into the ASCII data file will be
  9061.           the order in which they appear in the Surefire document.
  9062.  
  9063.      4)   The output of the export operation will be in the ASCII data
  9064.           file format described on page 21-17.
  9065.  
  9066.  
  9067.      To export data from a Surefire database, follow these simple steps:
  9068.  
  9069.      1)  Get the document from which you want to export data.
  9070.      2)  Build a query to limit the records to be exported.
  9071.      3)  Open the Save File window and set the File Type multiple choice
  9072.      button to "Data File". Type in the name of the file you want to
  9073.      contain the exported data. Surefire will give this file the
  9074.      extension .DTA. Press OK to start the database search and export
  9075.      operation. You will hear a beep when the export has finished.
  9076.  
  9077.  
  9078.    Merging and Extracting Surefire Databases
  9079.  
  9080.      There are times when you may want to create a new database from one
  9081. that already exists. This new database may have fewer records or fewer
  9082. fields. With a smaller portion of the data, all your database operations
  9083. will perform more efficiently. Also, you can analyze this data while
  9084. someone else is using the original database. You would use this smaller
  9085. database periodically, perhaps, to do your monthly reports. Each month,
  9086. you would extract the most recent data from the "master" customer
  9087. database.
  9088.  
  9089.  
  9090.  
  9091.  
  9092.  
  9093.  
  9094.  
  9095.  
  9096.  
  9097.             Surefire User's Guide         Page 141
  9098.  
  9099.  
  9100.      At other times you may want to have a database that is a
  9101. conglomerate of many other databases with the same format. For example,
  9102. say each salesperson has a database of sales activities that are in his
  9103. territory. You may want to "merge" these independent databases into a
  9104. single one for analysis. You can analyze the effectiveness of all your
  9105. sales activities to help produce your sales forecasts.
  9106.  
  9107.      Since the file format required for importing data and the one
  9108. needed for exporting data are the same, you may use consecutive export
  9109. and import operations to extract and merge data from Surefire databases.
  9110. The databases may be merged together simply by importing one or more
  9111. extracted ASCII data files into the same document.
  9112.  
  9113.  
  9114. Joining Two Databases
  9115.  
  9116.      Earlier in this chapter you were introduced to the database
  9117. searching functions. You saw how to use @JOIN and @CNDX to join two
  9118. documents together that share the same database. With Surefire it is not
  9119. necessary that a database be shared for one document to link with
  9120. another.  The only thing that is required is that the two databases
  9121. share at least one piece of data. As long as the fields with this data
  9122. are the same type and size, a join is possible.
  9123.  
  9124.      For example, if your "contacts" database has a field for company
  9125. name. you might have an "account history" database that also has a field
  9126. for company name.  Let's call the account history document, "accthist".
  9127. If records are entered in both databases for the same company, a button
  9128. in the "contacts" document can be used to bring up the account history
  9129. information about the current company. You would use the @CNDX function
  9130. to set the query condition based on the company name in the "contacts"
  9131. document. You then use @JOIN to go to and execute a named query in the
  9132. "accthist" document based on this same company name.
  9133.  
  9134.      Voila, you are well on your way to creating Smart Document
  9135. applications!
  9136.  
  9137.  
  9138.  
  9139.  
  9140.  
  9141.  
  9142.  
  9143.  
  9144.  
  9145.  
  9146.  
  9147.  
  9148.  
  9149.  
  9150.  
  9151.  
  9152.  
  9153.  
  9154.  
  9155.  
  9156.  
  9157.  
  9158.  
  9159.  
  9160.  
  9161.  
  9162.             Surefire User's Guide         Page 142
  9163.  
  9164.  
  9165. Chapter 22     -    Generating Reports
  9166.  
  9167.      Up until now you have seen how to get one record of data into your
  9168. document at a time. Often, you want to see many records or data fields
  9169. in relation to one another at the same time. You may want to see just
  9170. the names and phone numbers of all your contacts. Or, you may be
  9171. interested in seeing statistical data based on your records. This can be
  9172. something like the average salaries of personnel in each department of
  9173. your company, or the number of clients in each city of a region, etc.
  9174.  
  9175.      A report is the result of using a document to retrieve more than
  9176. one data record at a time. You can use a report to see many records in
  9177. relation to one another or to produce a summary of database information
  9178. ready for printing. You might want to list all of your contacts and
  9179. their phone numbers or your company personnel and their departments.
  9180.  
  9181.      Suppose you use a document to enter information about the personnel
  9182. in your company. This document might have fields for name, title, phone,
  9183. mail stop and department laid out one above.
  9184.  
  9185.      Because of the difference in layout and amount of information, the
  9186. document you use for a report generally has projected fields. You create
  9187. this document by projecting fields the way you would for forms and form
  9188. letters except you place the fields and text differently, generally left
  9189. to right across the page. You then give the fields report attributes.
  9190. Instead of having each data field on a separate line or imbedded in
  9191. paragraphs, you generally will have the fields across the page with
  9192. column names across the top of each page. Surefire's general page layout
  9193. capabilities allow a report to be printed on an 8-1/2 by 11 page with
  9194. standard margins and a header on each page.
  9195.  
  9196.      There is no reason why you could not use a document laid out in
  9197. report format to add and review records one-at-a-time as we discussed in
  9198. the previous chapters. However, you can see that the first document is
  9199. more convenient for data entry. Now you will learn how to set up the
  9200. second type of document layout for data reporting.
  9201.  
  9202.  
  9203. Formatting a Report
  9204.  
  9205.      A field's format attributes determine the way data in the field
  9206. looks. Its data attribute determines whether or not a field is stored in
  9207. a database. A field may have one other type of attribute. The report
  9208. attributes of a field determine how the values of many database records
  9209. are to appear in your document. You assign report attributes to fields
  9210. in order to tell Surefire that a document will be used to retrieve more
  9211. than one data record at a time. You specify these additional attributes
  9212. in the Format Report window. You may display this window by choosing
  9213. "Format Report..." from the Data menu while you are in Document edit
  9214. mode.  This window contains various options that determine how multiple
  9215. data records will expand into your document to produce a report.
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.  
  9223.  
  9224.  
  9225.  
  9226.  
  9227.             Surefire User's Guide         Page 143
  9228.  
  9229.  
  9230.      An entire document can be a report or you can imbed your report
  9231. directly within the body of another document. Suppose you want the
  9232. milestones that represent the progress on a specific task to be
  9233. generated right into the middle of a progress report. Or suppose you
  9234. have supporting statistics that you want to appear as an addendum to a
  9235. summary letter.  By placing the fields with report attributes at the
  9236. proper places in your document, you can  accomplish this.
  9237.  
  9238.      You don't even need to worry about having lots of empty pages in
  9239. your document since Surefire will add pages as needed to accommodate all
  9240. the records. This gives you a lot of flexibility. The following sections
  9241. describe each of the formatting options available in the Format Report
  9242. window.
  9243.  
  9244.    Specifying Repeated Fields
  9245.  
  9246.      You indicate how the data of each retrieved data record will be
  9247. displayed one after another by giving these fields a repeat setting.
  9248. Surefire still uses fields to display the values of stored data records,
  9249. but just before each successive qualifying record is displayed, the
  9250. repeated fields "move" to a new location. With a repeat setting, you
  9251. specify where this new location is. Now Surefire can display the next
  9252. set of data. To generate a report, you must have at least one field that
  9253. has a repeat setting. Generally, you would set your repeated fields
  9254. before using any of the other report attributes.
  9255.  
  9256.       You can repeat both stored and non-stored fields. The non-stored
  9257. fields are usually fields with values calculated from database fields
  9258. but they may actually have constant values or trim.  Once you know the
  9259. fields that you want to repeat, you switch to Document edit  mode so
  9260. that you can set the report attributes for them. You select the fields
  9261. by using Field selection before you open the Format Report window.
  9262.  
  9263.      If there are no report attributes for the first selected field, you
  9264. will see a response window that looks like this:
  9265.  
  9266.       You may respond by choosing YES or NO. If you choose NO, you
  9267. return directly to the document without setting any report attributes.
  9268. If you choose YES, the Format Report window will be displayed.
  9269.  
  9270.      The second action button at the top of the Format Report window is
  9271. SET OFFSET. Choosing this button will temporarily close the window and
  9272. allow you to position the cursor in the document. The cursor will
  9273. initially be at the left character of the left most field that you had
  9274. selected.  You  move the cursor downwards to define the vertical report
  9275. spacing by pressing (down arrow). Each screen position that you move
  9276. tells Surefire how much space to leave between successive records. Once
  9277. the cursor is where you want it, press (Enter). If you would rather not
  9278. finish the layout at this time, press (Esc) to cancel. In either case,
  9279. the Format Report window will reappear.
  9280.  
  9281.  
  9282.  
  9283.  
  9284.  
  9285.  
  9286.  
  9287.  
  9288.  
  9289.  
  9290.  
  9291.  
  9292.             Surefire User's Guide         Page 144
  9293.  
  9294.  
  9295.      When the Format Report window is redisplayed, a new multiple choice
  9296. button will appear saying Fill Down. In addition, the number of blank
  9297. lines to leave between the data from each record is indicated by the
  9298. text "Skipping 1 Lines". Choosing OK at this point sets the report
  9299. attributes.  All fields that are repeated will have the same repeat
  9300. setting and thus will have the same spacing between data records. Each
  9301. data record may take up more than one line of the report.
  9302.  
  9303.      The next search in this document would bring back all qualifying
  9304. records, display each one on a line, filling records to the bottom of
  9305. every page, and create pages as needed until all records were retrieved.
  9306.  
  9307.      The "Fill Down" button has another possible value of "Repeat field
  9308. n times". If you wanted only a limited number of records to be displayed
  9309. per page, press (Spacebar) to change Fill Down to Repeat field.  Then
  9310. enter the number of times in the data entry field.
  9311.  
  9312.    Using Trim
  9313.  
  9314.      Trim is constant text and graphics that adds emphasis to your
  9315. report. You can have trim fields that have a repeat attribute to appear
  9316. near each data record. Or, you can use trim to label report columns or
  9317. to appear at the top or bottom of every report page. Trim might consist
  9318. of lines, tic marks, text, etc. And, you can always use the Header and
  9319. Footer regions of the document for report titles, etc.
  9320.  
  9321.       To use trim, you must first create text fields in your report
  9322. document to hold the trim. Then, using the document, you put the desired
  9323. text or graphics into the fields. Once this is done, you can specify the
  9324. trim fields to be repeated along with the other data fields. Use the
  9325. same method described above for data fields to show Surefire how these
  9326. trim fields are laid out.
  9327.  
  9328.      For example, if you want to have lines or tic marks drawn after
  9329. every record, simply create a text field below the repeated fields, use
  9330. line drawing to draw a line in the text field, and set the repeat for
  9331. this field along with the stored fields.
  9332.  
  9333.    Clearing the Repeat Specification
  9334.  
  9335.      Once you have associated a repeat attribute with your fields, you
  9336. may wish to remove it from some or all of the fields. To do this you
  9337. must first select the fields that already have a specified repeat
  9338. setting. Then you display the Format Report window and choose the button
  9339. CLEAR REPEAT. When you press OK, the repeat attribute for these fields
  9340. will be cleared. Once you save the document, these fields will no longer
  9341. be repeated when the report is generated.
  9342.  
  9343.    Displaying at the Top or Bottom of Pages
  9344.  
  9345.      The normal Header and Footer regions of Surefire documents are
  9346. always repeated in the top and bottom margin for every page of your
  9347. document. As a report is generated, you may want different header and
  9348. footer information displayed at the top or bottom of each report page.
  9349.  
  9350.  
  9351.  
  9352.  
  9353.  
  9354.  
  9355.  
  9356.  
  9357.             Surefire User's Guide         Page 145
  9358.  
  9359.  
  9360. This could either be calculated field values or trim data such as column
  9361. headings. You use a report attribute to have a field displayed at the
  9362. top or bottom of report pages. This attribute is also set via the Format
  9363. Report window. Unlike the page Header and Footer, this information is
  9364. displayed within the margins and only on those pages of the document
  9365. into which the report is generated.
  9366.  
  9367.      At the left of the text "Display value at top of page", is a
  9368. logical field. Choose "Y" to indicate that your selected fields will
  9369. have their values displayed at the top of every page. The exact position
  9370. will be the same position that the original field is from the top of its
  9371. page. For example, if one of the fields were at column 50 and 2 lines
  9372. from the top margin, then its value would always be displayed at column
  9373. 50 and 2 lines from the margin on every page. Any repeated fields would
  9374. begin below this field on each page.
  9375.  
  9376.      The next setting: "Display value at bottom of every page" is just
  9377. the opposite. Use this to put field values at the bottom of every page.
  9378.  
  9379.    Displaying at the End of a Report
  9380.  
  9381.      To display text or the value of a field at the end of a report,
  9382. just make sure that it is located below any repeated fields. Do not give
  9383. the field any report attributes. As the report is generated, the text
  9384. and fields will move toward the end of the document. The fields will be
  9385. evaluated after all data records have been retrieved.
  9386.  
  9387.    Displaying When a Sort Field Changes
  9388.  
  9389.      You may want to display the values of certain fields when a sort
  9390. field changes. Recall that a sort field is a data field associated with
  9391. a query line which has a sort order of 1, 2, or 3. The on change
  9392. attribute is used to mark off groups of data displayed in your report
  9393. and is especially useful for fields containing @D database functions.
  9394.  
  9395.      The groups of data are determined by the sort field that you
  9396. choose. For example, if you sort by name, then you will have a new group
  9397. for each name. Likewise, if you sort by date, then there will be a new
  9398. group whenever the date changes.  When the cursor is over the on change
  9399. attribute, you may press (ALT+Z) to zoom a pop-list of possible database
  9400. fields. You will see the name of each field and its type. You may choose
  9401. any of these fields. If this particular database field is not used as a
  9402. sort field when you do a query, the on change attribute will be ignored
  9403. and the field will not be displayed when the report is generated.
  9404.  
  9405.      As Surefire generates your report, each time that the value of the
  9406. chosen sort field changes, the field with the on change attribute will
  9407. be displayed, between the record with the old value and the first record
  9408. with the new value.
  9409.  
  9410.      Note:  When you start a search without using the Query window, you
  9411. can specify this attribute for the field where you start the search.
  9412. Also, fields with this attribute must be located below all repeated
  9413. fields.
  9414.  
  9415.  
  9416.  
  9417.  
  9418.  
  9419.  
  9420.  
  9421.  
  9422.             Surefire User's Guide         Page 146
  9423.  
  9424.  
  9425.    Turning off Report Formatting
  9426.  
  9427.      Sometimes you may want to use a document that has report attributes
  9428. to retrieve records one at a time. If this is the case, you may
  9429. temporarily turn off report formatting by using an option in the Search
  9430. Options window. To set this option, follow these steps:
  9431.  
  9432.      1.  Display the Search Options window.
  9433.      Press (ALT+D) to open the Data menu. Choose Search Options... to
  9434.      open the Search Options window.
  9435.  
  9436.      2.  Turn off report formatting.
  9437.      Answer 'N' to the question "Do Report Formatting?". Choose OK to
  9438.      set the change. Choosing OK will tell Surefire that you want the
  9439.      current document to behave as a document without report formatting.
  9440.  
  9441.      3. Display your records.
  9442.      If you press (F8) you will see data records displayed as if there
  9443.      weren't any report attributes. The next time you read the document
  9444.      into Surefire, the report formatting will be turned back on.
  9445.  
  9446.  
  9447. Generating a Report
  9448.  
  9449.      Once a document has report attributes, you generate the report
  9450. simply by choosing "Search" from the Data menu or pressing (ALT+S) to
  9451. start a search.  You can have a query in the Query window or base the
  9452. search directly on a field. The records that satisfy the query
  9453. conditions will make up the report.
  9454.  
  9455.      As long as there is enough room in memory to handle the expanded
  9456. document, you can view the results of your report as soon as all records
  9457. are retrieved. Since Surefire generates a report directly into a
  9458. document, it is recommended that you save your document once you have
  9459. defined all report attributes and before you begin generating the
  9460. report.
  9461.  
  9462.      Note:  Even before the report is generated you cannot use (F8) and
  9463. (F7) to sequentially view records when report attributes are specified
  9464. (and used) for any field.
  9465.  
  9466.      After all records have been retrieved and the report has been
  9467. generated, your cursor will be repositioned at the place where you
  9468. started the search. This will typically be at the beginning of the
  9469. document. You may press the (PageUp) and (PageDown) keys to view your
  9470. report on the screen.
  9471.  
  9472.      You may stop the report while it is being generated by pressing an
  9473. 'S' at any time. After it is stopped, you may view, edit, and print just
  9474. as if the report generation had gone to completion. Sometimes you may
  9475. set up a query intended to generate a long printed report. Before
  9476. printing it, you may generate a few pages, then stop it and look at it
  9477. to make sure it is really what you want. Then, after you are sure, do
  9478. the Search & Print to generate the full report directly onto paper.
  9479.  
  9480.  
  9481.  
  9482.  
  9483.  
  9484.  
  9485.  
  9486.  
  9487.             Surefire User's Guide         Page 147
  9488.  
  9489.  
  9490.      Note:   If the number of retrieved records is very large, there
  9491. may not be sufficient memory to view the entire report. You will be able
  9492. to see as much of the report as possible. If memory is exhausted, a
  9493. message window will be displayed. You must use Search & Print to print
  9494. the entire report.
  9495.  
  9496.      After a report is generated, all fields with report attributes are
  9497. temporarily deleted from the document by Surefire. This happens because
  9498. the purpose of these fields is solely to indicate to Surefire how to
  9499. present the information in the report. Once the report is generated,
  9500. these fields would just get in the way.
  9501.  
  9502.      The other fields that do not have report attributes remain intact
  9503. for your use. If you had generated the report in the middle of some
  9504. larger document, these other fields may still be used to search the
  9505. database or perform calculations before you print the report. Button
  9506. fields are very handy to have around. You can use buttons to re-generate
  9507. the report based on specific named queries. In fact, buttons in report
  9508. documents can be an essential part of a Smart document application.
  9509.  
  9510.  
  9511. Resetting a Report
  9512.  
  9513.      Generally you want to re-get your document each time after you run
  9514. a report. This is because the generation of a report automatically edits
  9515. your document by inserting lines and moving text and fields.  You can
  9516. then further edit your report manually if you wish.  But, when you want
  9517. to generate your report another time, usually with a slightly different
  9518. query, you must start with the original document.
  9519.  
  9520.      When you get a document using the Get File window, Surefire does
  9521. not remember information about the query or search you have just
  9522. performed. By choosing "Reset" from the File menu instead, you can tell
  9523. Surefire to get the document again but leave the current query
  9524. information intact.
  9525.  
  9526.      The is handy especially when you are testing the look of a report
  9527. generated from a complex query. You can keep making minor changes to the
  9528. query each time, and generate the report again and again until you are
  9529. satisfied. This certainly overcomes the inconvenience of getting the
  9530. report document and redefining a query each time you generate a report.
  9531.  
  9532.  
  9533. Printing a Report
  9534.  
  9535.      There are two ways that a report may be printed. You can print a
  9536. report after having a chance to view and annotate it on the screen. Or,
  9537. you can tell Surefire to directly print the report as it is generated.
  9538. Both ways assume that you have already defined the appropriate report
  9539. attributes as described earlier in this chapter.
  9540.  
  9541.  
  9542.  
  9543.  
  9544.  
  9545.  
  9546.  
  9547.  
  9548.  
  9549.  
  9550.  
  9551.  
  9552.             Surefire User's Guide         Page 148
  9553.  
  9554.  
  9555.    Printing After Display
  9556.  
  9557.      Quite often you may want to generate a report, but then add text to
  9558. explain specific results, organize the text a little differently, or
  9559. delete portions of it that are really not of interest. In Surefire, all
  9560. you need to do is be in Text edit mode after the report  is generated.
  9561. You can manipulate the result all you want using Surefire's word
  9562. processing capabilities. Then, when you are ready, you can print the
  9563. document.
  9564.  
  9565.      To print the report once it is viewed on screen, and you are in
  9566. Text edit  mode, choose "Print..." from the File menu to open the Print
  9567. window. Then choose PRINT. This is exactly the way that any other
  9568. document is printed. If there are any button fields in your document,
  9569. the button labels will be removed in Text edit mode and will not be
  9570. printed.
  9571.  
  9572.    Printing the Report Directly
  9573.  
  9574.      You can generate a report in such a way that it is printed at the
  9575. same time. This is especially useful if your report is larger than
  9576. memory allows.  Before you do, be sure the report will be what you want,
  9577. since printing often takes a long time. First, generate a few pages
  9578. without printing and then stop it by typing an 'S'. When everything
  9579. looks good, you're ready to go.
  9580.  
  9581.      To print the report directly while it is being generated, you first
  9582. build your query in the Query window if you haven't already done so, or
  9583. get a named query. Then choose "Print..." from the File menu. Choose
  9584. SEARCH & PRINT. Surefire will qualify matching records according to the
  9585. query conditions, generate the report and print the entire document. Of
  9586. course, you have the option of stopping the print operation at any time.
  9587.  
  9588.  
  9589. Saving a Report
  9590.  
  9591.      The generation of a report automatically edits your document by
  9592. inserting lines and moving text and fields. It also deletes those fields
  9593. that have report attributes. Once a report is generated, the document
  9594. can not directly be used to generate another report. Only the original
  9595. document can be used again and again to generate different reports.
  9596. Therefore, when you are ready to save your report, Surefire insists that
  9597. you save only the textual form of your document as a Report  or as a
  9598. Text File.  Neither of these will retain field information.
  9599.  
  9600.      Saving as a Report will preserve the margins and special characters
  9601. of a document. This is the option you will normally use. Saving as a
  9602. Text File or General WP will save only the text of your report in ASCII
  9603. format. This may be just what you want if you are going to send the
  9604. report over a modem to someone who has a different word processor, for
  9605. example.
  9606.  
  9607.      You use the Save File window from the File menu and enter the name
  9608. by which you want your finished report to be saved. Set the file type
  9609.  
  9610.  
  9611.  
  9612.  
  9613.  
  9614.  
  9615.  
  9616.  
  9617.             Surefire User's Guide         Page 149
  9618.  
  9619.  
  9620. multiple choice button to Report to specifically save the report without
  9621. overwriting the original document. Then, give the report a name that is
  9622. different than the name of the original document.
  9623.  
  9624.  
  9625. Using Statistical Database Functions
  9626.  
  9627.      You can use the functions shown below in field commands to perform
  9628. statistical calculations on field values that span more than one
  9629. database record:
  9630.  
  9631.           Use function   To
  9632.  
  9633.           @DSUM          Find the sum of values for a field.
  9634.           @DAVG          Find the average of values for a field.
  9635.           @DCOUNT        Find the number of records retrieved so far
  9636.                          (for a group).
  9637.           @DMIN          Find the minimum value of a field.
  9638.           @DMAX          Find the maximum value of a field.
  9639.           @DTOTAL        Find the total number of records for the
  9640.                          current query.
  9641.  
  9642.      These functions are often used in combination with fields that have
  9643. an on change attribute to display statistical information based on
  9644. groups of your report data. For example, you may want the total number
  9645. of recipes that use apples, the average salary of employees in each
  9646. department of a company, or the oldest and youngest people in your
  9647. database.  These functions are described in "Appendix A: Surefire
  9648. Function Reference".
  9649.  
  9650.  
  9651. Generating Reports at the Push of a Button
  9652.  
  9653.      With a button field and the @RESET function, you can perform the
  9654. same operation as choosing "Reset" from the File menu. This operation
  9655. allows you to re-get the current document after a report has been
  9656. generated in such a way that current query information is not cleared.
  9657. This way you can generate a report, reset the document, and then just
  9658. change a query condition before regenerating the report. However, by
  9659. itself, it may not be worth having a button field in your report just to
  9660. support a menu shortcut.
  9661.  
  9662.      A real handy extension to this idea is to have one or more buttons
  9663. set up at the top of your report to generate varieties of the same
  9664. report. This can be done by using field commands with the @QUERY()
  9665. function. The @QUERY() function will do a reset operation automatically
  9666. if a report was generated. It will then start a database search based on
  9667. the named query specified by its argument.  For example, in our
  9668. "conrept" document, you can have one button generate a report for the
  9669. tri-state area of N.Y., N.J., and Connecticut. Another button can
  9670. generate the report for the entire U.S., alphabetically by state. And so
  9671. on.
  9672.  
  9673.  
  9674.  
  9675.  
  9676.  
  9677.  
  9678.  
  9679.  
  9680.  
  9681.  
  9682.             Surefire User's Guide         Page 150
  9683.  
  9684.  
  9685. Chapter 23     -    More About Printing
  9686.  
  9687.      When you have finished editing a document, or you have just
  9688. generated a report, you usually want to print it so that you can have a
  9689. paper copy.  Paper copies are needed for mailing and may also be part of
  9690. your record keeping procedures.
  9691.  
  9692.      By now you are quite familiar with printing a document in Surefire.
  9693. The features of the Print window were introduced quickly in the word
  9694. processing chapters.  This chapter reviews some information you already
  9695. know, as well as printing options not thoroughly discussed earlier. In
  9696. addition, this chapter explains available fonts and printer drivers and
  9697. how to configure Surefire with a particular printer.
  9698.  
  9699.  
  9700. The Print Window
  9701.  
  9702.      You use the Print window to print Surefire documents and reports.
  9703. The settings allow you to select which pages of your document to print,
  9704. how to number those pages and whether your printer is set up for manual
  9705. sheet feeding. The following sections describe each of these settings
  9706. and the two action buttons that may be used to print your documents and
  9707. reports.
  9708.  
  9709.    Pages to Print
  9710.  
  9711.      You can specify which pages of a document are to be printed. You do
  9712. this by changing values in two entry fields of the Print window to the
  9713. right of the label "Print from Page:". The default is "1 To: END" which
  9714. means print the entire document.
  9715.  
  9716.      If you change these values, only certain pages of a document will
  9717. be printed. The number in the first field must have a lower value than
  9718. the number in the second field. For example, "2 to 7" says print the
  9719. second through the seventh pages of the current document. Page selection
  9720. is useful, if you want to revise part of a document or to substitute a
  9721. corrected page into a printed document.
  9722.  
  9723.    Page Numbering
  9724.  
  9725.      You may also select the starting page number for the first page
  9726. that is printed. This will be the number printed in the header or footer
  9727. for the first page if you have enabled page numbering. Read "Chapter 9:
  9728. Page Layout"  for details about page numbering in headers and footers.
  9729.  
  9730.      For example, say the current document has 10 pages which are
  9731. numbered 1 through 10. But this document really represents chapter 2 of
  9732. a longer project, and the last page of chapter 1 is 14.  You still want
  9733. to print this entire document, but the starting page number should be
  9734. 15.  To set this, change the value in the field to the right of "Start
  9735. Numbering:".  The default value is "1".  So, you would type "15" in
  9736. place of the "1".
  9737.  
  9738.  
  9739.  
  9740.  
  9741.  
  9742.  
  9743.  
  9744.  
  9745.  
  9746.  
  9747.             Surefire User's Guide         Page 151
  9748.  
  9749.  
  9750.      If you choose PRINT now, the 10 pages of the document will be
  9751. printed with the page numbers 15, 16, ... 24. As in our example, this
  9752. feature is useful for printing chaptered text where each document
  9753. represents a chapter but the page numbers must be continuous as if there
  9754. were really a single larger document.
  9755.  
  9756.    Number of Copies
  9757.  
  9758.      You can select the number of copies of the current document that
  9759. you want printed at one time.  This means that after one copy of your
  9760. document is sent to the printer, Surefire will send additional copies
  9761. without you having to choose PRINT more than once. You will not be able
  9762. to resume other operations in Surefire until all copies have been sent.
  9763.  
  9764.      To set the number of copies, change the value in the field
  9765. following the label "How Many Copies:".  The default is 1.
  9766.  
  9767.      Note:   Do not confuse this with instances of a document that are
  9768. formed during a merge. If you set this to be greater than 1 you will
  9769. have more than one copy of each instance of a document. See the
  9770. explanation of SEARCH & PRINT below.
  9771.  
  9772.    Pause Before Printing
  9773.  
  9774.      Some printers do not have automatic sheet feeders. If yours does
  9775. not, you still may want to print onto a single sheet of paper, with a
  9776. company letterhead, for example. You can tell Surefire that this is your
  9777. intention if you say "Yes" to the Print window question "Pause before
  9778. each page?". You must do this prior to choosing OK in the Print window.
  9779. This will cause printing to automatically stop before each page is
  9780. printed so that you can load a sheet of paper.
  9781.  
  9782.      If you are going to be using paper that is not on a continuous feed
  9783. (i.e. tractor feed), you should also read the section later in this
  9784. chapter entitled "Tractor Feed vs Sheet Feed". This section covers
  9785. additional considerations for setting number of lines per page, margin
  9786. adjustments, etc.
  9787.  
  9788.    PRINT and SEARCH & PRINT
  9789.  
  9790.      These action buttons will start a print operation of the currently
  9791. displayed document. PRINT allows you to print the current document with
  9792. any data that is currently displayed in fields of the document.  PRINT
  9793. will be your selection unless you are merging data or generating a
  9794. report. Normally, the cursor is positioned on this button when the Print
  9795. window is displayed.
  9796.  
  9797.      SEARCH & PRINT will merge data from a database according to the
  9798. currently defined query into the fields of your document. This will
  9799. usually result in the printing of multiple instances of your document
  9800. with different sets of data. You may read "Chapter 19: Forms and Form
  9801. Letters" and "Chapter 22: Generating Reports"  for specific instructions
  9802. on using this feature.
  9803.  
  9804.  
  9805.  
  9806.  
  9807.  
  9808.  
  9809.  
  9810.  
  9811.  
  9812.             Surefire User's Guide         Page 152
  9813.  
  9814.  
  9815. Printing the Current Document
  9816.  
  9817.      If a report, text file or document is not currently displayed in
  9818. Surefire, you must first read it into Surefire to be printed. If you are
  9819. not familiar with the steps for reading a document, read the section
  9820. "Opening a Document" in Chapter 5. You use the Print window, setting
  9821. options as appropriate and choose PRINT to print your document to the
  9822. current printer.  You may also use the print file shortcut (ALT+F6) to
  9823. print the currently displayed document without opening the Print window
  9824. and without changing any default print window options.
  9825.  
  9826.      PRINT will print your document, just as you see it. This varies
  9827. depending on whether you are using the document (use mode), editing the
  9828. document (Document edit mode) or editing text (Text edit mode). The
  9829. difference is solely based on how the fields are represented.  In use
  9830. mode, the fields contain their current values and all the fields are
  9831. printed with underlines. No autosizing of fields will take place. In
  9832. Text edit mode, all field values are in textual form and any autosizing
  9833. will have been done. The fields will not be underlined. And finally, in
  9834. Document edit mode, all fields are underlined and filled with a
  9835. character indicating their type. No autosizing will take place and no
  9836. values will be printed.
  9837.  
  9838.      SEARCH & PRINT will always switch to Text edit mode just before
  9839. printing is done. Therefore, field values are autosized and printed
  9840. without underlines.
  9841.  
  9842. Stopping and Starting the Printer
  9843.  
  9844.      When printing begins, a window is displayed with the following
  9845. message:  "Printing in Progress - Type S to stop". This window will go
  9846. away after the document is printed. If printing cannot be started, a
  9847. message will say so. If this happens, you need to be sure that the
  9848. printer is turned on and is hooked up properly.
  9849.  
  9850.      If you type "S", the information being sent to the printer is
  9851. temporarily suspended.  The printer may continue for a while to complete
  9852. what was already sent to it.  The following message is then displayed:
  9853. "You have stopped printing.  Abort?" At this time you can prevent
  9854. anything more from being sent to the printer by choosing YES.  If your
  9855. printer keeps printing, you can stop it by resetting it or turning it
  9856. off. Choosing NO will allow printing to continue from exactly where it
  9857. stopped.
  9858.  
  9859. Printers and Printer Drivers
  9860.  
  9861.      Surefire comes with several printer drivers. Before you print any
  9862. Surefire document, you must select the appropriate driver for your
  9863. printer. As long as you do not switch printers, you do not need to
  9864. select your driver after you initially install and setup Surefire. An
  9865. option on the Setup window may be used to select your printer. You can
  9866. display the Setup window from the File menu.
  9867.  
  9868.  
  9869.  
  9870.  
  9871.  
  9872.  
  9873.  
  9874.  
  9875.  
  9876.  
  9877.             Surefire User's Guide         Page 153
  9878.  
  9879.  
  9880.      Here is a table of the available drivers and the printers with
  9881. which they work. The available fonts with the character widths in cpi
  9882. (characters per inch) are also shown. The fonts corresponding to the
  9883. current printer driver are seen in the Format window. This window is
  9884. accessed from the Page menu.
  9885.  
  9886. Driver         Printers                 Fonts/cpi
  9887.  
  9888. PLAIN          (dumb)                   default/10
  9889.  
  9890. ANSII          ANSII Standard           Pica/10, Elite/12
  9891.  
  9892. DIABLO         Diablo 630               Pica/10, Elite/12,
  9893.                                         Condensed/12, Brother HR Series
  9894.  
  9895. RICOH408       Ricoh LP4080R            Courier/10, Prestige Elite/12,
  9896.                                         Letter Gothic/15
  9897.  
  9898. IBMPRO         IBM Proprinter Series    Pica/10, NLQ/10, Elite/12,
  9899.                                         NLQ/12, Condensed/17.1
  9900.  
  9901. IBMGRAPH       IBM Graphics Printer     Pica/10, NLQ/10,
  9902.                AT&T 473/478             Elite/12, NLQ/12,
  9903.                Okidata 92/192, 93/193   Condensed/17.1
  9904.  
  9905. EPSONRX        Epson RX Series          Pica/10, Pica Dbl+Emp/10,
  9906.                Epson MX Series          Elite, Elite Dbl+Emp/12,
  9907.                                         Compressed/17.16
  9908.  
  9909. EPSONFX        Epson FX Series          Pica/10, NLQ/10,
  9910.                Epson LX Series          Condensed/17, Wide/5
  9911.  
  9912. EPSONLQ        Epson LQ Series          Pica/10, Elite/12,
  9913.                Epson SQ2500             Condensed/17, Cond. Elite/20
  9914.  
  9915. HPLASER        HP LaserJet Family       10 Pitch/10, 12 Pitch/12,
  9916.                Apricot Laser            16.66 Pitch/16.66
  9917.                Epson GQ3500
  9918.                Kyocera F-1010 Laser
  9919.                Nec Silentwriter Series
  9920.                Okidata Laserline 6
  9921.                Olivetti PG 208 M2
  9922.                Quadram QuadLaser 1
  9923.                Tandy LP-1000
  9924.                Tegra Genisis
  9925.                Wang LDP 8
  9926.  
  9927.  
  9928.      Even if your printer is not shown in the table, your printer will
  9929. likely still work with one of the above drivers. You need to know if
  9930. your printer emulates another printer as many do. For example, it is
  9931. very common for daisy wheel printers to emulate Diablo printers, dot
  9932. matrix printers to emulate Epson printers, and laser printers to emulate
  9933. HP LaserJet printers.
  9934.  
  9935.  
  9936.  
  9937.  
  9938.  
  9939.  
  9940.  
  9941.  
  9942.             Surefire User's Guide         Page 154
  9943.  
  9944.  
  9945.      If your printer does emulate another printer, then you should set
  9946. the printer to use the emulation and select the printer driver in
  9947. Surefire that corresponds to the emulated printer. If necessary, read
  9948. your printer manual on supported emulation modes and how to set them.
  9949.  
  9950.      All the printer drivers listed in the table support underline and
  9951. bold attributes. The only exception is PLAIN. The PLAIN driver supports
  9952. the least intelligent printers. It neither supports attributes nor
  9953. multiple fonts. If your printer does not support the IBM extended
  9954. character set, you will not be able to print lines or special
  9955. characters. Some printers particularly laser printers, will need to have
  9956. this character set loaded. Consult you printer manual for more
  9957. information on supported attributes and character sets.
  9958.  
  9959. What Actually Gets Printed
  9960.  
  9961.      Printers with tractor feed allow you to print the full length of
  9962. the page. That is, all 66 lines on an 8-1/2 by 11 sheet can have text.
  9963. In this case, formatting your page with Surefire is very
  9964. straight-forward. Use the Format window to set the page size to 8-1/2 by
  9965. 11 inch pages as was explained already in "Chapter 9: Page Layout". You
  9966. can specify your margins and font without worrying about any other
  9967. considerations.
  9968.  
  9969.      Sometimes, you may want to feed 8-1/2 by 11 inch sheets of paper
  9970. into you printer individually or with an automatic sheet feeder. This is
  9971. often done to print letters on a company letterhead or to use other
  9972. paper that may not be available for tractor feed. The problem is, most
  9973. printers can't print the full 66 lines on a sheet-fed page. This is
  9974. because the paper must be fed past the print head and held in place by
  9975. the rollers in order to start printing. This is very similar to a
  9976. typewriter.  As a result, somewhat fewer than 66 lines are really
  9977. available.
  9978.  
  9979.      To compensate for the inability of a printer to printer all 66
  9980. lines of a page, the format of your document must be adjusted. You can
  9981. do this by following these steps:
  9982.  
  9983. Step 1: How may lines?
  9984.  
  9985.      Determine how many lines can be printed on a sheet. Most often this
  9986. information can be found in your printer manual. It may tell you how
  9987. much space is skipped at the top and bottom of the page. Subtracting
  9988. these amounts from 11 inches will give you the printable length of the
  9989. page.
  9990.  
  9991.      Sometimes it may not be clear from the printer manual, or you don't
  9992. have the manual. You can determine exactly how many lines can be
  9993. printed, and exactly how much space is left at the top and bottom as
  9994. follows:
  9995.  
  9996.      1. Open a new document.
  9997.      Choose New from the File menu to start a new document.
  9998.  
  9999.  
  10000.  
  10001.  
  10002.  
  10003.  
  10004.  
  10005.  
  10006.  
  10007.             Surefire User's Guide         Page 155
  10008.  
  10009.  
  10010.      2. Set the page length.
  10011.      Choose Format... from the Page window to display the Format window.
  10012.      Set the page length in the Format window to 8-1/2 by 11 and set the
  10013.      top and bottom margins to 0.
  10014.  
  10015.      3. Number the lines
  10016.      Number the lines of your page from 1 to 66.
  10017.  
  10018.      4. Print a test page.
  10019.      Choose PRINT from the Print window to print a test page, using
  10020.      sheet feeding on your printer.
  10021.  
  10022.      The number of lines printed on the page will be what your printer
  10023. can physically print. Dividing this number by 6 will give you the length
  10024. of the print region in inches. You can measure the amount of space
  10025. skipped at the top and bottom with a ruler.  Now you know everything you
  10026. need to know to format your document so that it comes out as you expect.
  10027. Write down the size of the actual print region, and the space skipped at
  10028. the top and bottom of the page for future reference.
  10029.  
  10030. Step 2:  Set the page length.
  10031.  
  10032.      In the Format window, set the page length to correspond to the
  10033. number of lines that can be physically printed on a page. To do this,
  10034. choose "Specific Setting:" for the value of the page size multiple
  10035. choice button in the Format window. You will notice that two additional
  10036. entry fields are now visible just to the right. Move the cursor to the
  10037. "Length:" field and type in the length you determined in Step 1 above.
  10038.  
  10039. Step 3: Adjust the margins.
  10040.  
  10041.      Using the data entry fields in the Format window, adjust the top
  10042. and/or bottom margins smaller to account for the extra space that is on
  10043. a page. To do this, first subtract the amount you measured at the top of
  10044. the page from the current top margin. Then, subtract the amount of space
  10045. from the bottom of the page from the current bottom margin.
  10046.  
  10047. Step 4: Reformat the document.
  10048.  
  10049.      Now choose OK in the Format window to reformat your document.  You
  10050. will immediately notice that the document may now take up more pages
  10051. than before since less text can fit on each page. You can now review
  10052. your document. Each page will correspond to the page as it will be
  10053. printed, except a little extra space will be at the top and bottom of
  10054. the page. Save your document to retain the new formatting if you desire.
  10055.  
  10056. Step 5: Print the document.
  10057.  
  10058.      Now you can load your first sheet of paper, align it horizontally
  10059. and print. If you are feeding paper manually, just load the next page
  10060. after the previous one is ejected, making sure your printer is on-line.
  10061. See your printer manual for more information about how your particular
  10062. printer behaves.
  10063.  
  10064.  
  10065.  
  10066.  
  10067.  
  10068.  
  10069.  
  10070.  
  10071.  
  10072.             Surefire User's Guide         Page 156
  10073.  
  10074.  
  10075. Chapter 24     -    More About Surefire Documents
  10076.  
  10077.      As you know, the basic entity of Surefire is the document.
  10078. Documents may contain text, text and fields, and may be associated with
  10079. a database. Fields of a document may contain field commands that make
  10080. documents smarter and quite powerful. Documents may be used for data
  10081. entry and reporting and may even evolve into complete applications by
  10082. "linking" Smart Documents together.
  10083.  
  10084.      Depending upon their complexity, documents actually consist of one
  10085. or more DOS files which are managed by Surefire as a group.  As you
  10086. edit, use and maintain a document, Surefire assures that all associated
  10087. files are changed accordingly.  This chapter will serve as a place to
  10088. review much of what you have learned about documents. You will also
  10089. learn more about how other associated files are managed by Surefire.
  10090.  
  10091.  
  10092. The Modes of Editing and Using Documents
  10093.  
  10094.      If your document contains only text, you may only edit this text.
  10095. That is, you may only perform normal word processing operations such as
  10096. text insertion, deletion, find, replace, etc. In Surefire this is known
  10097. as Text edit  mode. There are also times when you have a document with
  10098. fields but you want to edit the document along with the field values as
  10099. text. To do this, you choose "Text" on the Operate menu. The Operate
  10100. menu always shows the current mode of editing or use by preceding that
  10101. choice with an 'X'. When you are only editing the text of a document,
  10102. the Operate menu looks like the picture at the left.
  10103.  
  10104.      In the chapter "Introduction to Fields", you learned about using
  10105. fields in a document. Documents which contain fields may be edited as
  10106. text in Text edit, mode or as a document in Document edit mode. In the
  10107. latter case, Surefire maintains information about the placement of
  10108. fields. When Surefire is in Document edit mode, you can manipulate
  10109. fields as well as perform all the normal word processing operations that
  10110. are available in Text edit mode.
  10111.  
  10112.      A document with fields may Used.  This concept of using a document
  10113. was covered in greater detail throughout this manual. Using a document
  10114. is what really distinguishes a Smart document from an ordinary document.
  10115. When you use a document, you enter, view and manipulate the values in
  10116. fields instead of the layout or text of the document. While using a
  10117. document, you may only change field values. The Operate menu reflects
  10118. this mode as well.
  10119.  
  10120.  
  10121. Getting Documents
  10122.  
  10123.      When you get a document, Surefire will display the first page of
  10124. the document with the margins that were set the last time you displayed
  10125. it. Surefire will also read in files that define fields or data
  10126. associated with the document.
  10127.  
  10128.  
  10129.  
  10130.  
  10131.  
  10132.  
  10133.  
  10134.  
  10135.  
  10136.  
  10137.             Surefire User's Guide         Page 157
  10138.  
  10139.  
  10140.      You may get a document by specifying the name of the document along
  10141. with the Surefire command at the DOS prompt:
  10142.  
  10143.      > SUREFIRE  MYDOC
  10144.  
  10145.      You may also type the name of the document in the Get File window
  10146. (from the File menu).  This window shows the current directory. This is
  10147. the directory where Surefire will look for a document.  This is the DOS
  10148. directory that was set during Surefire installation or most recently
  10149. specified in the Setup window.  If a document has more than one
  10150. associated file, all these files must be in the current directory.
  10151.  
  10152.      The Get File window has a multiple choice button that allows you to
  10153. get a document, get a text file, or to import a data file. Just to the
  10154. right of the label "Name:", is the field you use to enter the name of
  10155. your document or file. If the multiple choice is set to Document, no
  10156. file extension (such as .DOC) is needed and formatting and margin
  10157. information will be preserved. See "Chapter 25: Surefire System Topics"
  10158. for a complete description of all Surefire file extensions.
  10159.  
  10160.      The multiple choice button on the Get File window also has choices
  10161. for Text File and Data File.  The Text File choice allows you to read in
  10162. a file created by another word processor or text editor. The Data choice
  10163. allows data from another program to be imported into the current
  10164. document's database. The import process is described in "Chapter 19:
  10165. Advanced Database Topics".
  10166.  
  10167.      If the multiple choice button is set to Text File, Surefire will
  10168. search for the named file and assume it is an ASCII file with no special
  10169. formatting information. If the name has no period '.' or other
  10170. extension, Surefire assumes the extension ".TXT". For this type of file,
  10171. the margins will be set to the current margins at the time of the Get.
  10172.  
  10173.      By pressing the Zoom key (ALT+Z) when the cursor is on the file
  10174. name entry field, a pop-list of all documents, text or data files will
  10175. appear. Text files with the extension ".TXT" will be shown when the
  10176. chosen file type is Text File. Likewise, ASCII data files with the
  10177. extension ".DTA" will be shown when the file type is Data File.
  10178. Otherwise, documents will be listed. As with all pop-lists in Surefire,
  10179. you may press the (down arrow) key to move the cursor to the document or
  10180. file that you want and press (Enter) to choose it.  If you do not wish
  10181. to make a choice, you simply press (Esc).
  10182.  
  10183.      The pop-list showing documents has additional important information
  10184. about each particular document. The date and time that the document was
  10185. last saved is always displayed.  But, there is additional information
  10186. for documents containing fields and databases. The 'Y' in the first
  10187. column indicates that the document has fields. A 'Y' in the second
  10188. column tells you that the document is a base document that defines a
  10189. database. A 'P' in the second column indicates that the document has
  10190. fields projected from another database. The number of documents that
  10191. project data from a base document are shown in the third column.
  10192.  
  10193.  
  10194.  
  10195.  
  10196.  
  10197.  
  10198.  
  10199.  
  10200.  
  10201.  
  10202.             Surefire User's Guide         Page 158
  10203.  
  10204.  
  10205. Saving Documents
  10206.  
  10207.      In the Save File window there are 5 possible file types from which
  10208. you may choose. They are Document, Report, Text File, General WP and
  10209. Data.  Whatever file type you choose, Surefire will save that file or
  10210. document in the current directory.
  10211.  
  10212.      If you choose Document, Surefire will save the current document and
  10213. any files associated with it. It will remember graphic attributes and
  10214. header, footer and margin information as well. If Text File or General
  10215. WP is your choice, only a textual version of the document will be saved
  10216. as ASCII text. No graphic attributes (see "Chapter 8: Adding Emphasis")
  10217. or formatting information such as margins will be saved.  Special
  10218. characters will be saved but may not be kept intact by other programs.
  10219.  
  10220.      In a Text File, each line of the Surefire document will be
  10221. terminated with a newline character (CR-LF). This format is recognized
  10222. by various text editors as well as DOS commands such as type.
  10223.  
  10224.      General WP is similar to Text File, however, there will not be a
  10225. newline character after each line. Surefire will terminate every
  10226. paragraph with a single newline character so that a paragraph will
  10227. become a very long line. This format is recognized by many word
  10228. processors and will ensure that words in a paragraph are properly
  10229. wrapped when imported. In addition, Surefire will replace leading spaces
  10230. on each line by (Tab) characters. This will be based on the current tab
  10231. size you have set in the Setup window.
  10232.  
  10233.      You may choose to save a document as a Report when you want to keep
  10234. the graphic attributes and formatting information but not any associated
  10235. field information. Surefire will look to see if there are already
  10236. documents with the same name that have fields or a database. If so, you
  10237. must choose a different name. Saving a document this way is useful when
  10238. you wish to annotate a document after you view data records, without
  10239. losing the correspondence between the document and its fields.
  10240.  
  10241.      Use Data File when you want to export data from a Surefire database
  10242. to another program. See "Chapter 21: Advanced Database Topics" for a
  10243. thorough description of importing and exporting data.
  10244.  
  10245.  
  10246. Copying Documents
  10247.  
  10248.      You can use the Get File and Save File window to copy files or
  10249. documents. Just Get the desired file or document and Save it directly
  10250. with a different name. If you are copying a document with fields, your
  10251. copy will have the same format and fields as the original.  The fields
  10252. of the copy will have the same attributes, names, sizes, layout and
  10253. field commands as in the original document.
  10254.  
  10255.      If the original document is a base document defining a database,
  10256. your copy will not include a copy of the database data. Its fields,
  10257. however, will be defined so that you can add or import data to create a
  10258. new database. This database will have the same structure as the database
  10259.  
  10260.  
  10261.  
  10262.  
  10263.  
  10264.  
  10265.  
  10266.  
  10267.             Surefire User's Guide         Page 159
  10268.  
  10269.  
  10270. of the original document. Since the format of the copy is the same, it
  10271. is a simple matter to copy the data from the original document's
  10272. database to the new database. All that you need to do is to export some
  10273. or all of the data from the original and import that data into the copy.
  10274.  
  10275. See "Chapter 21: Advanced Database Topics" for complete information on
  10276. importing and exporting data.
  10277.  
  10278.  
  10279. Renaming Documents
  10280.  
  10281.      If you want to rename a Surefire document, use the Rename File
  10282. window. The Rename File window has two data entry fields. Type the
  10283. current name of the file or document in the first field next to the
  10284. label "Old Name:". You may press (ALT+Z) to show the pop-list of files
  10285. in the Current Directory. Enter the desired new name in the second field
  10286. next to the label "New Name:".
  10287.  
  10288.      The rename within Surefire works differently than a DOS rename
  10289. command (ren). If the file type is Document, Surefire will rename all
  10290. associated files that define fields or a database, as well as the
  10291. document itself. In addition, Surefire will not allow you to rename a
  10292. file to a name that is already used.
  10293.  
  10294.      A message window will be displayed if you try to rename a base
  10295. document that has associated projected documents. At the time of the
  10296. warning, you may choose to CANCEL the rename. If you continue with the
  10297. rename in this case, you will need to modify each of the projected
  10298. documents to reference the new name. (Use the Field Modify window from
  10299. the Field menu to do this).
  10300.  
  10301.  
  10302. Deleting Documents
  10303.  
  10304.      If you want to delete a Surefire document, use the Delete File
  10305. window. The Delete File window has a data entry field where you can type
  10306. the name of the file or document that you wish to delete. You may press
  10307. (ALT+Z) to show the pop-list of files in the current directory.
  10308.  
  10309.      Note:   The Delete operation within Surefire works differently than
  10310. a DOS delete command (del). If the file type is Document, Surefire will
  10311. delete all associated files such as those that define fields or a
  10312. database, as well as the document itself. No matter what the file type
  10313. is, a message window will be displayed to make sure that you really want
  10314. to continue with the delete operation.
  10315.  
  10316.      A special message window will be displayed if you try to delete a
  10317. base document that has associated projected documents. At the time of
  10318. the warning, you may choose to CANCEL the delete. If you continue with
  10319. the delete in this case, you will need to modify each of the projected
  10320. documents to remove all references to fields projected from the deleted
  10321. document. You can either delete all of the projected fields or use the
  10322. Field Modify window to remove all references to the deleted document.
  10323.  
  10324.  
  10325.  
  10326.  
  10327.  
  10328.  
  10329.  
  10330.  
  10331.  
  10332.             Surefire User's Guide         Page 160
  10333.  
  10334.  
  10335. Creating New Documents
  10336.  
  10337.      Surefire is immediately ready for the creation of a document if you
  10338. start it from the DOS prompt without any document name. You will see the
  10339. representation of a standard 8-1/2 by 11 inch page with margins.
  10340.  
  10341.      > SUREFIRE
  10342.  
  10343.      If Surefire is already running, choose "New" from the File menu to
  10344. clear the current document from the screen but keep the current page
  10345. formatting and margins. Before this occurs, you will be warned to save
  10346. the current document, if you haven't already done so.
  10347.  
  10348.      In either case, you are now ready to edit the new, as-yet-unnamed,
  10349. document. That is, you may immediately enter text, graphics, do text
  10350. operations, create fields, etc. Later, you can save the new document and
  10351. give it a name. The chapters on word processing (4 through 9) walk you
  10352. through all of the steps of creating and editing your document.
  10353.  
  10354.  
  10355. Protecting Documents
  10356.  
  10357.      Surefire protects your documents and data in a variety of ways. The
  10358. lack of highlighting for inactive menu items keeps you from selecting
  10359. inappropriate actions. When menu items are inactive, they cannot be
  10360. selected. For example, the "Use Document" choice on the Operate menu is
  10361. not available when there are no fields. Notice that the 'U' is not
  10362. highlighted.
  10363.  
  10364.      Whenever possible, Surefire warns you through message windows of
  10365. operations that may affect the integrity of a document.  Surefire will
  10366. warn you of any side effects before it continues with the action.
  10367. Throughout this manual are many instances of the actual message windows
  10368. that are displayed in these cases.
  10369.  
  10370.      Note:   You are also encouraged to routinely make backups of your
  10371. documents to prevent loss in case of hardware failure or inadvertent
  10372. editing operations. See the next chapter for information regarding
  10373. backup procedures.
  10374.  
  10375.  
  10376. Specifying Document Help
  10377.  
  10378.      If you are going to be creating smart document applications, you
  10379. might be interested in having document help available for your
  10380. application. Document help is context  help that can be specified for
  10381. your own documents. You have already seen how Surefire system help is
  10382. always available by pressing (F1). The help is different depending on
  10383. the part of Surefire being displayed at the time. In a similar way, a
  10384. context in your document changes when topics or areas of your document
  10385. or application change. You specify the appropriate changes in context
  10386. within your Smart Document application with the @HELP function.
  10387.  
  10388.  
  10389.  
  10390.  
  10391.  
  10392.  
  10393.  
  10394.  
  10395.  
  10396.  
  10397.             Surefire User's Guide         Page 161
  10398.  
  10399.  
  10400.      Once specified, document help may be displayed by using the
  10401. function key (F2). You use Surefire itself to write the text that will
  10402. be displayed in the help window. Each context of your help is on a
  10403. separate page of this help document. Generally, you use the @HELP
  10404. function in the field command for a button or immediate execution field
  10405. to specify each context change. As your user moves throughout your
  10406. document switching between pages or other documents, the help context
  10407. can change.
  10408.  
  10409.      There is one help file per document application. This means that
  10410. when you initially run Surefire with a document specified at the DOS
  10411. command prompt, or you explicitly read a document using the Get File
  10412. window, Surefire will set the current document's help file to the one
  10413. associated with this document, if there is one. The association comes
  10414. from the help file  having the same name as the document. For example,
  10415. if your document were named "accounts", the associated help file would
  10416. be "accounts.hlp".
  10417.  
  10418.      Note:   As long as you display other documents by pressing buttons
  10419. that execute @GODOC or @JOIN functions, or you return to a previous
  10420. document by pressing (Esc), this help file and any previous help
  10421. contexts will be preserved.  If you exit from Surefire, or explicitly
  10422. read a document using the Get File window or you choose New from the
  10423. File menu, Surefire will forget any help context information associated
  10424. with the previous document. Surefire will change the help file to be the
  10425. one associated with this new document, if any.
  10426.  
  10427.    Help File Format
  10428.  
  10429.      A help file is merely a Surefire document with a specific name and
  10430. format.  A template for help files is provided and is called
  10431. "document.hlp". This file is located in the Surefire installation
  10432. directory.  All help documents must follow the formatting rules shown
  10433. below.
  10434.  
  10435.      Rules for Surefire Help Files
  10436.  
  10437.      1) The file name must be the same name as the document but with a
  10438.      ".hlp" extension.
  10439.      2) There must be exactly 66 lines per page.
  10440.      3) There must be exactly 70 characters within the margins.
  10441.      4) There may be no header or footer.
  10442.      5) Both left and right margins should be .5 inches.
  10443.      6) The font must be 10 cpi.
  10444.      7) All pages must have STOP's.
  10445.  
  10446.      The first page of the help file will never appear in the Help
  10447. window.  This page is used for notes describing the particular help
  10448. file.  Usually, it is used to summarize the meaning of each context used
  10449. in this help file. You write the text for the help window in the help
  10450. file on the page corresponding to the context with which it is to be
  10451. associated. The context is a number that you specify by using the @HELP
  10452. function.
  10453.  
  10454.  
  10455.  
  10456.  
  10457.  
  10458.  
  10459.  
  10460.  
  10461.  
  10462.             Surefire User's Guide         Page 162
  10463.  
  10464.  
  10465.      You may not care about a context if you simply want to specify some
  10466. overall information about a document.  You can essentially ignore using
  10467. a context by writing whatever text you want on page 2 of the help file.
  10468. Whenever (F2) is pressed, the contents of this page will be shown in the
  10469. Help window.
  10470.  
  10471.    Specifying a Document Help Context
  10472.  
  10473.      The document help context is specified by using the function
  10474. "@HELP(context)"  where "context" is the number of the page in the
  10475. document help file to be displayed in the Document Help window when (F2)
  10476. is pressed.  For normal contexts, the context number must be 2 or
  10477. greater and is always initially set to 2.
  10478.  
  10479.      For example, if your document were "accounts" and one area was
  10480. payroll and another was ledger, you can have the help text for payroll
  10481. be at page 3 of the help file (@HELP(3)) and the help text for ledger be
  10482. at page 4 of the help file (@HELP(4)). The help file is "accounts.hlp"
  10483.  
  10484.      It is often the case that @HELP is used in conjunction with the
  10485. @GODOC function since displaying another document is a natural change in
  10486. context.  When the @HELP function specifies a new context after the
  10487. @GODOC in the same field command, it changes the context for the next
  10488. document. The previous context will be restored to what it was set to
  10489. just before the @GODOC, when you return back to that document by
  10490. pressing (Esc).
  10491.  
  10492.      Use @HELP(1) when you want to say that a part of your document
  10493. application will use a new help file. The name of this file is
  10494. constructed from the name of the current document. Use this method for
  10495. breaking up the help file of large Smart Document applications or
  10496. applications that may be run either independently or as part of another
  10497. application.
  10498.  
  10499.  
  10500.  
  10501.  
  10502.  
  10503.  
  10504.  
  10505.  
  10506.  
  10507.  
  10508.  
  10509.  
  10510.  
  10511.  
  10512.  
  10513.  
  10514.  
  10515.  
  10516.  
  10517.  
  10518.  
  10519.  
  10520.  
  10521.  
  10522.  
  10523.  
  10524.  
  10525.  
  10526.  
  10527.             Surefire User's Guide         Page 163
  10528.  
  10529.  
  10530. Chapter 25     -    Surefire System Topics
  10531.  
  10532.      Well, you have reached the end of the Surefire User's Guide. The
  10533. other chapters of this guide have covered all that you need to know in
  10534. your day to day usage of Surefire. This chapter covers information that
  10535. you will probably not refer to very often. These topics include the
  10536. backing up and recovery of your files, more about how Surefire files
  10537. appear to DOS and some limits you may encounter in using Surefire.
  10538.  
  10539. Backing Up Your Files
  10540.  
  10541.      There are two aspects to backing up files in Surefire. One protects
  10542. you from accidently deleting or saving files when you really didn't want
  10543. to. The other protects you from unexpected hardware or system errors
  10544. resulting in catastrophic effects to some or all of your files. You
  10545. should use the appropriate method at the proper times to protect your
  10546. investment in time when using your computer.
  10547.  
  10548.    Manual Backups
  10549.  
  10550.      You should always make backup copies of your important Surefire
  10551. documents and their associated files in case of a catastrophic machine
  10552. failure. Time and time again these types of failures happen when you
  10553. have been using your computer intensely for days at a time. You are
  10554. heavily involved in your work and backing up your files just takes too
  10555. much time. Don't fall into this trap!
  10556.  
  10557.      Make sure all of the files in your working directory are copied or
  10558. backed up to a floppy disk or tape unit periodically. Every once in a
  10559. while say to yourself "If my computer failed totally and I lost all my
  10560. data how much time will it take to do every thing over again?" If you
  10561. can't afford this scenario, do a backup! You can backup your files by
  10562. using the DOS command cd to get to your working directory and then using
  10563. copy or backup. Refer to your DOS manual for more information about
  10564. these commands.
  10565.  
  10566.    Automatic File Backup and Recovery
  10567.  
  10568.      If you have chosen the auto backup option from the Setup window,
  10569. documents modified during a Surefire session will be backed up, in the
  10570. current directory, automatically. See the section "System Setup" in
  10571. "Chapter 2: Getting Started" for details on setting this option.
  10572.  
  10573.      Whenever you save a document, Surefire will set aside the previous
  10574. version of that document if one exists.  Surefire makes copies of each
  10575. of the files associated with the document. With Auto Backup, if you
  10576. somehow save a document incorrectly, for example, by using the name of
  10577. an existing document and thus un-intentionally overwriting a document,
  10578. you can recover the "lost" document. This will also be handy if you
  10579. inadvertently delete a document.
  10580.  
  10581.      Note:   Whether or not you use this option, Surefire will always
  10582. backup a database when a base document is deleted and during a database
  10583. restructuring operation.
  10584.  
  10585.  
  10586.  
  10587.  
  10588.  
  10589.  
  10590.  
  10591.  
  10592.             Surefire User's Guide         Page 164
  10593.  
  10594.  
  10595.      Having files backed-up in this way means that you can recover the
  10596. previous version of your document. This previous version will have an
  10597. exclamation '!' character followed by the usual 2 characters of the file
  10598. extension. If you don't want the changes that you just saved to disk by
  10599. saving your document via the Save File window you can exit Surefire and
  10600. restore your original document. From DOS, you use the copy command to
  10601. restore the changed document to its previous version. You also use the
  10602. del command to remove all of the index files. Surefire will
  10603. automatically create new ones when needed.
  10604.  
  10605.      To recover a backed up document, such as CLIENT, enter the
  10606. following DOS commands at the DOS prompt:
  10607.  
  10608.      >COPY CLIENT.!OC  CLIENT.DOC
  10609.      >COPY CLIENT.!LD  CLIENT.FLD
  10610.      >COPY CLIENT.!BF  CLIENT.DBF
  10611.      >DEL CLIENT.ND*
  10612.  
  10613.      Note:   If you are short of disk space you may not have enough room
  10614. for the auto backed up copies. You can turn auto backup off and then
  10615. delete some of your backup files to free up disk space. If you do, we
  10616. recommend that you first do a manual backup (see the previous section).
  10617.  
  10618.  
  10619. Surefire Files
  10620.  
  10621.      Surefire documents are really composed of a group of files that
  10622. contain the various information needed to present the text, fields and
  10623. data of the documents. Other files support the available printers, data
  10624. import and export operations, on-line help and database indexing for
  10625. quick data access. You may see various files when you look at the DOS
  10626. directories where you use Surefire. The following table lists the types
  10627. of files you may see and what their three character DOS extensions are.
  10628. The asterisk (*) shows that the file name can be anything.
  10629.  
  10630.      File Type                     File Name or Extension
  10631.  
  10632.      Document file (text portion)  *.DOC
  10633.      Field file                    *.FLD
  10634.      Database file                 *.DBF
  10635.      Index file                    *.NDn
  10636.      ASCII text file               *.TXT
  10637.      Export/Import data file       *.DTA
  10638.      Printer definitions           *.PD
  10639.      Help files                    *.HLP
  10640.      Surefire Program              SUREFIRE.EXE
  10641.      Configuration File            SUREFIRE.CFG
  10642.  
  10643.  
  10644.  
  10645.  
  10646.  
  10647.  
  10648.  
  10649.  
  10650.  
  10651.  
  10652.  
  10653.  
  10654.  
  10655.  
  10656.  
  10657.             Surefire User's Guide         Page 165
  10658.  
  10659.  
  10660.    Document File Format - WordStar Compatible
  10661.  
  10662.      The file structure used for all document files, which are files
  10663. with the extension ".doc" are compatible with WordStar 5 and earlier
  10664. versions.  What this means is that Surefire .doc files can be read
  10665. directly into WordStar without any conversion. Likewise,WordStar
  10666. documents can be read directly into Surefire as a Document. Any
  10667. attributes or formatting that can be specified in WordStar that are not
  10668. available in Surefire will be ignored by Surefire.
  10669.  
  10670.      Surefire's specifications for formatting and attributes are very
  10671. straight-forward. WordStar was chosen because many other word processors
  10672. and editors can convert to and from WordStar format, and thus to and
  10673. from Surefire. Using this format, the simple formatting and attributes
  10674. supported by Surefire won't be lost when transferred to other systems.
  10675.  
  10676.    Database File Format - DBase III Compatible
  10677.  
  10678.      The file structure for all database files, ".dbf" and ".nd?", are
  10679. Dbase III compatible.  This means that these files can be directly
  10680. accessed by Dbase III or any other software that works with Dbase III
  10681. files, including Dbase IV.
  10682.  
  10683.      Surefire can also access Dbase files created by these other
  10684. programs, provided that document fields are defined to be consistent
  10685. with the database definitions. To use these .dbf files directly, the
  10686. document fields must be the same type, size and with cell names
  10687. specified to correspond to those in the database definition.  Databases
  10688. defined by Dbase III must have field names with at least three
  10689. characters. All characters of these field names must be alphabetic. We
  10690. recommend that any index files from Dbase III are not used, since
  10691. Surefire will automatically create them as needed.
  10692.  
  10693.    Locking Documents
  10694.  
  10695.      Sometimes you may have a set of Smart documents that you and
  10696. perhaps others will use on a regular basis to do your work. It is often
  10697. desirable to set up these documents so that they cannot be altered. You
  10698. can lock documents by using the DOS command attrib to set the document
  10699. files (eg. files with the extension .DOC) to be read-only.  This will
  10700. prevent Surefire from saving any files associated with the document.
  10701. See your DOS manual for more information about the attrib command.
  10702.  
  10703.  
  10704.  
  10705.  
  10706.  
  10707.  
  10708.  
  10709.  
  10710.  
  10711.  
  10712.  
  10713.  
  10714.  
  10715.  
  10716.  
  10717.  
  10718.  
  10719.  
  10720.  
  10721.  
  10722.             Surefire User's Guide         Page 166
  10723.  
  10724.  
  10725. System Constraints
  10726.  
  10727.      We all wish that there were no limits in the machines or programs
  10728. that we use.  We recognize, however, that nothing can work efficiently
  10729. if everything was done to the furthest extent. For this reason we will
  10730. discuss some of the limits that you may encounter while using Surefire.
  10731. The tables below summarize Surefire System limits.
  10732.  
  10733.     There is room for approximately 15 to 20 standard 8-1/2 by 11 inch
  10734. pages in 640K RAM. When documents approach this limit, we recommend that
  10735. your document is broken down into more than one document. This can be
  10736. done by deleting the second portion of the document and saving the
  10737. document with a different name such as "mydoc2". Then get the original
  10738. document, delete the first portion and save this document with a
  10739. descriptive name such as "mydoc1". You can then delete the original
  10740. document so as not to be confused.
  10741.  
  10742.      You will be warned with a message window if you are about to run
  10743. out of memory. Since memory is generally left fragmented, it is best to
  10744. save your document, exit Surefire and then re-run Surefire.
  10745.  
  10746.      Word Processor Limits
  10747.  
  10748.      Maximum page width: 260 characters
  10749.      Maximum page length: 96 lines
  10750.      Minimum page width: 10 characters
  10751.      Minimum page length: 3 lines
  10752.      Minimum space between left and right margins: 10 characters
  10753.      Minimum space between top and bottom margins: 3 lines
  10754.      Maximum number of pages per document: 250 but normally limited by
  10755.      memory (varies by page size)
  10756.      Maximum number of clipboard objects: 20
  10757.  
  10758.      Field Limits
  10759.  
  10760.      Maximum number of fields per document: 500
  10761.      Total number of non-stored fields in a document: limited only by
  10762.      memory
  10763.      Maximum size of a text field (non-stored): size of the page
  10764.      Maximum size of a text field (stored): 254 characters
  10765.      Maximum width of numeric field: 16 characters (without '%','$',',')
  10766.      Maximum number of cells in multiline numeric field: limited by page
  10767.      length (96)
  10768.      Maximum number of items in a text field pop-list: 30
  10769.  
  10770.      Database Limits
  10771.  
  10772.      Database file size is limited only by the size of your disk
  10773.      Total number of stored or projected fields per document: 128
  10774.      Maximum number of records is 1 billion (limited by disk)
  10775.      Maximum record size: 4,000 bytes
  10776.      Maximum size of a stored text field is 254 characters
  10777.      Maximum number of named queries: 20 per document
  10778.      While Dbase III file compatible, Surefire does not use memo fields
  10779.  
  10780.  
  10781.  
  10782.  
  10783.  
  10784.  
  10785.  
  10786.  
  10787.             Surefire User's Guide         Page 167
  10788.  
  10789.  
  10790. Appendix A     -    Surefire Function Reference
  10791.  
  10792.      Field commands can be simple or complex. They can manipulate
  10793. various types of information including numbers, dates and text. They can
  10794. also control database access and link documents together. This chapter
  10795. describes all of the functions that are available in Surefire that you
  10796. may use in field commands. The various aspects of field commands are
  10797. described in "Chapter 14: Introducing Field Commands" and in "Chapter
  10798. 15: Using Field Commands".
  10799.  
  10800.  
  10801. General Mathematical Functions
  10802.  
  10803.      These functions do the most general mathematical manipulations. Any
  10804. of these functions can be used in the Calculator.
  10805.  
  10806. Absolute Value
  10807.  
  10808.      @ABS(n) - Return the absolute value of n.
  10809.  
  10810.      Example:       @ABS(-15) returns 15
  10811.  
  10812. Integer Value
  10813.  
  10814.      @INT(n) - Truncate the decimal part of n and return the integer
  10815.      value.
  10816.  
  10817.      Example:       @INT(11.55) returns 11.
  10818.  
  10819. Remainder
  10820.  
  10821.      @MOD(dividend, divisor) - Return the integer that represents the
  10822.      amount left over when the dividend is divided by divisor.
  10823.  
  10824.      Example:       @MOD(27, 5) returns 2.
  10825.  
  10826. Rounding
  10827.  
  10828.      @ROUND(n, place) - Round n to the nearest value with the number of
  10829.      decimal places defined by place.
  10830.  
  10831.      Example:       @ROUND(77.456, 2) returns 77.46.
  10832.  
  10833. Square Root
  10834.  
  10835.      @SQRT(n) - Return the square root of n.
  10836.  
  10837.      Example:       @SQRT(64) returns 8.
  10838.  
  10839.  
  10840.  
  10841.  
  10842.  
  10843.  
  10844.  
  10845.  
  10846.  
  10847.  
  10848.  
  10849.  
  10850.  
  10851.  
  10852.             Surefire User's Guide         Page 168
  10853.  
  10854.  
  10855. Trigonometric Functions
  10856.  
  10857.      These are the basic trigonometric functions. Any of these functions
  10858. can be used in the Calculator.
  10859.  
  10860. Pi
  10861.  
  10862.      @PI - Return the value of Pi.
  10863.  
  10864.      Pi is specified as 3.141592653589794.
  10865.  
  10866. Sine
  10867.  
  10868.      @SIN(n) - Return the sine of n, where n is an angle in radians.
  10869.  
  10870. Cosine
  10871.  
  10872.      @COS(n) - Return the cosine of n, where n is an angle in radians.
  10873.  
  10874. Tangent
  10875.  
  10876.      @TAN(n) - Return the tangent of n, where n is an angle in radians.
  10877.  
  10878.  
  10879. Logarithmic Functions
  10880.  
  10881.      These are the logarithmic functions. Any of these functions can be
  10882. used in the Calculator.
  10883.  
  10884. Logarithm
  10885.  
  10886.      @LOG(n) -  Return the logarithm (base 10) of the positive number n.
  10887.  
  10888.      Example:       @LOG(300) returns 2.4771212547.
  10889.  
  10890. Power of e
  10891.  
  10892.      @EXP(n) - Return the value of "e" raised to the power of n.
  10893.  
  10894.      Example:       @EXP(6) returns 403.42879349.
  10895.  
  10896. Natural Logarithm
  10897.  
  10898.      @LN(n) Return the natural logarithm (base "e") of n.
  10899.  
  10900.      Example:       @LN(100) returns 4.605170186.
  10901.  
  10902.  
  10903.  
  10904.  
  10905.  
  10906.  
  10907.  
  10908.  
  10909.  
  10910.  
  10911.  
  10912.  
  10913.  
  10914.  
  10915.  
  10916.  
  10917.             Surefire User's Guide         Page 169
  10918.  
  10919.  
  10920. Financial Functions
  10921.  
  10922.      The following are available functions to do financial calculations.
  10923. Any of these functions can be used in the Calculator.
  10924.  
  10925. Future Value
  10926.  
  10927.      @FV(pmt, int, term) - Return the future value of an investment
  10928.      given the payment, pmt, the periodic interest rate, int, and the
  10929.      term of the loan, term.
  10930.  
  10931. Payment Amounts
  10932.  
  10933.      @PMT(prin, int, term) - Return the payment of a loan given the
  10934.      principle, prin, the periodic interest rate, int, and the term of
  10935.      the loan, term.
  10936.  
  10937. Present Value
  10938.  
  10939.      @PV(pmt, int, term) - Return the present value of an investment
  10940.      given the payment, pmt, the periodic interest rate, int, and the
  10941.      term of the loan, term.
  10942.  
  10943. Compound Growth Rate
  10944.  
  10945.      @RATE(fv, pv, term) - Return the compound growth rate given the
  10946.      future value, fv, the present value, pv, and the term of the loan,
  10947.      term.
  10948.  
  10949. Statistical Functions
  10950.  
  10951.      Statistical functions are a class of numeric functions that operate
  10952. on a group of numbers. Generally, the group of numbers is specified as
  10953. one or more cell ranges or field references separated by commas. For
  10954. example, the group (A1:B2, C)  is made of all the cells in the range of
  10955. A1 through B2 and the field C. This group of cells can not span pages.
  10956.  
  10957.      For the examples given with these functions, let's use the fields
  10958. and cells shown below:
  10959.  
  10960. Average
  10961.  
  10962.      @AVG(references) - Return the average of all the numbers found in
  10963.      the cells specified by references.
  10964.  
  10965.      Example:       @AVG(A1:B2) returns 15
  10966.  
  10967. Count
  10968.  
  10969.      @COUNT(references) - Return the count of all cells specified by
  10970.      references.
  10971.  
  10972.      Examples:      @COUNT(A) returns 2.
  10973.                     @COUNT(A1:B2, C) returns 5.
  10974.  
  10975.  
  10976.  
  10977.  
  10978.  
  10979.  
  10980.  
  10981.  
  10982.             Surefire User's Guide         Page 170
  10983.  
  10984.  
  10985. Maximum
  10986.  
  10987.      @MAX(references) - Return the maximum of all the numbers found in
  10988.      the cells specified by references.
  10989.  
  10990.      Examples:      @MAX(A1:B2) returns 30.
  10991.                     @MAX(A1:B2, D) returns 62.
  10992.  
  10993. Minimum
  10994.  
  10995.      @MIN(references) - Return the minimum of all the numbers found in
  10996.      the cells specified by references.
  10997.  
  10998.      Examples:      @MIN(A1:B2) returns 5.
  10999.                     @MIN(C, D) returns 20.
  11000.  
  11001. Sum
  11002.  
  11003.      @SUM(references) - Return the sum of all the numbers found in the
  11004.      cells specified by references.
  11005.  
  11006.      Examples:      @SUM(A1:B2) returns 60.
  11007.                     @SUM(A, C, D) returns 107.
  11008.  
  11009.      The next two functions operate on a single range of cells or a
  11010. single field reference. In addition, their results will be affected by
  11011. the current execution order for the page on which the cells are found.
  11012. A vertical order will give a different result than a horizontal order.
  11013. See "Chapter 16: Spreadsheets" for information on how to set the
  11014. execution order.
  11015.  
  11016. Standard Deviation
  11017.  
  11018.      @STD(cell1:cell2) or @STD(field) - Return the standard deviation of
  11019.      all the numbers contained in cell1:cell2 or in all cells of field.
  11020.  
  11021.      Example:       @STD(A1:B2) returns 9.
  11022.  
  11023. Variance
  11024.  
  11025.      @VAR(cell1:cell2) or @VAR(field) - Return the variance of all
  11026.      numbers contained in cell1:cell2 or in all cells of field.
  11027.  
  11028.      Example:       @VAR(A1:B2) returns 88.
  11029.  
  11030. Date Functions
  11031.  
  11032.      A date function either produces a date as a result or requires a
  11033. date value or a reference to a date field in at least one argument. When
  11034. a date value results from a function, it may be displayed in a date
  11035. field in one of three formats. The following are the date functions
  11036. available in Surefire.  The arguments date, date1 and date2  in these
  11037. functions represent date field references or date values resulting from
  11038. any of the functions that return dates, such as @TODAY, @SUBDAYS, etc.
  11039.  
  11040.  
  11041.  
  11042.  
  11043.  
  11044.  
  11045.  
  11046.  
  11047.             Surefire User's Guide         Page 171
  11048.  
  11049.  
  11050. Add Days to a Date
  11051.  
  11052.      @ADDDAYS(date,days) - Returns the date that is days number of days
  11053.      after date.
  11054.  
  11055.      Example:  Date field testdate has the value 5/7/90;
  11056.                @ADDDAYS(testdate, 15) returns 5/22/90.
  11057.  
  11058. Date is After?
  11059.  
  11060.      @AFTER(date1,date2) - Return the logical value TRUE if date1 is
  11061.      after date2, otherwise return FALSE.
  11062.  
  11063.      Example:  Date field testdate1 has value 3/21/85; testdate2 has
  11064.                4/20/85.
  11065.                @AFTER( testdate1, testdate2 ) returns FALSE.
  11066.  
  11067. Date is Before?
  11068.  
  11069.      @BEFORE(date1,date2) - Return the logical value TRUE if date1 is
  11070.      earlier than date2, otherwise return FALSE
  11071.  
  11072.      Example:  Date field testdate1 has value 3/21/85; testdate2 has
  11073.                4/20/85.
  11074.                @BEFORE( testdate1, testdate2 ) returns TRUE.
  11075.  
  11076. Specify a Date
  11077.  
  11078.      @DATE(month,day,year) - Returns a date corresponding to the integer
  11079.      numbers representing month, day and year. Year must be either 2 or
  11080.      4 digits.
  11081.  
  11082.      Example:  @DATE(8, 6, 54) returns 8/6/54
  11083.                (or August 6, 1954 or aug-06-54).
  11084.  
  11085. Day of Month
  11086.  
  11087.      @DAY(date) - Returns an integer number corresponding to the day
  11088.      specified in date.
  11089.  
  11090.      Example:  Date field testdate1 has value 5/12/34;
  11091.                @DAY(testdate1) returns 12.
  11092.  
  11093. Find Days between Dates
  11094.  
  11095.      @DIFDATE(date1,date2) - Return an integer that is the number of
  11096.      days between date1 and date2.
  11097.  
  11098.      Example:  Date field testdate1 has value January 5, 1987; Date
  11099.                field testdate2 has value December 19, 1986.
  11100.                @DIFDATE(testdate1, testdate2) returns 17 (days).
  11101.  
  11102.  
  11103.  
  11104.  
  11105.  
  11106.  
  11107.  
  11108.  
  11109.  
  11110.  
  11111.  
  11112.             Surefire User's Guide         Page 172
  11113.  
  11114.  
  11115. Month of Year
  11116.  
  11117.      @MONTH(date) - Returns an integer number corresponding to the month
  11118.      specified in date.
  11119.  
  11120.      Example:       Date field testdate1 has value 3/21/85;
  11121.                     @MONTH(testdate1) returns 3 (month is March)
  11122.  
  11123. Dates are Same?
  11124.  
  11125.      @SAME(date1, date2) - Return the logical value TRUE if date1 and
  11126.      date2 are the same, otherwise return FALSE.
  11127.  
  11128.      Example:       Date field testdate1 has value 3/21/85; testdate2
  11129.                     has 10/14/78.
  11130.                     @SAME(testdate1, testdate2) returns FALSE.
  11131.  
  11132. Subtract Days from a Date
  11133.  
  11134.      @SUBDAYS(date, days) - Returns the date that is days number of days
  11135.      before date.
  11136.  
  11137.      Example:  Date field testdate has value 13-mar-55.
  11138.                @SUBDAYS(testdate, 5) returns 08-mar-55
  11139.                (or March 8, 1955 or 8/8/55).
  11140.  
  11141. Today's Date
  11142.  
  11143.      @TODAY - Return today's date as a date.
  11144.  
  11145.      Example:  Today is New Year's Day 1995.
  11146.                @TODAY returns 1/1/95
  11147.                (or 1-jan-95 or January 1, 1995).
  11148.  
  11149. Year
  11150.  
  11151.      @YEAR(date) - Return an integer number corresponding to the year
  11152.      specified in date.
  11153.  
  11154.      Example:  Date field testdate has value 3/21/85;
  11155.                @YEAR( testdate ) returns 1985.
  11156.  
  11157. Text of a Date
  11158.  
  11159.      @DATESTR(date) - Return a text string that represents date. This
  11160.      string can be assigned to a text field or written on a page of the
  11161.      document.
  11162.  
  11163.      Example:  Date field testdate has value March 9, 1977;
  11164.                @DATESTR(testdate) returns "March 9, 1977"
  11165.  
  11166.  
  11167.  
  11168.  
  11169.  
  11170.  
  11171.  
  11172.  
  11173.  
  11174.  
  11175.  
  11176.  
  11177.             Surefire User's Guide         Page 173
  11178.  
  11179.  
  11180. Text of a Month
  11181.  
  11182.      @MONTHSTR(m) - Convert a number m to the string of the
  11183.      corresponding month. A number greater than 12 will produce the
  11184.      month based on modulo 12. This string can be assigned to a text
  11185.      field or written on a page of the document.
  11186.  
  11187.      Examples: @MONTHSTR(6) returns "June".
  11188.                @MONTHSTR(15) returns "March".
  11189.  
  11190. Text of a Day
  11191.  
  11192.      @DAYSTR(date) - Return the day of the week as a string based on the
  11193.      given date.  This string can be assigned to a text field or written
  11194.      on a page of the document.
  11195.  
  11196.      Example:  Date field testdate has value August 10, 1990.
  11197.                @DAYSTR( testdate ) returns "Friday".
  11198.  
  11199. Text Functions
  11200.  
  11201.      A text function is defined as a function in which the result or at
  11202. least one of its arguments requires a text string or reference to a text
  11203. field.  In fact, there are some text strings that yield numeric results.
  11204. These numeric results can be used in mathematical expressions. Also, if
  11205. a text function requires a number as an argument, this argument can be
  11206. any numeric function or mathematical expression.
  11207.  
  11208.      The arguments text or str may be quoted strings or references to
  11209. text fields.  The argument start may be a number of 0 or greater where
  11210. 0 means the first character of the string.
  11211.  
  11212. Find a String
  11213.  
  11214.      @FIND(str, text, start) - Find string str within text beginning at
  11215.      position start. Return the integer number corresponding to the
  11216.      position in text of where the string was found.  If the string is
  11217.      not found, -1 is returned.
  11218.  
  11219.      Example:       @FIND("most", "foremost", 0) returns 4.
  11220.  
  11221. Obtain a String
  11222.  
  11223.      @SUBSTR(text, start, len) - Return a text string within text
  11224.      beginning at the position start whose length is len.
  11225.  
  11226.      Example:       @SUBSTR("activity", 2, 3) returns "tiv".
  11227.  
  11228.  
  11229.  
  11230.  
  11231.  
  11232.  
  11233.  
  11234.  
  11235.  
  11236.  
  11237.  
  11238.  
  11239.  
  11240.  
  11241.  
  11242.             Surefire User's Guide         Page 174
  11243.  
  11244.  
  11245. Replace a String
  11246.  
  11247.      @REPLACE(text, start, len, str) - Return the text string after
  11248.      replacing the number of characters len beginning at position start
  11249.      in text with another string str.
  11250.  
  11251.      Example:       @REPLACE( "generate", 0,3, "coop") returns
  11252.                     "cooperate".
  11253.  
  11254. Obtain Length of String
  11255.  
  11256.      @LENGTH(text) - Return the number of characters in the text string
  11257.      text.
  11258.  
  11259.      Example:  Text field text1 has the value "ghost".
  11260.                @LENGTH(text1) returns 5.
  11261.  
  11262. Remove Trailing Blanks
  11263.  
  11264.      @TRIM(text) - Remove any blank spaces at the end of text.
  11265.  
  11266.      Example:       @TRIM("people in the news       ") returns "people
  11267.                     in the news".
  11268.  
  11269. Compare Two Strings
  11270.  
  11271.      @EXACT(text1, text2) - Return the logical value TRUE if text1 and
  11272.      text2 are the same, otherwise return FALSE.
  11273.  
  11274.      Example:       @EXACT("mice", "mouse") returns FALSE.
  11275.  
  11276. Force String to Upper Case
  11277.  
  11278.      @UPPER(text) - Return a text string after changing all the
  11279.      characters of text to upper case.
  11280.  
  11281.      Example:       @UPPER("house") returns "HOUSE".
  11282.  
  11283. Force String to Lower Case
  11284.  
  11285.      @LOWER(text) - Return a text string after changing all the
  11286.      characters of text to lower case.
  11287.  
  11288.      Example:       @LOWER("MixeD") returns "mixed".
  11289.  
  11290. Convert a Number to a String
  11291.  
  11292.      @NUMSTR(n) - Return a text string that represents the number n. Use
  11293.      this function to convert numeric field values to text field values.
  11294.  
  11295.      Example:       @NUMSTR(15) returns "15".
  11296.  
  11297.  
  11298.  
  11299.  
  11300.  
  11301.  
  11302.  
  11303.  
  11304.  
  11305.  
  11306.  
  11307.             Surefire User's Guide         Page 175
  11308.  
  11309.  
  11310. Put String to a Page
  11311.  
  11312.      @PUTSTR(page, text, col, line) - Put the text string text on page
  11313.      page beginning at column col, and line line.
  11314.  
  11315.      Example:  Text field teststring has the value "This is a Test".
  11316.                @PUTSTR( 5, teststring, 30, 20) will put the string "This
  11317.                is a Test" at line 20 and column 30 of page 5 of the
  11318.                current document.
  11319.  
  11320. Text Buffer Functions
  11321.  
  11322.      These functions manipulate text in text buffers.  Text buffers are
  11323. similar to clipboard objects except they are only manipulated by the
  11324. following functions. They are useful in carrying information between
  11325. documents. In all of these functions, the number specified by buffer may
  11326. be between 1 and 25. All of these functions return TRUE if the operation
  11327. was successful. Otherwise, they return FALSE.
  11328.  
  11329. Copy Text to Buffer
  11330.  
  11331.      @COPY(page, col1, line1, col2, line2, buffer) - Do a Block
  11332.      selection and Copy the text on the page page from the rectangle
  11333.      whose upper left corner is at col1, line1 and whose lower right
  11334.      corner is at col2, line2 to the buffer buffer.
  11335.  
  11336.      Example:       @COPY(1, 10, 1, 20, 2, 5) will copy the rectangle
  11337.                     from columns 10 through 20 on lines 1 and 2 of page
  11338.                     1 to buffer 5. This is a block of text 11
  11339.                     characters wide and 2 lines high.
  11340.  
  11341. Paste Buffer onto Page
  11342.  
  11343.      @PASTE(page, col, line, buffer, copyattr) - Paste the text from the
  11344.      buffer buffer that was copied via @COPY or @FCOPY on the page page
  11345.      starting at col, line.  If copyattr is @TRUE, write the attributes
  11346.      that were also copied to the buffer. Otherwise, the text is written
  11347.      using whatever attributes are already there at that place on the
  11348.      page.  The contents of buffer are retained until other information
  11349.      is copied into that buffer.
  11350.  
  11351.      Example:       @PASTE(2, 30, 10, 5, @FALSE) will paste the
  11352.                     contents of buffer 5 at column 30 line 10 of page 2
  11353.                     without changing the attributes at that location.
  11354.  
  11355. Copy Text from Field to Buffer
  11356.  
  11357.      @FCOPY(field, buffer) or @FCOPY(, buffer) - Same as @COPY except
  11358.      the rectangle is that of field. If field is not specified, the
  11359.      buffer buffer is cleared.
  11360.  
  11361.      Example:  The numeric field digits displays the value $376.30.
  11362.                @FCOPY(digits, 10) puts "$376.30" into buffer 10.
  11363.  
  11364.  
  11365.  
  11366.  
  11367.  
  11368.  
  11369.  
  11370.  
  11371.  
  11372.             Surefire User's Guide         Page 176
  11373.  
  11374.  
  11375. Paste Buffer into Field
  11376.  
  11377.      @FPASTE(field, buffer, copyattr) - Same as @PASTE except the
  11378.      location of the Paste is the upper left corner of field. The value
  11379.      of field is also set.
  11380.  
  11381.      Example:  Birthdate is a long format date field. Buffer 16 contains
  11382.                "03/09/80".
  11383.                @FPASTE(birthdate, 16, @FALSE) will display "March 9,
  11384.                1980" in birthdate.
  11385.  
  11386. Time Functions
  11387.  
  11388.      While Surefire does not have a field type specifically for time, it
  11389. is often useful to have values based on time. These functions return
  11390. text strings based on the current time which can then be assigned to
  11391. text fields or displayed on a document page.
  11392.  
  11393. Current Time
  11394.  
  11395.      @TIME - Return a string corresponding to current time in the form
  11396.      hh:mm:ss.
  11397.  
  11398.      Example:   It is now 5:30 AM. @TIME returns "5:30:00".
  11399.  
  11400. Time Stamp
  11401.  
  11402.      @NOW - Return a string corresponding to the current date and time
  11403.      in the form yymmddhhmmss. This is often useful to generate a unique
  11404.      account number.
  11405.  
  11406.      Example:  It is now 12:52 on May 9, 1990.
  11407.                @NOW returns "900509125200"
  11408.  
  11409. Control Functions
  11410.  
  11411.      Control functions perform some immediate action. Because the result
  11412. is an action, these functions are used with button fields or with the
  11413. Execute on Enter prefix "[".
  11414.  
  11415.      Control functions generally return a logical value.  If this is a
  11416. TRUE value, the function was executed as expected.  If a FALSE was
  11417. returned, there was some sort of problem. A FALSE returned from an
  11418. @GODOC, @RETURN, or the database control function @JOIN will stop
  11419. execution of the remaining commands for that button or immediate command
  11420. string ([) if there are any. Otherwise, Surefire will display "COMMAND
  11421. ERROR" in the status line but will attempt to continue processing the
  11422. remainder of the command.
  11423.  
  11424.      The control functions available in Surefire are on the following
  11425. pages.
  11426.  
  11427.  
  11428.  
  11429.  
  11430.  
  11431.  
  11432.  
  11433.  
  11434.  
  11435.  
  11436.  
  11437.             Surefire User's Guide         Page 177
  11438.  
  11439.  
  11440. Go To a Page
  11441.  
  11442.      @GOPAGE(page) - Scroll the document and put the cursor in the first
  11443.      field on the page whose number is page. If there are no fields on
  11444.      that page, put the cursor at the top of the page. Return TRUE if
  11445.      successful, and FALSE if the page does not exist.
  11446.  
  11447.      Example:       @GOPAGE(5) will display page 5 of the current
  11448.                     document.
  11449.  
  11450. Go To a Field
  11451.  
  11452.      @GOFIELD(field) - Put the cursor in the specified field.  If the
  11453.      field does not exist return FALSE, otherwise return TRUE.
  11454.  
  11455.      Example:  @GOFIELD(account) puts the cursor on the field named
  11456.                account.
  11457.  
  11458. Go To a Document
  11459.  
  11460.      @GODOC(name) - Get the document whose name is specified by name.
  11461.      Return FALSE if the document is not found, otherwise return TRUE.
  11462.      You may specify a document in a different directory by giving a
  11463.      relative pathname. If you do this, the current directory will be
  11464.      changed before Surefire looks for and reads the document. The name
  11465.      of the document must be in quotes (").
  11466.  
  11467.      Examples: Currently looking at document news. The directory is
  11468.                topdir.
  11469.  
  11470.                1) @GODOC("people") will display the first page of the
  11471.                document people.
  11472.  
  11473.                2) @GODOC("newdir\finance") will switch to the directory
  11474.                newdir and then display the document finance.
  11475.  
  11476.      Advanced Use:  If you have already accessed this document during
  11477.                     this session, Surefire remembers the most recent
  11478.                     database query executed for the document. Use the
  11479.                     prefix (!) to avoid re-execution of the query when
  11480.                     this document is displayed.
  11481.  
  11482. Return to Previous Document
  11483.  
  11484.      @RETURN - Read the document that executed the @GODOC function that
  11485.      got the current document. Return TRUE if successful, otherwise
  11486.      return FALSE. If @GODOC or @JOIN caused a change in directory, the
  11487.      previous directory will be restored as the current directory.
  11488.  
  11489.      Examples:
  11490.           1) @RETURN from example 1 above redisplays the document news.
  11491.  
  11492.           2) @RETURN from example 2 above will switch to directory
  11493.           topdir and redisplay the document news.
  11494.  
  11495.  
  11496.  
  11497.  
  11498.  
  11499.  
  11500.  
  11501.  
  11502.             Surefire User's Guide         Page 178
  11503.  
  11504.  
  11505. Return to Document at Level
  11506.  
  11507.      @RETURN(levels) - Read the document at the specified number of
  11508.      levels above the current document. Return TRUE if successful,
  11509.      otherwise return FALSE. If @GODOC or @JOIN caused a change in
  11510.      directory, the previous current directory will be restored. If
  11511.      levels is 1, this function is the same as the function @RETURN
  11512.      without arguments.
  11513.  
  11514.      Example:  Do @GODOC from document A to document B. Then do
  11515.                @GODOC from document B to document C.
  11516.  
  11517.                @RETURN(2) from document C will go back 2 levels and
  11518.                redisplay document A.
  11519.  
  11520. Run a DOS Command
  11521.  
  11522.      @RUN(command) - Run the DOS command or program that is specified in
  11523.      the text string command. Command may also be a text field
  11524.      reference. After the command is executed, you will be asked to
  11525.      press a key to return to Surefire.
  11526.  
  11527.      Example:  @RUN("myprogram") will run the executable program named
  11528.                myprogram.
  11529.  
  11530.      Note:   You can only run a program that fits in memory along with
  11531.      Surefire.
  11532.  
  11533. Reset the Document
  11534.  
  11535.      @RESET or @RESET(report) - Re-get the current document but don't
  11536.      give any warnings and don't clear the current query information. If
  11537.      report is @TRUE, pre-specified report formatting is enabled while
  11538.      @FALSE disables any report generation.
  11539.  
  11540.      This first version of the function is used to return the fields to
  11541. a document with report formatting so that you can Search & Print the
  11542. report or generate a different report by changing the query. The second
  11543. version allows you to easily switch report attributes on and off in  a
  11544. document that is part of a bigger application. See "Chapter 22:
  11545. Generating Reports" for more information on reports.
  11546.  
  11547. Set Help Context
  11548.  
  11549.      @HELP(context) - Set the context to context which is the page
  11550.      number of the document help file. This page is displayed in the
  11551.      Document Help window when (F2) is pressed. See "Chapter 24: More
  11552.      About Surefire Documents" for complete information on using
  11553.      document help.
  11554.  
  11555.  
  11556.  
  11557.  
  11558.  
  11559.  
  11560.  
  11561.  
  11562.  
  11563.  
  11564.  
  11565.  
  11566.  
  11567.             Surefire User's Guide         Page 179
  11568.  
  11569.  
  11570. Present a Document
  11571.  
  11572.      @PRESENT(msecs) - Show each page of the current document for a
  11573.      duration of msecs. After the last page is displayed the cycle
  11574.      begins again from page 1. Use this to present a "slide show" of the
  11575.      pages in your document. Usually, the document will have pages that
  11576.      are the size of the screen. If you want to pause the presentation
  11577.      on a specific screen, press (Spacebar). The automatic presentation
  11578.      will continue when you press (Spacebar) again. The presentation
  11579.      will last until you press (Esc). Then, you will be able to move
  11580.      through the document normally with the cursor movement and paging
  11581.      keys.
  11582.  
  11583.      Example:  Have a document with 5 screen size pages.
  11584.                @PRESENT(500) will display page 1 for 1/2 a second, then
  11585.                page 2 for 1/2 a second, page3, page4, up through page 5
  11586.                and then repeat at page 1.
  11587.  
  11588.      You can use the @PRESENT function to do screen animation. Just set
  11589. up your document as a series of screen pages that change in a certain
  11590. way.  Then use @PRESENT with a small value for msecs.
  11591.  
  11592.  
  11593. Database Statistical Functions
  11594.  
  11595.      All of the following functions, except @DSUBCOUNT, are equivalent
  11596. to the non-database statistical functions.  The difference is that they
  11597. operate on the values of the specified field for all the records
  11598. retrieved by the current query.
  11599.  
  11600.      Note:   These functions may only be used if a document has report
  11601. attributes specified.
  11602.  
  11603.      For the examples with the following functions, the database records
  11604. retrieved have these fields and values:
  11605.  
  11606.      Group     Age
  11607.      A         50
  11608.      B         60
  11609.      C         35
  11610.      A         12
  11611.      C         46
  11612.      B         21
  11613.  
  11614.  
  11615.  
  11616.  
  11617.  
  11618.  
  11619.  
  11620.  
  11621.  
  11622.  
  11623.  
  11624.  
  11625.  
  11626.  
  11627.  
  11628.  
  11629.  
  11630.  
  11631.  
  11632.             Surefire User's Guide         Page 180
  11633.  
  11634.  
  11635. @DAVG(field) -     Average value of field over retrieved records.
  11636.  
  11637.      Example:  @DAVG(age) returns 37.33
  11638.  
  11639. @DMAX(field) - Maximum value of field over retrieved records.
  11640.  
  11641.      Example:  @DMAX(age) returns 60.
  11642.  
  11643. @DMIN(field) -      Minimum value of field over retrieved records.
  11644.  
  11645.      Example:  @DMIN(age) returns 12.
  11646.  
  11647. @DSUM(field) - Sum of values of field over retrieved records.
  11648.  
  11649.      Example:  @DSUM(age) returns 224.
  11650.  
  11651. @DCOUNT -      Total number of records found for the current query.
  11652.  
  11653.      Example:  We're sorting these records by group. After displaying
  11654.      all the records, @DCOUNT  returns 6.
  11655.  
  11656. @DSUBCOUNT - Count of records retrieved so far.
  11657.  
  11658.      Example:  We're sorting these records by group. After displaying
  11659.      the records for group A, @DSUBCOUNT would return 2.
  11660.  
  11661.  
  11662. Database Searching Functions
  11663.  
  11664.      The following group of functions are used for controlling data base
  11665. searching and updating. Like control functions, these functions are used
  11666. in button fields and in field commands that are set for immediate
  11667. execution (i.e. Execute on Enter).
  11668.  
  11669. Set Query Conditions
  11670.  
  11671.      @CNDX("docname","query", docfield1, docfield2, " qfield") - for the
  11672. specified query defined in the specified document docname, set the first
  11673. condition value of the query line whose field is qfield to the value in
  11674. docfield1.  Set the second condition (if any) to the value in docfield2.
  11675. Both docfield1 and docfield2  may refer to fields in the current
  11676. document. They may also be quoted text strings or numeric constants. In
  11677. specifying docfield1 and docfield2 you can mix a numeric constant with
  11678. numeric field reference or a text string with a text field reference.
  11679. Docfield2  may be left out.
  11680.  
  11681.      @CNDX - without arguments, this function clears all query
  11682. conditions set at the current document level.
  11683.  
  11684.      See the section "Using Database Searching Functions" in  "Chapter
  11685. 21: Advanced Database Topics" for a complete description of the use of
  11686. this function.
  11687.  
  11688.  
  11689.  
  11690.  
  11691.  
  11692.  
  11693.  
  11694.  
  11695.  
  11696.  
  11697.             Surefire User's Guide         Page 181
  11698.  
  11699.  
  11700. Execute a Query
  11701.  
  11702.      @QUERY("query") - The query with the specified name previously
  11703. defined for the current document is executed. Use any conditions
  11704. specified with @CNDX for this query.
  11705.  
  11706.      Example:  @QUERY("cities") will start a search in the current
  11707.      document using the named query "cities".
  11708.  
  11709. Join a Document
  11710.  
  11711.      @JOIN("document", "query") Go to the specified document and execute
  11712. the query with the specified name. Use any conditions specified with
  11713. @CNDX for this query.
  11714.  
  11715.      Example:  @JOIN("trails", "colorado") will display the document
  11716.      trails and execute the named query colorado.
  11717.  
  11718. Start a Search
  11719.  
  11720.      @SEARCH - Initiate a search based on the value of the current field
  11721. in the current document. This is useful after the @GODOC, @FPASTE,
  11722. @GOFIELD command combination. This function is equivalent to pressing
  11723. (ALT+S) while the cursor is on a field.
  11724.  
  11725. Update Record
  11726.  
  11727.      @UPDATE - Update the current database record with the values
  11728. currently in the fields. This function is equivalent to pressing (ALT+U)
  11729. after a database search has been done.
  11730.  
  11731.  
  11732.  
  11733.  
  11734.  
  11735.  
  11736.  
  11737.  
  11738.  
  11739.  
  11740.  
  11741.  
  11742.  
  11743.  
  11744.  
  11745.  
  11746.  
  11747.  
  11748.  
  11749.  
  11750.  
  11751.  
  11752.  
  11753.  
  11754.  
  11755.  
  11756.  
  11757.  
  11758.  
  11759.  
  11760.  
  11761.  
  11762.             Surefire User's Guide         Page 182
  11763.  
  11764.  
  11765. Logical Value Functions
  11766.  
  11767.      A logical value can also be explicitly defined by using the
  11768. functions @TRUE and @FALSE.  These are in fact equivalent to using the
  11769. numbers 1 for True and 0 for False, but are much more readable.
  11770.  
  11771.      @TRUE - equivalent to the value 1.
  11772.      @FALSE - equivalent to the value 0.
  11773.  
  11774. Logical Condition Function
  11775.  
  11776.      A logical condition does something different based on whether the
  11777. given logical expression is true or false. In other words you may want
  11778. to take some action or do a calculation only if something else is True
  11779. or False. To do this there is a special function:
  11780.  
  11781.      @IF(condx, true, false)
  11782.  
  11783.      The @IF function uses a logical expression for its first argument,
  11784. condx. If the condition condx evaluates to TRUE, then the command
  11785. specified as the argument true is executed. Otherwise the condition must
  11786. be FALSE, so the command specified as the argument false is executed.
  11787.  
  11788.      Example:  Let's say you have cells A1 that contains your income and
  11789.      B1 will have the tax you owe. And you have a simple tax rate of
  11790.      10%. To make sure a negative tax is never calculated, use the
  11791.      following field command in cell B1.
  11792.  
  11793.      @IF( A1 >= 0, A1 * .10, 0 ).
  11794.  
  11795.      This will take the value in cell A1 and see whether it is greater
  11796.      than 0.  If it is, the value is multiplied by .10, (or 10 percent).
  11797.      Otherwise the result is set to the third argument, zero.
  11798.  
  11799.      If cell A1 has the value $400, B1 will have the value $40.
  11800.      If cell A1 has the value ($500), that is a loss of $500, B1 will
  11801.      have the value $0.
  11802.  
  11803.  
  11804.      Using the @IF function, you can test logical field values that
  11805. correspond to a person's Yes/No responses to questions. From this you
  11806. determine which page or document of a "script" application is
  11807. appropriate to that person's answer. Once there, after an @GOPAGE or
  11808. @GODOC, the user can answer more questions, look at the result of a
  11809. database search or look at a chart of information, for example. 
  11810.  
  11811.  
  11812.  
  11813.  
  11814.  
  11815.  
  11816.  
  11817.  
  11818.  
  11819.  
  11820.  
  11821.  
  11822.  
  11823.  
  11824.  
  11825.