home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / bazy / easybase / pack1.prg / EBOUT / EB3.REP < prev    next >
Text File  |  1995-08-04  |  199KB  |  8,633 lines

  1.  
  2.  
  3.       ════════════════════════════════════════════════════════════════
  4.                   EASY BASE PROGRAMMERS REFERENCE
  5.                             Contents
  6.       ────────────────────────────────────────────────────────────────
  7.  
  8.                   Procedure Commands            Page
  9.                   ──────────────────
  10.  
  11.                   Clear Records From             11
  12.                   Copy All From                  14
  13.                   Create Temp As                 15
  14.                   Declare                        27
  15.                   Delay                          30
  16.                   Delete Record                  32
  17.                   Derive Off                     33
  18.                   Display Status                 36
  19.                   Do..Loop                       37
  20.                   Escape On/Off                  39
  21.                   Exit Batch Menu                40
  22.                   Exit Procedure                 41
  23.                   For..Next                      48
  24.                   If Then Else                   61
  25.                   Index Off                      63
  26.                   List Variables                 73
  27.                   Manual Feed                    78
  28.                   Multiple Lines                 85
  29.                   Next Batch                     86
  30.                   Odd/Even Page Print            87
  31.                   Pause On/Off                   98
  32.                   Preselect                     100
  33.                   Print                         101
  34.                   Printer Control               102
  35.                   Remark                        109
  36.                   Run                           117
  37.                   Show Picklist                 124
  38.                   Skip Group                    126
  39.                   Skip Record                   127
  40.                   Subindex                      133
  41.                   Update Record                 143
  42.  
  43.  
  44.                   Field Controls                Page
  45.                   ──────────────
  46.  
  47.                   Beep                            5
  48.                   Clearfields                    12
  49.                   Cursor                         18
  50.                   Delay                          29
  51.                   Disable                        35
  52.                   Run                           116
  53. ................................................................................
  54.  
  55.  
  56.                   Functions                     Page
  57.                   ─────────
  58.  
  59.                   Abs                             1
  60.                   Chr$                           10
  61.                   Datetext                       23
  62.                   Dayofmonth                     24
  63.                   Dayofweek                      25
  64.                   Dayofyear                      26
  65.                   Default                        28
  66.                   Hours                          59
  67.                   If                             60
  68.                   Intext                         68
  69.                   Jointext                       69
  70.                   Lefttext                       70
  71.                   Lengthtext                     71
  72.                   Lookup                         74
  73.                   Lower                          75
  74.                   Makedate                       76
  75.                   Maketime                       77
  76.                   Maths                          79
  77.                   Midtext                        81
  78.                   Minutes                        82
  79.                   Mod                            83
  80.                   Month                          84
  81.                   Proper                        104
  82.                   Random                        105
  83.                   Retail                        111
  84.                   Reverse                       113
  85.                   Righttext                     114
  86.                   Round                         115
  87.                   Seconds                       119
  88.                   Spacepad                      128
  89.                   Spellday                      129
  90.                   Spellmonth                    130
  91.                   Stringof                      132
  92.                   Timeampm                      140
  93.                   Upper                         144
  94.                   V.A.T. Functions              145
  95.                   Year                          147
  96.                   Zeropad                       148
  97.  
  98.  
  99.                   Operators                     Page
  100.                   ─────────
  101.  
  102.                   Arithmetic                     91
  103.                   Logical                        93
  104.                   Relational                     92
  105. ................................................................................
  106.  
  107.  
  108.                   Utilities                     Page
  109.                   ─────────
  110.  
  111.                   Alter Vat Rates                 2
  112.                   Backup Application              4
  113.                   Change Password                 8
  114.                   Data Import                    20
  115.                   Delete Choice Lists            31
  116.                   Install Form                   64
  117.                   Install Printer                65
  118.                   Install Procedure              66
  119.                   List File Names                72
  120.                   Options                        94
  121.                   Pack Data Forms                96
  122.                   Rebuild Directories           107
  123.                   Restore                       110
  124.                   Screen Colours                118
  125.                   Set Paper Length              122
  126.  
  127.  
  128.                   Field Types                   Page
  129.                   ───────────
  130.  
  131.                   Choice                          9
  132.                   Date                           22
  133.                   Fixed Point                    46
  134.                   Floating Point                 47
  135.                   Formatted Text                 54
  136.                   Integer                        67
  137.                   Text                          137
  138.                   Text Block                    138
  139.                   Time                          139
  140.  
  141.  
  142.                   Field Derivation Prefixes     Page
  143.                   ─────────────────────────
  144.  
  145.                   Autodial                        3
  146.                   Current                        16
  147.                   Disable                        34
  148.                   Goto (Field) Next              57
  149.                   Help                           58
  150.                   Retest                        112
  151.                   Start Here                    131
  152. ................................................................................
  153.  
  154.  
  155.                   System Values                 Page
  156.                   ─────────────
  157.  
  158.                   Blank.                          6
  159.                   Bottom Margin                   7
  160.                   Current Record                 17
  161.                   Cur_fld                        19
  162.                   File_date File_time            42
  163.                   File_len                       43
  164.                   File_pos                       44
  165.                   Fun_key                        55
  166.                   Global Number                  56
  167.                   Output                         95
  168.                   Page Number                    97
  169.                   Pi                             99
  170.                   Prog_dir                      103
  171.                   Record Number                 108
  172.                   Sequence                      121
  173.                   System Date                   135
  174.                   System Time                   136
  175.                   Total Copies                  141
  176.                   Total Records                 142
  177.  
  178.  
  179.                   File Commands
  180.                   ─────────────
  181.  
  182.                   Close                          13
  183.                   Erase                          38
  184.                   Find                           45
  185.                   Open                           90
  186.                   Read                          106
  187.                   Seek                          120
  188.                   Shell                         123
  189.                   Write                         146
  190.  
  191.  
  192.                   User Menu Functions           Page
  193.                   ───────────────────
  194.  
  195.                   Menu Calls                     80
  196. ................................................................................
  197.       ABS                        FUNCTION                         ABS
  198.  
  199.       This function returns the absolute (positive) value of a
  200.       number.
  201.  
  202.       Ex. abs(length - breadth)
  203.          This returns 6 if length = 12 and breadth = 6
  204.          or if length = 6 and breadth = 12
  205.  
  206.  
  207.       Acceptable parameters
  208.  
  209.       Numeric value
  210.       Numeric expression
  211.       Numeric field/variable
  212.       Any function which returns a numeric value
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.                                 - 1 -
  253. ................................................................................
  254.       ALTER VAT RATES            UTILITY              ALTER VAT RATES
  255.  
  256.       The five VAT rates used by the VAT functions can be altered
  257.       either from the utilities menu or from a user menu function.
  258.       Just select "Alter VAT rates" - edit the percentages and press
  259.       F2 to save the new values.
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.                                 - 2 -
  310. ................................................................................
  311.       AUTODIAL               DERIVATION PREFIX               AUTODIAL
  312.  
  313.       Easy Base will dial (via a Hayes compatible modem) direct from
  314.       any form or procedure input screen.
  315.  
  316.       To use the Auto dialling facility, all you have to do is place
  317.       the "autodial" keyword in the derivation of the field which
  318.       contains the telephone number. If the field already has a
  319.       derivation then add "autodial" as a prefix.
  320.  
  321.       Ex. Autodial Lookup(customers,phone)
  322.  
  323.       To initiate the call type Ctrl + D.
  324.  
  325.       By default Easy Base uses tone dialling via COM1. If your modem
  326.       is connected to COM2 you can set this up from the Options item
  327.       on the Utilities menu.
  328.  
  329.       If your exchange does not recognize tone dialling then you can
  330.       pulse dial by pressing Ctrl + P.
  331.  
  332.       If you operate from a private exchange and have to wait for an
  333.       outside line after dialling 9 then place a "W" between the 9
  334.       and the rest of the number.
  335.  
  336.  
  337.       Note:-
  338.  
  339.       1.   You can have more than one prefix on any one field
  340.            derivation provided there is a space between each.
  341.  
  342.       2.   The Autodial prefix cannot be tested in derivation test
  343.            mode.
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.                                 - 3 -
  367. ................................................................................
  368.       BACKUP APPLICATION         UTILITY           BACKUP APPLICATION
  369.  
  370.       Easy Base includes an inbuilt Backup system for your
  371.       applications and data.
  372.  
  373.       If you select "Backup Application" from the utilities menu then
  374.       Easy Base will backup your entire application - Choicelist
  375.       fields - Forms - Data and procedures. The backup system will
  376.       split large files across multiple disks automatically.
  377.  
  378.       When an application is finished and you have backup copies then
  379.       backing up choice lists and procedures is wasteful of time and
  380.       floppies. You can backup only the users data by calling "Backup
  381.       Data" from a user menu.
  382.  
  383.       Backup Principles.
  384.  
  385.       The reason for a backup is that in the event of a computer or
  386.       hard disk failure you will have your application or data to
  387.       restore on the new machine.
  388.  
  389.  
  390.       If you have no backup and your machine fails then you have lost
  391.       all your data. If you have only one backup and your machine
  392.       fails while doing a backup then you have lost all your data.
  393.  
  394.       The principle of safe backing up is to keep two sets of backup
  395.       disks in separate boxes marked "Latest" and "Previous".
  396.       Whenever you do a backup you use the disks from the "Previous"
  397.       box - move the disks from the "Latest" to the "Previous" and
  398.       put your new backups in the latest box when completed.
  399.  
  400.       This not only overcomes the problem of a failure during backup
  401.       but also provides a secondary set of disks if any of the
  402.       "Latest" disks turn out to be faulty when you come to restore.
  403.  
  404.       If you ever have to use a backup disk and find that it has
  405.       developed a bad sector then you can attempt a recovery with a
  406.       utility such as "Norton" Disk Test. Easy Base leaves
  407.       approximately 5K of unused disk space on all backup disks so
  408.       that such a utility has somewhere to move bad sectors to.
  409.  
  410.       To save disk space, Easy Base does not backup index files. If
  411.       you ever have to use a backup disk then the index files are
  412.       rebuilt after restoring the data.
  413.  
  414.  
  415.       See Also:-  Restore
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.                                 - 4 -
  424. ................................................................................
  425.       BEEP                     FIELD CONTROL                     BEEP
  426.  
  427.       The "beep" control is used in field derivations to alert the
  428.       user to input errors. In addition to sounding the beeper the
  429.       "beep" control has two optional additional parts - A message to
  430.       be sent to the message line and cursor redirection. This is
  431.       normally to the field in which the error has been made but can
  432.       be to any field.  Field controls are appended to field
  433.       derivations and are enclosed in square brackets.
  434.  
  435.       Ex.  If(partno < 0,blank[beepPart Numbers must not be
  436.       negativeCursor partno],partno)
  437.  
  438.       In this example, if the user enters a negative number in the
  439.       partno field the computer will beep,the number will be cleared
  440.       from the field, the message "Part Numbers must not be negative"
  441.       will be displayed on the message line and the cursor will
  442.       return to the "partno" field.
  443.  
  444.       Ex. If(paid = "no" and chequeno <> blank,paid[beepEither bill
  445.       has been paid or cheque number entered in errorCursor
  446.       paid],paid)
  447.  
  448.       In Easy Base, division by zero is not trapped as an error.
  449.       There is a very good reason for this.  When you start a new
  450.       record and all the fields are blank then any field which
  451.       provides a value for a division in another field would cause a
  452.       division by zero error before its value had been entered.
  453.  
  454.       Whenever Easy Base encounters a division by Zero it divides by
  455.       one instead.  This is perfectly acceptable in most business
  456.       applications.  However, if you need to be warned of a division
  457.       by zero in formulae then you can provide your own error trap
  458.       using the "Beep" control.
  459.  
  460.       Ex.
  461.  
  462.          If( T4 = 0,blank[beepDivision by Zero Value from Field T4],
  463.                       T4)
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.                                 - 5 -
  481. ................................................................................
  482.       BLANK.                   SYSTEM VALUE                    BLANK.
  483.  
  484.       In Easy Base the value of any field which does not contain
  485.       characters is represented by the word "Blank" irrelevant of
  486.       data type.
  487.  
  488.       A numeric field returns the value "Blank" only when the field
  489.       is empty. If it has a value of zero then it is NOT blank.  In
  490.       fact, the main advantage of recognizing "Blank" is that you can
  491.       distinguish between zero value and empty numeric fields.
  492.  
  493.       There is, however, one slight disadvantage.  If a text field
  494.       contains ONLY the word blank and you use its value in a
  495.       derivation then the word "Blank" from the field will disappear.
  496.  
  497.       The "Name" field at the top left hand side of this page is
  498.       derived by the formula Upper(Name).  You will notice that
  499.       "Blank" is followed by a full stop.  If it were not then the
  500.       upper function would return "                    ".
  501.  
  502.       You can also remove a fields contents by setting it equal to
  503.       blank.
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.                                 - 6 -
  538. ................................................................................
  539.       BOTTOM MARGIN            SYSTEM VALUE             BOTTOM MARGIN
  540.  
  541.       Throughout a procedure which has a printed output, Easy base
  542.       keeps track of the length of page remaining (in inches) in the
  543.       system value "Bottom Margin". The Bottom margin value is used
  544.       to control pagination in procedures which "Report" on data.
  545.  
  546.       The "Bottom Margin" value is based on the paper type entered
  547.       from the Utilities Menu. You must set the type of paper you are
  548.       using before using "Bottom Margin".
  549.  
  550.       Ex.
  551.       Line feed: Line feed: Line feed
  552.       For employees
  553.          print list items
  554.          if bottom margin < .5 then
  555.             page feed: line feed :line feed : line feed
  556.          else
  557.             line feed
  558.          end if
  559.       next
  560.  
  561.       In the above example the list items section is printed with a
  562.       blank line between each and with a half inch top and bottom
  563.       page margin.
  564.  
  565.       When you base decisions on the "Bottom margin" value you should
  566.       always do so with a "Greater Than" or "Less Than" operator. If
  567.       you used " If Bottom margin = .5 then Page feed" your page
  568.       would only be ejected if and when the "Bottom Margin" value was
  569.       exactly 0.5  As most printing is done at six lines to the inch
  570.       it is most unlikely that the "Bottom margin" value would ever
  571.       be half an inch.
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.                                 - 7 -
  595. ................................................................................
  596.       CHANGE PASSWORD            UTILITY              CHANGE PASSWORD
  597.  
  598.       You can change your developers access password with this item
  599.       on the utilities menu.
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  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.                                 - 8 -
  652. ................................................................................
  653.       CHOICE                    FIELD TYPE                     CHOICE
  654.  
  655.       If you define a field as the "Choice" type a window will open
  656.       into which you can type up to thirty four different choices.
  657.       When you have entered your choices you will be asked to give a
  658.       name to your choice list. Once a choice list has been saved it
  659.       can be used in any other choice field in any other form or
  660.       input screen.
  661.  
  662.       Once a choice list has been saved you can edit the contents but
  663.       not the field length. Editing a choice list in one form
  664.       automatically edits it for any other form.
  665.  
  666.       If you need to alter a list such that the field length will
  667.       change then you must create a new list. You can erase the old
  668.       one from the utilities menu.  If the list is used in more than
  669.       one form then you must redefine it in all the other forms in
  670.       which it is used
  671.  
  672.       When the cursor enters a choice field your choice list will be
  673.       displayed for the user to choose from. He cannot enter any
  674.       value other than one from the list.
  675.  
  676.       When the cursor enters a choice field that is blank, the list
  677.       will pop up for the user to choose from. If there are more than
  678.       nine choices on the list then only the first nine will display
  679.       automatically. For up to nine choices the user can pick one by
  680.       pressing the number of the choice or leave the field blank by
  681.       simply moving the cursor. If there are more than nine choices
  682.       then the entire list can be displayed by pressing the space
  683.       bar. When a list of more than nine is displayed the user must
  684.       select a choice or press the Escape key.
  685.  
  686.       When the cursor re enters a choice field in which a choice has
  687.       already been made the same events occur except that in the case
  688.       of a two choice list the two choices are toggled on the space
  689.       bar without actually being displayed.
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.                                 - 9 -
  709. ................................................................................
  710.       CHR$                       FUNCTION                        CHR$
  711.  
  712.       The Chr$ function returns the character whose ASCII number is
  713.       supplied as the parameter.
  714.  
  715.       Ex.   Chr$(171)
  716.             < Returns "½">
  717.  
  718.       Ex.   Jointext(Chr$(227),"r",Chr$(253))
  719.             < Returns "πr²"
  720.  
  721.       In Easy Base, text fields are automatically justified left.
  722.       This is desirable in record entry as it prevents the user from
  723.       entering leading spaces in indexed fields and consequently
  724.       trashing alphabetic printouts. However, you may wish to right
  725.       justify or centre justify text in printouts. For example, the
  726.       righthand "Chr$" at the top of this page is right justified in
  727.       its field. You can use the ASCII character 255 to achieve right
  728.       or centre justification.
  729.  
  730.       Ex.
  731.  
  732.       Heading = jointext(stringof((30-lengthtext(name))/2,Chr$(255)),
  733.       name)
  734.           < This centres name in the 30 character field "heading">
  735.  
  736.       Ex.
  737.  
  738.       Heading =Jointext(stringof(40-lengthtext(name),Chr$(255)),name)
  739.  
  740.          < This right justifies name in a 40 character field
  741.            "Heading">
  742.  
  743.  
  744.       CAUTION:
  745.  
  746.       You can produce any ASCII character ( 0 - 255 ) with the Chr$
  747.       function. ASCII characters 0 to 31 are used as printer controls
  748.       and although you can use them freely on screen you should never
  749.       include them in a procedure output which will be sent to the
  750.       printer.
  751.  
  752.       The ASCII character 127 is used internally by Easy Base to
  753.       replace quotation marks within quoted text. It should not be
  754.       used for any other purpose.
  755.  
  756.       Acceptable parameters:
  757.  
  758.       Numeric value, field, variable, expression or function
  759.       returning a number between 0 and 255
  760.  
  761.  
  762.  
  763.  
  764.  
  765.                                 - 10 -
  766. ................................................................................
  767.       CLEAR RECORDS FROM     PROCEDURE COMMAND     CLEAR RECORDS FROM
  768.  
  769.       The "Clear Records From" command clears all records from a form
  770.       by erasing its data and index files. If you need to erase all
  771.       records form a form always use the "Clear Records" command
  772.       rather than "Delete Record" command. It is much faster and does
  773.       not require the form to be re-packed afterward.
  774.  
  775.       Ex.
  776.  
  777.       If input.confirm = "yes" then clear records from invoices
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.                                 - 11 -
  823. ................................................................................
  824.       CLEARFIELDS              FIELD CONTROL              CLEARFIELDS
  825.  
  826.       The "Clearfields" control blanks out all other fields on a form
  827.       or procedure input screen whenever the field containing the
  828.       control is changed.
  829.  
  830.       The primary use for the "Clearfields" control is to force
  831.       default lookups to re-derive for procedures which edit data.
  832.  
  833.       For Example - If you wrote a procedure to alter customers
  834.       addresses and telephone numbers then you would have three
  835.       fields on the input screen.
  836.  
  837.       Accountno   derived   lookup(customers,accountno)
  838.  
  839.       address     derived   default(lookup(customers,address))
  840.  
  841.       Tel         derived   default(lookup(customers,tel))
  842.  
  843.       When you enter a customers account number, his old address and
  844.       telephone number will be looked up, but the "Default" function
  845.       will allow you to edit them. The procedure code would then
  846.       update the record with the new address and phone number.
  847.  
  848.       The problem is, that having entered an account number and
  849.       looked up the other fields, if you then realize you have
  850.       entered the wrong account number and change it, the other
  851.       fields will not re-derive because they now have a default
  852.       value.  To get them to lookup based on the new account number
  853.       you would have to take the cursor to each field and clear it
  854.       with the F6 key.
  855.  
  856.       you can automate this process by adding the "Clearfields"
  857.       control to the accountno derivation:-
  858.  
  859.       lookup(customers,accountno)[clearfields]
  860.  
  861.  
  862.       Note:  The "Clearfields" control will only work when appended
  863.       to a derivation which is already dependent on the value of the
  864.       field. If you want to clear fields based on a change to a field
  865.       which has no other derivation then you must derive the field
  866.       with its own name plus the "Clearfields" control.
  867.  
  868.       In a field "Number" the derivation - Number[clearfields] - will
  869.       clear all other fields when the "Number" field is edited but
  870.       the derivation [clearfields] will have no effect.
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.                                 - 12 -
  880. ................................................................................
  881.       Close                    File Command                     Close
  882.  
  883.       The "Close" command closes a non Easy Base file which has been
  884.       opened with the "Open" command.
  885.  
  886.       If a procedure only opens a single external file then the close
  887.       command can be ommitted, but if several files are opened within
  888.       a procedure then each must be closed before the next is opened.
  889.       You can only have one external file open at any one time.
  890.  
  891.       ....................
  892.       declare output fields
  893.          Files : Path
  894.       end
  895.       declare variables
  896.         Ln as text
  897.       end
  898.       Open  "C:\CONFIG.SYS"
  899.       do
  900.          Read line to Ln
  901.          if lefttext(Ln,6) = "files=" then exit do
  902.       Loop
  903.       Files = Ln
  904.       Close
  905.       Open "C:\AUTOEXEC.BAT"
  906.       Do
  907.          read line to Ln
  908.          if Lefttext(Ln,4) = "path" then exit do
  909.       Loop
  910.       Close
  911.       Path = Ln
  912.       Print List Items
  913.  
  914.  
  915.       See also: Open, Seek, Read, Write, Find, Erase
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.                                 - 13 -
  937. ................................................................................
  938.       COPY ALL FROM          PROCEDURE COMMAND          COPY ALL FROM
  939.  
  940.       When you are transferring values from the fields of one form to
  941.       the fields of another in preparation for a "New Record" or
  942.       "Update Record"  you can use "Copy All From" to save time.
  943.  
  944.       Ex.
  945.  
  946.       for invoiceitems new record
  947.          invoiceitems.item = input.item
  948.          invoiceitems.price = input.price
  949.          invoiceitems.quantity = input.quantity
  950.          invoiceitems.vatrate = input.vatrate
  951.       next
  952.  
  953.       can be replaced with:-
  954.  
  955.       for invoiceitems new record
  956.          copy all from input
  957.       next
  958.  
  959.       The data transfer in a "Copy All From" is based on the source
  960.       and destination fields having the same name.
  961.  
  962.       If the source and destination fields have different data types
  963.       Easy Base will attempt a conversion.
  964.  
  965.       The conversion will succeed between different numeric types and
  966.       from numeric to text. It will fail from text to numeric and
  967.       between any mismatch of date and time.
  968.  
  969.  
  970.  
  971.  
  972.       See also:-  Derive Off, Duplicate Prevention
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.                                 - 14 -
  994. ................................................................................
  995.       CREATE TEMP AS         PROCEDURE COMMAND         CREATE TEMP AS
  996.  
  997.       The "Create Temp As" command makes a temporary form during a
  998.       procedure. There are two main uses for the temporary form.
  999.  
  1000.       1.  To physically sort the records in a form.
  1001.  
  1002.       Ex.
  1003.  
  1004.       create temp as addresses
  1005.       index off:pause off:escape off:derive off
  1006.       for addresses with surname in order
  1007.          for temp new record
  1008.             copy all from addresses
  1009.          next
  1010.       next
  1011.       rename temp as addresses
  1012.  
  1013.       The other main use for the temporary file is to save time when
  1014.       the majority of records in a form are to be deleted.
  1015.  
  1016.       Ex.
  1017.       A purchases ledger form is to be cleared down at the year end
  1018.       but any unreconciled payment entries are to be retained and
  1019.       flagged as last years. If there were 15000 records in the form
  1020.       of which only 50 were unreconciled then the procedure
  1021.  
  1022.       for purchases
  1023.          if purchases.reconciled = "yes" then
  1024.             delete record
  1025.          else
  1026.             purchases.lastyear = "yes"
  1027.             update record
  1028.          end if
  1029.       next
  1030.  
  1031.       would not only take a very long time to run but would leave the
  1032.       form full of deleted records and it would have to be re-packed.
  1033.  
  1034.       The same result can be achieved very quickly and without the
  1035.       need to re-pack with the following procedure.
  1036.  
  1037.       create temp as purchases
  1038.       for purchases with reconciled = "no"
  1039.          for temp new record
  1040.             copy all from purchases
  1041.             temp.lastyear = "yes"
  1042.          next
  1043.       next
  1044.       rename temp as purchases
  1045.  
  1046.       Do not use the "Clear Records" command to wipe the old file
  1047.       before using "Rename Temp As".  If you suffered a power failure
  1048.       after clearing and before renaming you would lose your data.
  1049.  
  1050.                                 - 15 -
  1051. ................................................................................
  1052.       CURRENT                DERIVATION PREFIX                CURRENT
  1053.  
  1054.       In Easy Base, fields are not normally derived when a previously
  1055.       entered record is viewed on screen. You can force a field to be
  1056.       rederived when viewed by prefixing the derivation with
  1057.       "current".
  1058.  
  1059.       Ex.  An invoice form has three fields Ivdate,Cdate and age.
  1060.  
  1061.       Ivdate is derived as   "system date"
  1062.       Cdate is derived as    "current system date"
  1063.       age is derived as      jointext(Cdate-Ivdate," Days old")
  1064.  
  1065.       Each time a record is viewed the Cdate field is rederived with
  1066.       the current system date and the age field shows the number of
  1067.       days since the record was filed.
  1068.  
  1069.       Ex.
  1070.  
  1071.       A form is used to price a certain job. It consists of fields
  1072.       for materials and their prices which are looked up from a
  1073.       "stock" form. If the primary lookup fields are prefixed with
  1074.       "current"   -  "current lookup(stock,item)"
  1075.  
  1076.       then each time a record is viewed it will reprice the job using
  1077.       the latest prices from the "stock" file.
  1078.  
  1079.       Please note that in the case of lookups, prefixing a secondary
  1080.       lookup has no effect. In the above example
  1081.  
  1082.         "current lookup(stock,price)"  would not work
  1083.  
  1084.       Provided that the primary lookup field is prefixed with
  1085.       "current" then any secondary lookups will also be rederived.
  1086.  
  1087.  
  1088.       The values of "Current" fields are also rederived whenever they
  1089.       are accessed in procedure code but they are NOT REDERIVED when
  1090.       they are accessed by a Lookup function.
  1091.  
  1092.  
  1093.       1. You can have more than one prefix on any one field
  1094.          derivation provided there is a space between each.
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.                                 - 16 -
  1108. ................................................................................
  1109.       CURRENT RECORD           SYSTEM VALUE            CURRENT RECORD
  1110.  
  1111.       Whenever a procedure is processing a "FOR" loop the number of
  1112.       the record being processed is available in the "Current Record"
  1113.       system value. The "Current Record" value is the records actual
  1114.       number in the form, not the number of records processed.
  1115.  
  1116.       Ex.
  1117.  
  1118.       for books with category = "fiction"
  1119.          count = count + 1
  1120.          Posn = current record
  1121.       next
  1122.  
  1123.       If the first book found with the category "fiction" is the
  1124.       fifteenth record in the file then count will return 1 and
  1125.       Posn will return 15.
  1126.  
  1127.  
  1128.       The "Current Record" value has no meaning in field derivations.
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.                                 - 17 -
  1165. ................................................................................
  1166.       Cursor                   FIELD CONTROL                   Cursor
  1167.  
  1168.       The field control "Cursor" sends the cursor to the named field.
  1169.  
  1170.       if(condition,fieldname[cursor fieldname2],fieldname)
  1171.  
  1172.       The cursor control can also be embedded in the beep control.
  1173.  
  1174.       See also "Beep"
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.                                 - 18 -
  1222. ................................................................................
  1223.       Cur_Fld                  SYSTEM VALUE                   Cur_Fld
  1224.  
  1225.       The System value Cur_Fld holds the number of the field which
  1226.       the cursor is in.
  1227.  
  1228.       The Cur_Fld value can be used in form and input screen
  1229.       derivations to create pop up prompt fields or to change
  1230.       additional help fields.
  1231.  
  1232.       if(Cur_Fld > 2,"Enter the price",blank)
  1233.  
  1234.       If(Cur_Fld < 7,"Help for first six fields",Help for later
  1235.       fields")
  1236.  
  1237.       The Cur_Fld value can also be used to delay lookups when a
  1238.       screen first loads.
  1239.  
  1240.       if(Cur_Fld < 5,blank,lookup(customers,name))
  1241.  
  1242.       In the case of input screens the value is also carried forward
  1243.       to the procedure code so you can tell which field the cursor
  1244.       was in when the procedure was run.
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.                                 - 19 -
  1279. ................................................................................
  1280.       Data Import                UTILITY                  Data Import
  1281.  
  1282.       There are four Data Import routines in Easy Base. The first
  1283.       imports data from files which conform to the Xbase standard
  1284.       first introduced by Dbase. The second imports data from "Comma
  1285.       Delimited" files. This is the standard used by most sequencial
  1286.       access and non relational data systems. The third routine
  1287.       imports data from fixed length record text files. This is the
  1288.       format which is used by all systems to output data. You can
  1289.       therefore import data from virtually any other system by first
  1290.       reporting on it to a disk file and then importing it with the
  1291.       fixed length ASCII import routine. The fourth routine imports
  1292.       one ASCII line per field.
  1293.  
  1294.       XBASE
  1295.  
  1296.       If the data you wish to import is in Xbase format, Easy Base
  1297.       will report the structure of the file. You can print this out
  1298.       by pressing F10. You now design a form to hold the imported
  1299.       data. The names that you give to the Easy Base fields do not
  1300.       have to be the same as the Xbase field names but they must be
  1301.       in the same order. If the Xbase fields are text then the Easy
  1302.       Base fields must be the same length. If the Xbase fields are
  1303.       numeric then the Easy Base fields must be numeric. It does not
  1304.       matter if they are different lengths and any of the three
  1305.       types, integer, fixed point or floating point can be used.
  1306.       If an Xbase field is a date field then it must be imported to
  1307.       an eight character text field in Easy Base. You can reformat it
  1308.       to an Easy Base date field after importation (See the Method -
  1309.       Data Type Conversion).  Easy Base does not support "Memo" data.
  1310.       If the Xbase file has a memo field you can still import from it
  1311.       but the memo field itself will be skipped by the import
  1312.       routine.
  1313.  
  1314.       COMMA DELIMITED
  1315.  
  1316.       To import data from comma delimited files all you have to do is
  1317.       design a form with the same number of fields as there are in
  1318.       the file to be imported. Numeric fields can be any of the three
  1319.       types and text fields should be long enough to hold the longest
  1320.       data expected in the incoming field. If any of the fields to be
  1321.       imported holds a date then it must be imported to a text field.
  1322.       You can convert it to a date later.
  1323.  
  1324.       FIXED LENGTH ASCII
  1325.  
  1326.       To import data from fixed length ASCII files you must design a
  1327.       form in which all fields are text and are exactly the same
  1328.       length and in the same order as the fields in the file to be
  1329.       imported. If the file to be imported has a header you can allow
  1330.       for this by entering the header length in bytes.
  1331.  
  1332.       If you are using the fixed length import routine to import data
  1333.       which you have output as a report from another system then
  1334.  
  1335.                                 - 20 -
  1336. ................................................................................
  1337.       Data Import                UTILITY                  Data Import
  1338.  
  1339.       please note the following points.
  1340.  
  1341.       The output report from the original system should have no
  1342.       headers, footers or left margin and there should be no spaces
  1343.       between fields.
  1344.  
  1345.       When the original system outputs the data it will add a
  1346.       carriage return and line feed sequence to the end of each
  1347.       record. When you design the form to import this data to, you
  1348.       must have a final two character text field to trap this
  1349.       sequence and maintain the same record length.  This field can
  1350.       be deleted after importation.
  1351.  
  1352.       All fields are imported as text. If any of them contain numeric
  1353.       values which you wish to convert to numeric fields you must do
  1354.       this after importation. (See Method Data Type Conversion)
  1355.  
  1356.       ASCII LINE
  1357.  
  1358.       The ASCII line import routine imports one line per field from
  1359.       an ASCII text file. If you have one field on the form to which
  1360.       you import then you will have one line per record. If you have
  1361.       two fields on the form to which you import then you will have
  1362.       two lines per record Etc.
  1363.  
  1364.       The import routines are for loading entire data files into Easy
  1365.       Base. For Flexible import and export to any part of any file
  1366.       see the External File Commands documentation.
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.                                 - 21 -
  1393. ................................................................................
  1394.       DATE                      FIELD TYPE                       DATE
  1395.  
  1396.       Date fields hold dates in the eight character format 11/11/94
  1397.  
  1398.       The assumed century runs from the first of January 1981 to the
  1399.       31st of december 2080.
  1400.  
  1401.       You can select whether you wish your dates to be displayed as
  1402.       day/month/year (European) or month/day/year (North American)
  1403.       from the "options" item on the utilities menu.
  1404.  
  1405.       You can perform addition and subtraction operations on date
  1406.       values in days.
  1407.  
  1408.       Ex.  System date + 30
  1409.  
  1410.       Arithmetic operations are only correct for the assumed century.
  1411.  
  1412.       Date fields are automatically checked for validity by the
  1413.       system.
  1414.  
  1415.       Easy base does not provide a ready made ten character date
  1416.       field but you can define one with the "Formatted Text" field
  1417.       type.
  1418.  
  1419.  
  1420.       See Also:-   Makedate
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.                                 - 22 -
  1450. ................................................................................
  1451.       DATETEXT                   FUNCTION                    DATETEXT
  1452.  
  1453.       This function returns the date parameter in the form:-
  1454.  
  1455.       14th October 1994  or
  1456.       October 14th 1994  depending on the date format selected in
  1457.                          the utilities menu.
  1458.  
  1459.  
  1460.       Ex.    datetext(system date)
  1461.  
  1462.       Ex.    datetext(invoicedate + 30)
  1463.  
  1464.       Acceptable parameters:
  1465.  
  1466.       System date
  1467.       Date field
  1468.       Makedate function
  1469.       Date expression
  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.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.                                 - 23 -
  1507. ................................................................................
  1508.       DAYOFMONTH                 FUNCTION                  DAYOFMONTH
  1509.  
  1510.       This function returns the day no.(1-31) of the date parameter.
  1511.  
  1512.       Ex. dayofmonth(system date)
  1513.  
  1514.       Ex  dayofmonth(registered)
  1515.  
  1516.       Ex.
  1517.  
  1518.       if dayofmonth(system date) = 28 then
  1519.          for statements with settled = "No"
  1520.             statements.overdue = "Yes"
  1521.             update record
  1522.          next
  1523.       end if
  1524.  
  1525.       Acceptable parameters:
  1526.  
  1527.       System date
  1528.       Date field
  1529.       Makedate function
  1530.       Date expression
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.                                 - 24 -
  1564. ................................................................................
  1565.       DAYOFWEEK                  FUNCTION                   DAYOFWEEK
  1566.  
  1567.       This function returns the day no.(1-7) of the date parameter.
  1568.  
  1569.       Ex.  dayofweek(system date)
  1570.  
  1571.       Ex.  day = spellday(dayofweek(diary.date))
  1572.  
  1573.       Ex.  The following procedure, if called from a batch execute
  1574.       menu will only run on a Monday.
  1575.  
  1576.       declare output fields
  1577.          takings.date
  1578.          takings.dailytotal
  1579.       end
  1580.       if dayofweek(system date) = 1 then
  1581.          for takings with date in reverse order
  1582.             print list items
  1583.             if system date - takings.date > 7 then exit for
  1584.          next
  1585.       end if
  1586.  
  1587.       Acceptable parameters:
  1588.  
  1589.       System date
  1590.       Date field
  1591.       Makedate function
  1592.       Date expression
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.                                 - 25 -
  1621. ................................................................................
  1622.       DAYOFYEAR                  FUNCTION                   DAYOFYEAR
  1623.  
  1624.       This function returns the day no.(1-365) of the date parameter.
  1625.  
  1626.       Ex.   dayofyear(system date)
  1627.  
  1628.       Ex.   days = dayofyear(events.date)
  1629.  
  1630.       Acceptable parameters:
  1631.  
  1632.       System date
  1633.       Date field
  1634.       Makedate function
  1635.       Date expression
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.                                 - 26 -
  1678. ................................................................................
  1679.       DECLARE                PROCEDURE COMMAND                DECLARE
  1680.  
  1681.       If you write a procedure which outputs information to the
  1682.       screen, printer or a disk file you must start it by declaring
  1683.       the output fields.
  1684.  
  1685.       Ex.
  1686.       Declare output fields
  1687.          Input.name
  1688.          Customers.name:customers.address:customers.acno
  1689.          countofinvoices
  1690.       end
  1691.  
  1692.       If fields you intend to print exist in a form then declare them
  1693.       as Formname.Fieldname.  Fields from the procedures Input Screen
  1694.       are declared as Input.fieldname. Easy Base will then use the
  1695.       field definitions from the form as defaults when you create the
  1696.       Output Format for the procedure.
  1697.  
  1698.       If a field which you intend to print is to be derived during
  1699.       the procedure and does not exist in a form as "countofinvoices"
  1700.       you can give it any name you wish up to forty characters but
  1701.       the name must not contain a ".". Once you have declared fields
  1702.       you can create the Output Format.
  1703.  
  1704.       If you declare an "Ad Hoc" field such as "countovinvoices" then
  1705.       you must include it in the format in order to define its type
  1706.       and length.
  1707.  
  1708.       If you require variables to store values during a procedure but
  1709.       you will not be out-putting their values then declare them as
  1710.       variables not fields.
  1711.  
  1712.       Ex.
  1713.  
  1714.       declare variables
  1715.          count as number
  1716.          lasttype as text
  1717.       end
  1718.  
  1719.       Unprinted variables can only have one of the two types "Number"
  1720.       or "Text".
  1721.  
  1722.       Field declarations must precede Variable declarations and both
  1723.       must precede executable code.
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.                                 - 27 -
  1735. ................................................................................
  1736.       DEFAULT                    FUNCTION                     DEFAULT
  1737.  
  1738.       This function returns the parameter if not overridden by user
  1739.       entry.
  1740.  
  1741.  
  1742.       Ex.    Default(5)
  1743.  
  1744.       Ex.    Default(system date)
  1745.  
  1746.       Ex.    Default(lookup(stock,price))
  1747.  
  1748.       The Default function is only used in form and input screen
  1749.       field derivations - It has no meaning in procedure code.
  1750.  
  1751.       Acceptable parameters
  1752.  
  1753.       Any value, expression, field, variable or nested function of
  1754.       the same type as the field in which it is used.
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.                                 - 28 -
  1792. ................................................................................
  1793.       DELAY                    FIELD CONTROL                    DELAY
  1794.  
  1795.       The "delay" control suspends processing for a given number of
  1796.       milliseconds.
  1797.  
  1798.       Ex.
  1799.  
  1800.       A procedure screen is used from a startup Batch execute menu as
  1801.       an opening screen to an application and has the following field
  1802.       derivations
  1803.  
  1804.       1.  "Welcome to this wonderful program" [delay 1000]
  1805.  
  1806.       2.  "Copyright Fred blogs"[delay 1000]
  1807.  
  1808.       3.  "Press F2 to start"
  1809.  
  1810.       If the field colours are "text" ,"alt1" or "alt2" then the
  1811.       three fields will "Popup" with a one second delay between each.
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.                                 - 29 -
  1849. ................................................................................
  1850.       DELAY                  PROCEDURE COMMAND                  DELAY
  1851.  
  1852.       The "Delay" command suspends processing for a given number of
  1853.       milliseconds (1 - 5000).
  1854.  
  1855.       Ex.
  1856.  
  1857.       declare variables
  1858.          x as number : total as number
  1859.       end
  1860.       for customers
  1861.          customers.balance = 0
  1862.          for invoices with acno = customers.acno
  1863.             display status "Totalling invoices for" + Customers.name
  1864.             delay 200
  1865.             customers.balance = customers.balance + invoices.total
  1866.          next
  1867.          update record
  1868.       next
  1869.  
  1870.       In the above example, wherever a customer only has one or two
  1871.       invoices to total, the status display would change very
  1872.       quickly.  By including a 200 millisecond delay you can ensure
  1873.       that each customers name is on screen at least long enough to
  1874.       be read.
  1875.  
  1876.       Delay values outside of 1 - 5000 are ignored.
  1877.       The delay parameter cannot be supplied as a variable.
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.                                 - 30 -
  1906. ................................................................................
  1907.       DELETE CHOICE LISTS        UTILITY          DELETE CHOICE LISTS
  1908.  
  1909.       If you have Choice lists for choice fields that are no longer
  1910.       required you can delete them with this utility.
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.                                 - 31 -
  1963. ................................................................................
  1964.       DELETE RECORD          PROCEDURE COMMAND          DELETE RECORD
  1965.  
  1966.       The "Delete Record" command is used for the selective deletion
  1967.       of records in a form.
  1968.  
  1969.       Ex.
  1970.  
  1971.       for books with title = input.title
  1972.          delete record
  1973.       next
  1974.  
  1975.       This deletes the single book whose title is that entered on the
  1976.       input screen.
  1977.  
  1978.       for books with author = input.author
  1979.          delete record
  1980.       next
  1981.  
  1982.       This deletes the records of all books by the author entered on
  1983.       the input screen.
  1984.  
  1985.       When you use the "Delete Record" command it has the same effect
  1986.       as deleting a record in data entry. In other words the record
  1987.       is marked for deletion but will not actually be removed from
  1988.       the form until the next re-pack.
  1989.  
  1990.       If you use the "Delete Record" command to delete large numbers
  1991.       of records then you should pack the form afterward.
  1992.  
  1993.       If you wish to delete all records in a form use the "Clear
  1994.       records" command not the "Delete Record" command.
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.                                 - 32 -
  2020. ................................................................................
  2021.       DERIVE OFF             PROCEDURE COMMAND             DERIVE OFF
  2022.  
  2023.       Whenever an Easy Base procedure adds or updates a record then
  2024.       by default it checks the derivations of all fields during an
  2025.       add operation and any fields that are affected by an update
  2026.       operation. In other words, if you update the netprice field in
  2027.       a stock form and that form has derived fields for VAT and
  2028.       grossprice then those fields will also be updated.
  2029.  
  2030.       If the procedure adds or updates all fields then this process
  2031.       is superfluous and simply slows the procedure. You can disable
  2032.       form derivation checking with the "Derive Off" command.
  2033.  
  2034.       derive off
  2035.       for stock with item = input.item
  2036.          copy all from input
  2037.          update record
  2038.       next
  2039.  
  2040.       In the above example a stock form has several derived fields
  2041.       but the input screen also does the same derivations. There is
  2042.       therefore no need to re-check them when the record is updated.
  2043.  
  2044.       As a general rule, in procedures which add or update records
  2045.       from an input screen, you should derive all fields on the input
  2046.       screen rather than during the update process. The user will not
  2047.       notice the time taken to derive fields while he is filling them
  2048.       in but he will notice the time taken to derive them after he
  2049.       has pressed F2
  2050.  
  2051.       There is no corresponding "Derive On" command. Derivation
  2052.       checking is automatically turned back on at the end of the
  2053.       loop to which is prefixed by the "Derive Off" command. If you
  2054.       require derivation checking to be off for more than one loop in
  2055.       a procedure then you must issue the command before each loop.
  2056.  
  2057.  
  2058.       Note:-
  2059.  
  2060.       If the "Derive Off" command is not issued before a loop then
  2061.       form level derivations override procedure derivations. This is
  2062.       not normally a problem, but can be if you try to change the
  2063.       case of a field for printing.
  2064.  
  2065.       For customers
  2066.          customers.name = proper(customers.name)
  2067.          print list items
  2068.       next
  2069.  
  2070.       If the "Name" field on the "Customers" form is derived as
  2071.       Upper(name) then the procedure will print the customers names
  2072.       in upper case.  You can overcome the problem either by
  2073.       cancelling the field derivation or by transferring the
  2074.       customers name to a variable and converting that to proper.
  2075.  
  2076.                                 - 33 -
  2077. ................................................................................
  2078.       Disable                DERIVATION PREFIX                Disable
  2079.  
  2080.       When an Easy Base procedure has an input screen it can be run
  2081.       by pressing any of the function keys 2,4,5,7,8,9 or 10.
  2082.  
  2083.       Where a procedure only does one job, the fact that all keys
  2084.       will initiate it is not important. The default help line states
  2085.       F2 and you can replace this if you want the user to use
  2086.       another.
  2087.  
  2088.       If however you wish to disable function keys which your
  2089.       procedure does not use you can do so by adding the prefix
  2090.       "Disable" followed by the keys you wish to deactivate in
  2091.       quotation marks. You can also disable the Escape Key.
  2092.  
  2093.       Ex.
  2094.  
  2095.       Disable "5789"
  2096.  
  2097.       It does not matter which field you use the "Disable" prefix in
  2098.       and if the field already has a derivation formula it can
  2099.       follow.
  2100.  
  2101.       Disable "4578910Esc" lookup(units,price)
  2102.  
  2103.       In the above example the only active function key is F2 and the
  2104.       user cannot Escape to the menu. The procedure must be run.
  2105.  
  2106.       Disabling the Escape key is useful where a procedure is part of
  2107.       a chain, ie it is run by the run command from a main procedure
  2108.       or it is on a batch menu. You should be careful not to disable
  2109.       the Escape key on procedures that are stand alone with
  2110.       repeating input screens or on main procedures which run other
  2111.       procedures which in turn run the main procedure.
  2112.  
  2113.       Notes:
  2114.  
  2115.       1.  The Disable prefix has no meaning in data entry forms.
  2116.  
  2117.       2.  There must be a space between "Disable" and the key string.
  2118.           The key string must be in quotation marks.
  2119.  
  2120.       3.  You can combine prefixes in any field derivation provided
  2121.           there is a space between them
  2122.  
  2123.       Ex.
  2124.  
  2125.       Disable "4578910" Help "Press F2 when ready" Start Here
  2126.  
  2127.  
  2128.       See also: "Run" "Fun_Key" "Dissable Control"
  2129.  
  2130.  
  2131.  
  2132.  
  2133.                                 - 34 -
  2134. ................................................................................
  2135.       Disable                  FIELD CONTROL                  Disable
  2136.  
  2137.       The Disable control is used to change the disabled function
  2138.       keys from within field derivations in a procedure's input
  2139.       screen.
  2140.  
  2141.       Ex.
  2142.  
  2143.       if(actn = "new",actn[disable "4578910"],actn[disable "2"])
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.                                 - 35 -
  2191. ................................................................................
  2192.       DISPLAY STATUS         PROCEDURE COMMAND         DISPLAY STATUS
  2193.  
  2194.       If you write a procedure which has no output then Easy Base
  2195.       will display a "Running" flash at the top right hand side of
  2196.       the screen. For procedures which only take a few seconds to run
  2197.       this is sufficient to let the operator know that something is
  2198.       happening. For procedures that take some time to complete you
  2199.       should include a status display showing the progress of the
  2200.       procedure. A status display not only allays the nagging
  2201.       suspicion that the system has hung up but also allows the
  2202.       operator to estimate how long it will take.
  2203.  
  2204.       To create a status display just issue the command "Display
  2205.       Status" followed by a message composed of text in quotation
  2206.       marks and fields or variables concatenated by the + sign.
  2207.  
  2208.       Ex.
  2209.  
  2210.  
  2211.       declare variables
  2212.          x as number : y as number
  2213.       end
  2214.       for employees with taxcode = input.oldtaxcode
  2215.          y = total copies :exit for    'get copies to y for display
  2216.       next
  2217.       for employees with taxcode = input.oldtaxcode
  2218.          x = x + 1
  2219.          display status "Updating Record" + x + "of" + y
  2220.          employees.taxcode = input.newtaxcode
  2221.          update record
  2222.       next
  2223.  
  2224.       The status line is displayed centrally in a small window when
  2225.       the procedure runs. A Status line can have a maximum of 68
  2226.       characters. If you create a status line of more than 68
  2227.       characters then it will be cut short to that length.
  2228.  
  2229.       If you need to display counters in two nested loops then write
  2230.       the full display line in the outer loop and "display status"
  2231.       with no parameters in the inner loop.
  2232.  
  2233.       for customers
  2234.          x = x + 1
  2235.          - loop statements -
  2236.          display status "Checking Invoice" + y + "of customer" + x
  2237.          for invoices with customer = customers.name
  2238.             y = y + 1
  2239.             - Loop Statements -
  2240.             display status
  2241.          next
  2242.       next
  2243.  
  2244.  
  2245.  
  2246.  
  2247.                                 - 36 -
  2248. ................................................................................
  2249.       DO..LOOP               PROCEDURE COMMAND               DO..LOOP
  2250.  
  2251.       The "Do" loop structure is used in the Easy Base Procedure code
  2252.       to repeat a series of commands or statements. Whenever a
  2253.       procedure reaches a "Do" command it repeats all the statements
  2254.       between the "Do" and the "Loop" statements until the loop is
  2255.       broken by an "Exit Do" command.
  2256.  
  2257.       Ex.
  2258.  
  2259.       The following code fragment prints 10 copies of the top fifty
  2260.       best selling items in a "stock" form.
  2261.  
  2262.  
  2263.       .........................code............................
  2264.       declare output fields
  2265.          stock.item : stock.sales : today
  2266.       end
  2267.       Declare variables
  2268.          copies as number : items as number
  2269.       end
  2270.       today = system date
  2271.       do
  2272.          copies = copies + 1 :items = 0
  2273.          if copies = 11 then exit do
  2274.          bold on
  2275.          print report header
  2276.          bold off
  2277.          for stock with sales in reverse order
  2278.             items = items + 1
  2279.             if items = 51 then exit for
  2280.             print list items
  2281.          next
  2282.          bold on : print report footer : bold off
  2283.          page feed
  2284.       loop
  2285.       ............................format.....................
  2286.       .Report Header
  2287.          ═════════════════════════════════════════════════════
  2288.          Top 50 Best Selling Items               {today field}
  2289.          ═════════════════════════════════════════════════════
  2290.       .list items
  2291.             {stock.item field}        {stock.sales field}
  2292.       .Report Footer
  2293.          ═════════════════════════════════════════════════════
  2294.       .end
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.                                 - 37 -
  2305. ................................................................................
  2306.       Erase                    File Command                     Erase
  2307.  
  2308.       The "Erase" command erases files. It accepts wildcard
  2309.       parameters.
  2310.  
  2311.       ex.
  2312.  
  2313.       Erase "C:\letters\*.doc"
  2314.  
  2315.       Ex.
  2316.  
  2317.       index off
  2318.       For faxlog with date < system date - 30
  2319.          erase jointext("C:\Fax\",faxlog.filename)
  2320.          delete record
  2321.       next
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.                                 - 38 -
  2362. ................................................................................
  2363.       ESCAPE ON/OFF          PROCEDURE COMMAND          ESCAPE ON/OFF
  2364.  
  2365.       When a procedure is running in Easy Base, it cannot, by
  2366.       default, be interrupted. If your procedure simply lists data to
  2367.       the screen then the end user may not need to see the entire
  2368.       output. You can allow the user to terminate a procedure
  2369.       prematurely with the "Escape On" command.
  2370.  
  2371.       If a procedure performs several tasks, you can selectively
  2372.       enable and disable the Escape Key with the commands "Escape On"
  2373.       and "Escape" Off"
  2374.  
  2375.       Ex.
  2376.  
  2377.       For newpayscales
  2378.          print list items
  2379.       next
  2380.       escape off
  2381.       for newpayscales
  2382.          for employees with scale = newpayscales.scale
  2383.             employees.rate = newpayscales.rate
  2384.             update record
  2385.          next
  2386.       next
  2387.       escape on
  2388.       for employees
  2389.          print newpay
  2390.       next
  2391.  
  2392.       In the above example a procedure lists new pay scales, updates
  2393.       the "Employees" form with the new pay rate and then lists the
  2394.       employees with their new rates.
  2395.  
  2396.       While the procedure is running the operator can terminate it
  2397.       during either of the lists but he cannot terminate it during
  2398.       the process of updating the "Employees" form.
  2399.  
  2400.       See also: Pause On/Off
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.                                 - 39 -
  2419. ................................................................................
  2420.       EXIT BATCH MENU        PROCEDURE COMMAND        EXIT BATCH MENU
  2421.  
  2422.       The "Exit Batch Menu" command terminates a current Batch Menu
  2423.       and returns control to the menu which called it.
  2424.  
  2425.       Ex.
  2426.  
  2427.       An application starts with a batch menu which calls a second
  2428.       batch menu which performs regular daily tasks. It then calls
  2429.       the main user menu. If the application is exited after the
  2430.       daily tasks batch menu has been completed then you will not
  2431.       wish to re-run the daily tasks when the application is
  2432.       restarted on the same day. To prevent this create a form
  2433.       "tasksdone" with a single field "date" and enter a single
  2434.       record with yesterdays date.
  2435.  
  2436.       The first procedure on the daily tasks batch menu would then be
  2437.  
  2438.       for tasksdone
  2439.          if tasksdone.date = system date then
  2440.             exit batch menu
  2441.          else
  2442.             tasksdone.date = system date
  2443.             update record
  2444.          end if
  2445.       next
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.                                 - 40 -
  2476. ................................................................................
  2477.       EXIT PROCEDURE         PROCEDURE COMMAND         EXIT PROCEDURE
  2478.  
  2479.       The "Exit Procedure" command terminates a procedure.
  2480.  
  2481.       Ex.
  2482.  
  2483.       if input.codeword <> "fred" then exit procedure
  2484.       for staffconfidential with name = input.name
  2485.          print list items
  2486.       next
  2487.  
  2488.  
  2489.       If the procedure has a repeating input screen then this is
  2490.       cancelled by the "Exit Procedure" command.
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.                                 - 41 -
  2533. ................................................................................
  2534.       File_Date File_Time      System value       File_Date File_Time
  2535.  
  2536.       Whenever you open a non Easy Base file it's date and time stamp
  2537.       are available in the system values File_Date and File_Time.
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.                                 - 42 -
  2590. ................................................................................
  2591.       File_Len                 System Value                  File_Len
  2592.  
  2593.       Whenever you open an external file with the "Open" Command the
  2594.       length of the opened file is available in the system value
  2595.       File_Len.
  2596.  
  2597.       The main use of the File_Len value is to position the
  2598.       Read/Write pointer ready to append data to an existing file.
  2599.  
  2600.       ...................
  2601.       declare variables
  2602.          CR as text
  2603.       end
  2604.       CR = jointext(chr$(13),chr$(10))
  2605.       Open "C:\WP\Address.txt"
  2606.       seek File_Len + 1
  2607.       Write Input.name
  2608.       Write CR
  2609.       Write Input.address1
  2610.       Write CR
  2611.       Write Input.address2
  2612.       Write CR
  2613.       Write input.address3
  2614.       Write CR
  2615.       Close
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.                                 - 43 -
  2647. ................................................................................
  2648.       File_Pos                 System Value                  File_Pos
  2649.  
  2650.       Whenever you open an external file with the "Open" command,
  2651.       The position of the file read/write pointer is available in the
  2652.       system value File_Pos.
  2653.  
  2654.       The value is in bytes counting the first byte as 1.
  2655.  
  2656.       The File_Pos value is used to make relative movements of the
  2657.       Read/write pointer  with the "Seek" command
  2658.  
  2659.       .....................................
  2660.       Open "C:\myfiles\Report.txt"
  2661.       for reports new record
  2662.          Read 10 to reports.CustNo
  2663.          Seek File_pos + 3
  2664.          read 20 to reports.Custname
  2665.       next
  2666.       close
  2667.       ......................................
  2668.  
  2669.       You can move the Read/Write pointer in either direction.
  2670.  
  2671.       Seek File_Pos - 20
  2672.  
  2673.       If you move the pointer back beyond the start of the file Easy
  2674.       Base generates the error message "Seek Value < 1 !".
  2675.  
  2676.  
  2677.       See Also: Open, Close, Seek, Read, Write
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.                                 - 44 -
  2704. ................................................................................
  2705.       Find                     File Command                      Find
  2706.  
  2707.       The "Find" command is used to select non Easy Base files using
  2708.       a wildcard Spec. When you issue the command Find with a
  2709.       wildspec parameter, Easy Base finds the first file to match the
  2710.       spec and puts its name in the Found_File system value. If you
  2711.       then repeat the command without a spec, Easy Base finds the
  2712.       next matching filename and puts it in Found_File. When all
  2713.       files have been found the Found_File value reverts to "Blank".
  2714.  
  2715.       Example: A company recieves replacement part orders by FAX.
  2716.       After the Address lines the FAX is formatted in four lines
  2717.  
  2718.       "Order Start:" - Engineers ID - Part ID - Quantity.
  2719.  
  2720.       All incoming FAXes for parts are filed in C:\FAX\ORDERS.
  2721.  
  2722.       The following procedure imports the orders to the Orders form
  2723.       and then deletes the FAX files.
  2724.  
  2725.       Declare variables
  2726.          Ln as text
  2727.       end
  2728.       Find "C:\FAX\ORDERS\*.*"
  2729.       Do
  2730.          If Found_File = Blank then exit do
  2731.          For orders new record
  2732.             open jointext("C:\FAX\ORDERS\",Found_File)
  2733.             Do
  2734.                Read line to Ln
  2735.                If Ln = "Order start:" then exit do
  2736.             Loop
  2737.             Read line to orders.engineer
  2738.             Read line to order.part
  2739.             read line to orders.quantity
  2740.          next
  2741.          Close
  2742.          Find
  2743.       Loop
  2744.       Erase "C:\FAX\ORDERS\*.*"
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.                                 - 45 -
  2761. ................................................................................
  2762.       FIXED POINT               FIELD TYPE                FIXED POINT
  2763.  
  2764.       Fixed point fields can display up to 14 digits. They use the
  2765.       comma for thousands separation and the full stop for decimal
  2766.       separation.
  2767.  
  2768.       There are no rounding errors with fixed point fields.
  2769.  
  2770.       See - Operators arithmetic
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.                                 - 46 -
  2818. ................................................................................
  2819.       FLOATING POINT            FIELD TYPE             FLOATING POINT
  2820.  
  2821.       Floating point fields can display up to 14 digits. They do not
  2822.       have a thousands separator. They are left justified.
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.                                 - 47 -
  2875. ................................................................................
  2876.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  2877.  
  2878.       The "For" command initiates loops which load records from forms
  2879.       for processing. All statements between the "For" and the "Next"
  2880.       commands are repeated for each record selected.
  2881.  
  2882.       Ex.
  2883.  
  2884.       For Videos
  2885.          If Videos.price = 2.00 then Videos.price = 2.50
  2886.          update record
  2887.       next
  2888.  
  2889.       In the above example each record in the "Videos" form is loaded
  2890.       into memory - the price field is checked and if it is 2.00 then
  2891.       it is altered to 2.50 - the record is then updated on disk.
  2892.  
  2893.       "For" loops can be nested to any depth.
  2894.  
  2895.       Ex.
  2896.  
  2897.       for videoprices
  2898.          for videos
  2899.             if videos.price = videoprices.price then
  2900.                print list items
  2901.             end if
  2902.          next
  2903.       next
  2904.  
  2905.       In the above example the outer loop loads each record from the
  2906.       "Videoprices" form.  While each of these is in memory it then
  2907.       loads each record from the "Videos" form, tests to see if the
  2908.       price field in "Videos" is the same as the price field in
  2909.       "Videoprices" and if so prints the list items section of the
  2910.       report format (containing the video title field) thus grouping
  2911.       all video titles by price.
  2912.  
  2913.       If a "For" loop is unqualified as above then every record is
  2914.       processed starting at one and advancing in sequence. "For"
  2915.       loops can be qualified in several ways in order to select
  2916.       records in other orders or groups. The following qualifications
  2917.       are available:-
  2918.  
  2919.       For (form) with (fieldname) in order
  2920.       For (form) with (fieldname) in reverse order
  2921.       For (form) with (fieldname) =  (value)
  2922.       For (form) with (fieldname) >  (value)
  2923.       For (form) with (fieldname) <  (value)
  2924.       For (form) with (fieldname) >= (value)
  2925.       For (form) with (fieldname) <= (value)
  2926.       For (form) new record
  2927.  
  2928.       With the exception of the "New Record" qualification, all
  2929.       accept the suffix "Unique" and an "Alias" for the form name.
  2930.  
  2931.                                 - 48 -
  2932. ................................................................................
  2933.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  2934.  
  2935.       If a "For" loop is qualified by "in order" or "in reverse
  2936.       order" then the records are selected in alphabetical or reverse
  2937.       alphabetical order if the selection field is text, and in
  2938.       numeric or reverse numeric order if the selection field is
  2939.       numeric.
  2940.  
  2941.       Ex.
  2942.  
  2943.       for books with title in order
  2944.          print list items
  2945.       next
  2946.  
  2947.       Ex.
  2948.  
  2949.       for salesmen with monthlysales in reverse order
  2950.          print list items
  2951.       next
  2952.  
  2953.       If a "For" loop is qualified by "in order unique" or "in
  2954.       reverse order unique" then records will be selected in order or
  2955.       in reverse order as above. However, where there are multiple
  2956.       occurrence of the same field value a "unique" loop will only
  2957.       select the first occurrence of each value if the loop is in
  2958.       order or the last occurrence if the loop is in reverse order.
  2959.  
  2960.       Ex.
  2961.  
  2962.       for books with category in order unique
  2963.          count = count + 1
  2964.          print list items
  2965.       next
  2966.       print categorycount
  2967.  
  2968.       This example prints and counts the different categories in the
  2969.       "books" form.
  2970.  
  2971.       Ex.
  2972.  
  2973.       for theatreseats with price in reverse order unique
  2974.          for seatprices new record
  2975.             seatprices.price = theatreseats.price
  2976.          next
  2977.       next
  2978.  
  2979.       The above example selects one example only of each seat price
  2980.       in an existing "theatreseats" form in descending price order
  2981.       and enters a new record in the new "seatprices" form.
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.                                 - 49 -
  2989. ................................................................................
  2990.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  2991.  
  2992.       If a "For" loop is qualified by a "Fieldname = " condition then
  2993.       only the record or records where the field contents match the
  2994.       condition will be selected.
  2995.  
  2996.       Ex.
  2997.  
  2998.       for books with category = "fiction"
  2999.          print list items
  3000.       next
  3001.  
  3002.       This example prints all books which have the category "fiction"
  3003.  
  3004.       Ex.
  3005.  
  3006.       For customers with acno = input.acno
  3007.          creditlimit = input.creditlimit
  3008.          update record
  3009.       next
  3010.  
  3011.       In this example the procedure has an input screen where the
  3012.       operator enters a customers account number and new credit
  3013.       limit. On pressing F2 the procedure finds the single record in
  3014.       the "Customers" form which has the input account number and
  3015.       updates the "creditlimit" field.
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.                                 - 50 -
  3046. ................................................................................
  3047.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  3048.  
  3049.       If a "For" loop is qualified by a "with (fieldname) > " or
  3050.       "with (fieldname) >= " condition then records are selected in
  3051.       order like the "with (fieldname) in order" qualification but
  3052.       starting with the first record where the field contents match
  3053.       the condition value rather than the first record.
  3054.  
  3055.       Similarly the qualifications "with (fieldname) < " and "with
  3056.       (fieldname) <= " select records in reverse order but starting
  3057.       with the last record to match the condition value.
  3058.  
  3059.       In case you are new to progamming it should be pointed out that
  3060.       the relational operators >, <, >= and <= can be applied to text
  3061.       as well as to numbers. When they are applied to text they
  3062.       relate to the text's alphabetical order.
  3063.  
  3064.       These four qualifications provide the means to select any
  3065.       subset of records which has a range of values in a particular
  3066.       field.
  3067.  
  3068.       Ex.
  3069.  
  3070.       for pupils with age > 6
  3071.          if pupils.age = 12 then exit for
  3072.          print list items
  3073.       next
  3074.  
  3075.       This example prints the names of all pupils between the ages of
  3076.       seven and eleven. The "For" qualification starts selection in
  3077.       numeric order of age starting at seven and the "Exit for"
  3078.       command terminates the loop when the first pupil aged twelve is
  3079.       loaded.
  3080.  
  3081.       Ex.
  3082.  
  3083.       A "Videos" form has a compound index field called "catorder"
  3084.       which is derived by joining the text of the "category" and
  3085.       "title" fields. The following procedure selects all the videos
  3086.       which have the category entered on the input screen and lists
  3087.       them with the title in alphabetic order.
  3088.  
  3089.       for videos with catorder >= input.category
  3090.          if videos.category > input.category then exit for
  3091.          print list items
  3092.       next
  3093.  
  3094.       Ex.
  3095.  
  3096.       for vehicles with seats > 4 unique
  3097.          count = count + 1
  3098.       next
  3099.  
  3100.       "count" returns the number of different seat capacities > 4
  3101.  
  3102.                                 - 51 -
  3103. ................................................................................
  3104.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  3105.  
  3106.       If a "For" loop is qualified by "new record" then no records
  3107.       are selected from the form. Instead, a new blank record is
  3108.       created at the "For" command, all statements between the "For"
  3109.       and "Next" commands apply to this new record and it is entered
  3110.       to the form at the "Next" command.
  3111.  
  3112.       Ex.
  3113.  
  3114.       for books new record
  3115.          books.dateinstock = system date
  3116.          copy all from input
  3117.       next
  3118.  
  3119.       This example enters a new record to the "Books" form making the
  3120.       "dateinstock" field equal the system date and copying all other
  3121.       fields from the procedures input screen.
  3122.  
  3123.       Ex.
  3124.  
  3125.       declare variables
  3126.         hourcount as number
  3127.       end
  3128.       '..............clear last wages
  3129.       clear records from wagelist
  3130.       '..........count employees hours from timesheet...
  3131.       for employees
  3132.          hourcount = 0
  3133.          for timesheet with worksno = employees.worksno
  3134.             hourcount = hourcount + timesheet.hours
  3135.          next
  3136.          for wagelist new record
  3137.             wagelist.worksno = employees.worksno
  3138.             wagelist.name = employees.name
  3139.             wagelist.hours = hourcount
  3140.             wagelist.grosswage = employees.wagerate * hourcount
  3141.          next
  3142.       next
  3143.       '.................print the wages list
  3144.       for wagelist with worksno in order
  3145.          print list items
  3146.       next
  3147.  
  3148.       This procedure starts by erasing the present contents of the
  3149.       "wagelist" form. It then selects each record from the
  3150.       "employees" form, counts all entries in the "timesheet" form
  3151.       for the employee and enters a new record in the "wagelist"
  3152.       form. Finally it prints the new wage list.
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.                                 - 52 -
  3160. ................................................................................
  3161.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  3162.  
  3163.       Occasionally you may need to nest a "For" loop of a form within
  3164.       another "For" loop of the same form. If you do this, then in
  3165.       order to differentiate between the fields in the outer and
  3166.       inner loops you must allocate an "alias" name to the form in
  3167.       one of the loops. When you allocate an alias to a form name
  3168.       then all the fields of the form can also be referenced by the
  3169.       alias name.
  3170.  
  3171.       Ex.
  3172.       .......................procedure code...........
  3173.       declare output fields
  3174.          males : females : pupils.age
  3175.       end
  3176.       for pupils with age in order unique
  3177.          males = 0 : females = 0
  3178.          for pupils alias agegroups with age = pupils.age
  3179.             if agegroups.sex = "male" then
  3180.                males = males + 1
  3181.             else
  3182.                females = females + 1
  3183.             end if
  3184.          next
  3185.          print list items
  3186.       next
  3187.       ....................output format......................
  3188.       .list items
  3189.       There are {males} males and {females} females aged {pupils.age}
  3190.       .end
  3191.  
  3192.  
  3193.       This example counts and prints the number of male and female
  3194.       pupils in each age group.
  3195.  
  3196.       If you intend to print fields from one of the nested loops as
  3197.       the "Age" field above then you should give the alias name to
  3198.       the other loop. You can only declare an output field with the
  3199.       real form name. If you have to print fields from both loops
  3200.       then you must declare an "Ad Hoc" field and pass the alias
  3201.       fields contents to it for printing.
  3202.  
  3203.       If you need to exclude individual or groups of records from
  3204.       selection just use the "Skip Record" or "Skip Group" command.
  3205.  
  3206.       Ex.
  3207.  
  3208.       for videos with category in order
  3209.          if videos.category = "Cartoon" then skip group
  3210.          print list items
  3211.       next
  3212.  
  3213.  
  3214.  
  3215.  
  3216.                                 - 53 -
  3217. ................................................................................
  3218.       FORMATTED TEXT            FIELD TYPE             FORMATTED TEXT
  3219.  
  3220.       If you define a field with the type "formatted text" a window
  3221.       opens up in which you enter the formatting characters. The
  3222.       characters which are to be entered by the user are shown as
  3223.       question marks. Any other characters which you enter become
  3224.       permanent fixtures in the field. The "formatted text" field can
  3225.       be up to twenty characters long and can be used for dates,
  3226.       national insurance numbers etc.
  3227.  
  3228.       Formatted text fields should not be derived.
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.                                 - 54 -
  3274. ................................................................................
  3275.       Fun_Key                  SYSTEM VALUE                   Fun_Key
  3276.  
  3277.       The Fun_Key system value holds the number of the function key
  3278.       which was pressed to run a procedure from its input screen. If
  3279.       the procedure was started automatically by a [Run] field
  3280.       control then Fun_Key returns the value 0.
  3281.  
  3282.       The main use of the Fun_Key value is to branch from one
  3283.       procedure to another using the Run command. Its value is also
  3284.       available immediately to the input screen field derivations.
  3285.       You can therefore make any field entry mandatory or not
  3286.       depending on which function key was pressed.
  3287.  
  3288.       Example.
  3289.  
  3290.       If you set the Mandatory entry attribute of field "Name" to
  3291.       "If" and enter the condition "Fun_Key = 2 or Fun_Key 4" then
  3292.       the procedure cannot be run with the F2 or F4 keys unless the
  3293.       Name field has been filed but it can be run with the name field
  3294.       blank if any of the other function keys were pressed.
  3295.  
  3296.       The value of disabled function keys is also available to input
  3297.       screen derivations. You can use disabled function keys to
  3298.       redirect the cursor:
  3299.  
  3300.       if(Fun_Key = 7,fieldname[cursor size],fieldname)
  3301.  
  3302.       By using disabled function keys to redirect the cursor to
  3303.       fields on a different page you can make a single procedure
  3304.       appear to have more than on input screen for different
  3305.       purposes.
  3306.  
  3307.  
  3308.  
  3309.       See also "Run" "Disable"
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.                                 - 55 -
  3331. ................................................................................
  3332.       GLOBAL NUMBER            SYSTEM VALUE             GLOBAL NUMBER
  3333.  
  3334.       The variables you create in Easy Base procedures are local
  3335.       variables - they cease to exist when the procedure ends. So
  3336.       that you can pass messages between procedures Easy base
  3337.       provides a single global variable "Global Number".  Once you
  3338.       allocate a value to "Global Number" that value remains
  3339.       unchanged (even if your computer has been turned off) until you
  3340.       allocate another value to it. You can of course pass many
  3341.       messages between procedures simply by entering records in forms
  3342.       and re-reading them but using "Global Number" is much quicker.
  3343.  
  3344.       The following example uses "Global Number" to make access to a
  3345.       user menu restricted by password.
  3346.  
  3347.       Two procedures are defined. The first, "getpassword" has a
  3348.       password field on its input screen and the following code:-
  3349.  
  3350.       if input.password = "gingerbread" then
  3351.          global number = 1
  3352.       else
  3353.          global number = 0
  3354.       end if
  3355.  
  3356.       The second procedure "checkpassword" has the following code:-
  3357.  
  3358.       if global number <> 1 then exit batch menu
  3359.       global number = 0
  3360.  
  3361.       The open access menu system has an item for the restricted menu
  3362.       but instead of calling it direct it calls the menu "Password"
  3363.       which is a batch execute menu with the items
  3364.  
  3365.       run procedure ----  getpassword
  3366.       run procedure ----  checkpassword
  3367.       user menu     ----  restricted
  3368.  
  3369.       If the password "gingerbread" has not been entered in the
  3370.       "getpassword" input screen then "checkpassword" will return
  3371.       control to the original menu.
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381.  
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.                                 - 56 -
  3388. ................................................................................
  3389.       GOTO (FIELD) NEXT      DERIVATION PREFIX      GOTO (FIELD) NEXT
  3390.  
  3391.       In an Easy Base form or procedure input screen the cursor moves
  3392.       from field to field in the default order top left to bottom
  3393.       right when you press the Return key. You can alter this default
  3394.       order by deriving any field with "Goto (fieldname) next". If
  3395.       the field from which you wish to redirect the cursor already
  3396.       has a derivation formula you simply add the "Goto - Next" as a
  3397.       prefix.
  3398.  
  3399.       Ex.
  3400.  
  3401.       goto price next
  3402.  
  3403.       goto item next default(lookup(stock,name))
  3404.  
  3405.       Cursor redirection with the "Goto - next" derivation only
  3406.       occurs when the Return key is pressed it is not activated if
  3407.       you move the cursor with the directional arrow keys.
  3408.  
  3409.       1. You can have more than one prefix on any one field
  3410.          derivation provided there is a space between each.
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.                                 - 57 -
  3445. ................................................................................
  3446.       Help                   DERIVATION PREFIX                   Help
  3447.  
  3448.       Easy Base provides a default help line for all data entry and
  3449.       procedure input screens. You can replace the system default
  3450.       help line with your own default help line by pressing F6 during
  3451.       form or screen design.
  3452.  
  3453.       You can also override the default with a field specific help
  3454.       line by using the derivation prefix "Help" followed by the help
  3455.       line in quotation marks.
  3456.  
  3457.       Field specific help lines replace the default help line
  3458.       whenever the cursor is in the field with the derivation prefix.
  3459.  
  3460.       Example: If, in the derivation formula for field "Name" you
  3461.       type:-
  3462.  
  3463.       Help "Enter Customers name and press return"
  3464.  
  3465.       then the help line will show the quoted text whenever the
  3466.       cursor is in the Name field but will revert to the default when
  3467.       the cursor moves to another field.
  3468.  
  3469.       You can use the Help prefix in any or all fields.
  3470.  
  3471.       The help line has a maximum length of 80 characters. If you
  3472.       quote a help line greater than 80 characters it will be
  3473.       truncated at run time. Help lines of less than 80 characters
  3474.       are automatically padded to 80 with space characters.
  3475.  
  3476.       If the field already has a derivation formula, add the help as
  3477.       a prefix:-
  3478.  
  3479.       Help "Enter Part Name" proper(partname)
  3480.  
  3481.       Notes:
  3482.  
  3483.       1.  There must be a space between Help and the quoted line.
  3484.  
  3485.       2.  The line must be in quotes and quotation marks cannot be
  3486.           included in the line.
  3487.  
  3488.       3.  You can have more than one prefix on any one field
  3489.           derivation provided there is a space between each.
  3490.  
  3491.       Ex.
  3492.  
  3493.       Autodial Help "Press Ctrl + D to Dial" lookup(customers,No)
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.                                 - 58 -
  3502. ................................................................................
  3503.       HOURS                      FUNCTION                       HOURS
  3504.  
  3505.       This function returns the hour ( 1 to 23) of the time parameter
  3506.  
  3507.       Ex.  Hour(system time)
  3508.  
  3509.       Ex.
  3510.  
  3511.       Labourcharge = (hours(endtime)-hours(starttime))* rate
  3512.  
  3513.  
  3514.       Acceptable parameters:
  3515.  
  3516.       System time
  3517.       Time field
  3518.       Maketime function
  3519.       Time expression
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.                                 - 59 -
  3559. ................................................................................
  3560.       IF                         FUNCTION                          IF
  3561.  
  3562.       Ex.  if(num >= 0,"Positive","negative")
  3563.  
  3564.       The first parameter of the "if" function is an expression, the
  3565.       second is the value to be returned if the expression is true
  3566.       and the third is the value to be returned if the expression is
  3567.       false.
  3568.  
  3569.       If the third parameter is omitted and the expression is false
  3570.       then the field or variable retains any value it had before the
  3571.       function was called.
  3572.  
  3573.       The "if" function can be extended to a full "case" function
  3574.       simply by adding more expressions and return values.
  3575.  
  3576.       Ex.  if(num > 0,"Positive",num = 0,"Zero","Negative")
  3577.  
  3578.       There is no limit to the number of expressions and return
  3579.       values. If more than one expression is true the value returned
  3580.       is that for the first true expression. If none are true then
  3581.       the trailing value is returned as the "case else".
  3582.  
  3583.       Acceptable Parameters:
  3584.  
  3585.       Numeric expressions
  3586.       Quoted text
  3587.       Fields and variables
  3588.       Other nested functions
  3589.       System Values
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.                                 - 60 -
  3616. ................................................................................
  3617.       IF THEN ELSE           PROCEDURE COMMAND           IF THEN ELSE
  3618.  
  3619.       Easy Base recognizes the following "If Then Else"
  3620.       constructions.
  3621.  
  3622.       1.    if (condition) then (action)
  3623.             ------------------------------------------
  3624.       2.    if (condition) then (action) else (action)
  3625.             ------------------------------------------
  3626.       3.    if (condition) then
  3627.                (action)
  3628.                (action)
  3629.                (action)
  3630.             end if
  3631.             -----------------------------------------
  3632.       4.    if (condition) then
  3633.                (action)
  3634.                (action)
  3635.             else
  3636.                (action)
  3637.                (action)
  3638.             end if
  3639.  
  3640.       If then constructions can be nested to any depth.
  3641.  
  3642.       if (condition) and (condition) then
  3643.          (action)
  3644.          if (condition) or (condition) then
  3645.             (action)
  3646.             (action)
  3647.          else
  3648.             (action)
  3649.             if (condition) eqv (condition) then (action)
  3650.             (action)
  3651.          end if
  3652.          if (condition) then (action)
  3653.       else
  3654.          (action)
  3655.       end if
  3656.  
  3657.       Easy base does not interpret "Else if" constructions.
  3658.  
  3659.       Easy base does not interpret two "if" conditions on one line.
  3660.  
  3661.  
  3662.       In the above examples "action" applies to any Easy base command
  3663.       or full "Do Loop" or full "For Next" structure.
  3664.  
  3665.       You cannot split a "Do Loop" structure and you can only split a
  3666.       "For Next" structure by a simple "If then" and "End if" with no
  3667.       "else" command.
  3668.  
  3669.       Ex. on next page.
  3670.  
  3671.  
  3672.                                 - 61 -
  3673. ................................................................................
  3674.       IF THEN ELSE           PROCEDURE COMMAND           IF THEN ELSE
  3675.  
  3676.       In the following example the procedure has an input screen with
  3677.       a field "type". "type" is a choice field with the choices "In
  3678.       age order", "In alphabetic order" and "By sex". The procedure
  3679.       code selects one of three listings from the "Pupils" form by
  3680.       splitting "For Next" structures by "If Then" structures.
  3681.  
  3682.       if input.type = "in age order" then
  3683.          for pupils with age in order
  3684.       end if
  3685.       if input.type = "in alphabetic order" then
  3686.          for pupils with name in order
  3687.       end if
  3688.       if input.type = "by sex" then
  3689.          for pupils with sex in order
  3690.       end if
  3691.          print list items
  3692.       next
  3693.       next
  3694.       next
  3695.  
  3696.       The structure above is the only one in which "For Next"
  3697.       structures can be split. There must be a separate "If Then"
  3698.       followed by "End If" for each "For". There must be a "Next for
  3699.       each "For"  and there cannot be an "Else" anywhere in the
  3700.       construction.
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.                                 - 62 -
  3730. ................................................................................
  3731.       INDEX OFF              PROCEDURE COMMAND              INDEX OFF
  3732.  
  3733.       When an Easy Base procedure adds, updates or deletes a record
  3734.       then by default it updates any affected index files. As the
  3735.       majority of transaction procedures act on a single record this
  3736.       is the fastest method of processing. It does of course require
  3737.       that the form is periodically re-packed.  If, however, a
  3738.       procedure is to add, update or delete many records then
  3739.       updating each affected index file on each iteration of the
  3740.       "For" loop can be much slower than ignoring the indices during
  3741.       the loop and re-writing them from scratch afterward.
  3742.  
  3743.       You can take the "re-write" option by issuing the command
  3744.       "Index off" before the "For" loop.
  3745.  
  3746.       index off
  3747.       for employees
  3748.         for wagelist new record
  3749.            wagelist.worksno = employees.worksno
  3750.            wagelist.taxcode = employees.taxcode
  3751.         next
  3752.       next
  3753.  
  3754.       Obviously re-writing an entire index file when only one or two
  3755.       records are affected would be slower than simply updating the
  3756.       indices. The actual point at which "Index Off" becomes faster
  3757.       can only be determined by trial but as a general rule the two
  3758.       systems take equal time when between 12 and 15 percent of the
  3759.       records of a file are affected and the advantage of "Index Off"
  3760.       becomes greater the bigger this percentage.
  3761.  
  3762.       There is no corresponding "Index On" command. Indexing is
  3763.       turned back on automatically and the index files are re-written
  3764.       at the end of the loop to which the command applies. If you
  3765.       require indexing off during more than one loop you must issue
  3766.       the command before each.
  3767.  
  3768.       index off
  3769.       for invoices with date < makedate(05,04,93)
  3770.          delete records
  3771.       next
  3772.       index off
  3773.       for invoices with customer = "john smith"
  3774.          invoices.customer = "John Smith Ltd"
  3775.          update record
  3776.       next
  3777.  
  3778.       If you prefix a loop which deletes records from a form then the
  3779.       form is packed at the end of the loop.
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.                                 - 63 -
  3787. ................................................................................
  3788.       INSTALL FORM               UTILITY                 INSTALL FORM
  3789.  
  3790.       The "Install Form" utility is accessed from the Utilities menu.
  3791.       If you wish to include a form in one application which you
  3792.       designed in another then you cannot simply copy the files to
  3793.       the new applications directory as there will be no entry in the
  3794.       "Forms Directory" file.
  3795.  
  3796.       To install a form from another application - first get the
  3797.       forms DOS filename from that application then select "Install
  3798.       Form" from the utilities menu. You will be asked to supply the
  3799.       forms name and the full path and filename from where it is to
  3800.       be copied. Easy Base will then copy the forms definition file
  3801.       and make the appropriate entry in the "Forms Directory". It
  3802.       will then ask whether or not you wish the data to be copied
  3803.       from the original application.
  3804.  
  3805.       If you install a form from another application and it has
  3806.       "lookup" derivations or Choice List fields then you will have
  3807.       to create the relationships and choice lists in the new
  3808.       application. They are not automatically reproduced.
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.                                 - 64 -
  3844. ................................................................................
  3845.       INSTALL PRINTER            UTILITY              INSTALL PRINTER
  3846.  
  3847.       The "Install printer" utility is accessed from the Utilities
  3848.       menu. It can also be included in a user menu so that end users
  3849.       of finished applications can install their printer without
  3850.       access to the system menus.
  3851.  
  3852.       When you select "Install Printer" you are offered a choice of
  3853.       ten printer drivers - five for named printers and five generic
  3854.       drivers. The drivers supplied cover virtually all printers
  3855.       except daisy wheels.
  3856.  
  3857.       When you have chosen your printer driver Easy Base then asks
  3858.       for the parallel port number to which printer output is to be
  3859.       sent - one or two. Easy Base does not have a built in serial
  3860.       port printer output. If your printer only has a serial input
  3861.       then you must redirect a parallel port with the DOS "Mode"
  3862.       command.
  3863.  
  3864.       Easy Base then asks how much paper wastage there is at the top
  3865.       of the page. This is quite important as it is used in
  3866.       conjunction with the paper size in use to determine the
  3867.       "Bottom Margin" value, used for pagination in printed reports.
  3868.  
  3869.       You are then asked for the wastage at the left margin. This
  3870.       information is used in the format editor to display the right
  3871.       edge of the paper at the different print sizes. There are only
  3872.       two settings for wastage at the left margin - zero and ¼ inch.
  3873.       If you have a cartridge fed printer such as a Laser or Bubble
  3874.       Jet then it will almost certainly be ¼ inch. If you have a
  3875.       traction or manual feed then you will be able to adjust the
  3876.       left margin and you should set it to zero.
  3877.  
  3878.       Finally you are asked for the top margin required in printed
  3879.       reports. This can only be between the value set as the printers
  3880.       inherent wastage and one inch.  The value you set here will be
  3881.       the default top margin for all printouts. If you need a larger
  3882.       top margin for certain printouts then you must include blank
  3883.       lines in the page header of the procedures output format.
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.                                 - 65 -
  3901. ................................................................................
  3902.       INSTALL PROCEDURE          UTILITY            INSTALL PROCEDURE
  3903.  
  3904.       The "Install procedure" utility is accessed from the
  3905.       Utilities menu and allows you to install procedures which you
  3906.       designed in another application. It is used exactly like the
  3907.       "Install Form" utility previously described.
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.                                 - 66 -
  3958. ................................................................................
  3959.       INTEGER                   FIELD TYPE                    INTEGER
  3960.  
  3961.       Integer fields can have up to 14 digits and use a comma as the
  3962.       thousands separator.
  3963.  
  3964.       Although integer fields display integers they store the result
  3965.       of any division correct to 15 significant figures.
  3966.  
  3967.       See - Operators Arithmetic
  3968.  
  3969.  
  3970.  
  3971.  
  3972.  
  3973.  
  3974.  
  3975.  
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.                                 - 67 -
  4015. ................................................................................
  4016.       INTEXT                     FUNCTION                      INTEXT
  4017.  
  4018.       This function returns the starting character number of one
  4019.       length of text within another.
  4020.  
  4021.       Ex.    Intext(companyname," and ")
  4022.              < Returns 7 if companyname = "Turner and Smith"
  4023.  
  4024.       The intext function returns 0 if the second parameter is not
  4025.       found in the first.
  4026.  
  4027.       Ex.
  4028.  
  4029.       If intext(customers.companyname," Ltd") <> 0 then
  4030.          customers.Ltd  = "yes"
  4031.          update record
  4032.       end if
  4033.  
  4034.       Acceptable parameters:
  4035.  
  4036.       Text field/variable
  4037.       Any function returning a text value
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  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.                                 - 68 -
  4072. ................................................................................
  4073.       JOINTEXT                   FUNCTION                    JOINTEXT
  4074.  
  4075.       Ex.  Jointext(forename,surname)
  4076.  
  4077.       The jointext function takes any number of parameters.
  4078.  
  4079.       Ex.  Jointext("Mr ",forename," ",surname," Esq.")
  4080.       Ex.  Jointext(if(sex=male,"Mr ","Ms "),surname)
  4081.  
  4082.       The "jointext" function will also perform any arithmetic
  4083.       operations required for a text output.
  4084.  
  4085.       Ex. Jointext("The Gross price is ",netprice *120/100)
  4086.  
  4087.       The "jointext" function is also used for creating compound
  4088.       index fields.
  4089.  
  4090.       Ex. Jointext(reverse(zeropad(price,4,2)),stockitem)
  4091.  
  4092.       This creates a field whose index allows a stock file to be
  4093.       listed with stockitem in alphabetical order but grouped by
  4094.       price in reverse order.
  4095.  
  4096.       If you "Jointext" a date or time field you will get the date or
  4097.       time's numeric value not the date or time's string
  4098.       representation. (See Compound Index)
  4099.  
  4100.       By default the "Jointext" function strips trailing blank space
  4101.       characters from the texts being joined. If you wish to join
  4102.       text in a Text Block field so that the second text starts on a
  4103.       new line then you can force this by including Chr$(13) which
  4104.       Easy base uses as a "New Line" flag.
  4105.  
  4106.       Ex.
  4107.  
  4108.           Jointext(block1,chr$(13),block2)
  4109.  
  4110.           <The text from block2 will start on a new line>
  4111.  
  4112.       Ex.
  4113.  
  4114.           Jointext(block1,chr$(13),chr$(13),block2)
  4115.  
  4116.          <There will be a blank line between block1 and block2>
  4117.  
  4118.       Acceptable Parameters:
  4119.  
  4120.       Numeric expressions
  4121.       Quoted text
  4122.       Fields and variables
  4123.       Other nested functions
  4124.       System Values
  4125.  
  4126.  
  4127.  
  4128.                                 - 69 -
  4129. ................................................................................
  4130.       LEFTTEXT                   FUNCTION                    LEFTTEXT
  4131.  
  4132.       This function returns a specified number of characters from the
  4133.       start of a field or variable.
  4134.  
  4135.       Ex.   Lefttext(salutation,2)
  4136.             < returns "Mr" from "Mr Smith" or "Ms" from "Ms Smith"
  4137.  
  4138.       Ex.   Lefttext(datetext(system date),4)
  4139.             < Returns 12th , 20th Etc.>   (European date format)
  4140.  
  4141.  
  4142.  
  4143.  
  4144.       Acceptable parameters:
  4145.  
  4146.       Text field/variable
  4147.       Any function returning a text value
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.                                 - 70 -
  4186. ................................................................................
  4187.       LENGTHTEXT                 FUNCTION                  LENGTHTEXT
  4188.  
  4189.       This function returns the length of text in a field or variable
  4190.  
  4191.       Ex.   lengthtext(name)
  4192.             < Returns 4 if name = "Bill"  10 if name = "Bill Smith"
  4193.  
  4194.  
  4195.       Acceptable parameters:
  4196.  
  4197.       Text field/variable
  4198.       Any function returning a text value
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241.  
  4242.                                 - 71 -
  4243. ................................................................................
  4244.       LIST FILE NAMES            UTILITY              LIST FILE NAMES
  4245.  
  4246.       When you give a name to a Form or Procedure in Easy Base it is
  4247.       not the actual DOS file name used. A Form has separate DOS
  4248.       files for its definition, its data and its indices. Similarly a
  4249.       procedure can have one or two files depending on whether or not
  4250.       it has an input screen. Within an application you never need to
  4251.       know the DOS filenames as Easy Base takes care of all disk
  4252.       activity in the background.
  4253.  
  4254.       You may however need to know the DOS filenames if you intend to
  4255.       export data to another program or copy a Form or Procedure from
  4256.       one application to another.
  4257.  
  4258.       You can list the DOS filenames for Forms and reports with the
  4259.       "List File Names" utility.
  4260.  
  4261.       The "List File Names" utility can also be called from a user
  4262.       menu without accessing the system.
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.                                 - 72 -
  4300. ................................................................................
  4301.       LIST VARIABLES         PROCEDURE COMMAND         LIST VARIABLES
  4302.  
  4303.       The "List Variables" command is a de-bugging facility for
  4304.       developers. If a procedure is not producing the expected
  4305.       results you can interrupt it at any point and view the contents
  4306.       of all fields and variables in memory at that point.
  4307.  
  4308.       Ex.
  4309.  
  4310.       for authors with surname in order
  4311.          if authors.surname = "kippling" then list variables
  4312.          for books with author = authors.surname
  4313.             print list items
  4314.          next
  4315.       next
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.                                 - 73 -
  4357. ................................................................................
  4358.       LOOKUP                     FUNCTION                      LOOKUP
  4359.  
  4360.       Ex. Lookup(customers,surname)
  4361.           Lookup(customers,surname,address)
  4362.  
  4363.       The first parameter is the name of a relationship defined in
  4364.       the relationships form. The second parameter is the name of the
  4365.       field in the secondary file whose value is to be looked up. The
  4366.       third parameter, which is optional, specifies that a field
  4367.       other than the looked up field is to be listed for selection
  4368.       when there is more than one match. (The looked up field must be
  4369.       indexed)
  4370.  
  4371.       The parameters are absolute. You cannot supply them as
  4372.       variables, fields or the results of other functions.
  4373.  
  4374.       In the first example, if you enter "Sm*" in the field with the
  4375.       derivation and there are several names beginning with Sm, then
  4376.       the names will be listed for you to choose from. This is most
  4377.       useful if all the names are different. If, however, there are
  4378.       several names beginning with Sm but they are all "Smith" then
  4379.       it will be more useful to use the second example which will
  4380.       list all the addresses for the "Smith" names.
  4381.  
  4382.       Lookup functions which have two parameters do not list
  4383.       duplicates when there is more than one match, whereas lookup
  4384.       functions with three parameters do. You can therefore use one
  4385.       lookup of the first type and one lookup of the second type to
  4386.       resolve ambiguities.
  4387.  
  4388.       For example, to perform lookups from the customers form (which
  4389.       has duplicates in the "Surname" field), you would firstly
  4390.       create an additional invisible field on the input screen
  4391.       (surname2) derived surname. You then enter two relationships
  4392.       between the screen and the customers form. The first, called
  4393.       customers, links surname with surname and the second, called
  4394.       customers2, links surname2 with surname.
  4395.  
  4396.       The surname field on the input screen is derived -
  4397.       Lookup(customers,surname). All the other fields to be looked up
  4398.       are derived - Lookup(customers2,fieldname) but one of them (Any
  4399.       one) has the third parameter added :-
  4400.  
  4401.       Lookup(customers2,forename,address)
  4402.  
  4403.       When you enter "Sm" in the surname field, the first lookup will
  4404.       list all the customer surnames beginning with "Sm". When you
  4405.       choose "Smith" from this list, "Smith" will be copied to the
  4406.       invisible field Surname2 and the second lookup will trigger
  4407.       listing all the addresses of the Smith customers.
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.                                 - 74 -
  4414. ................................................................................
  4415.       LOWER                      FUNCTION                       LOWER
  4416.  
  4417.       Returns the lower case of the parameter.
  4418.  
  4419.       Ex. lower(partname)
  4420.  
  4421.  
  4422.       Ex.
  4423.  
  4424.       Heading = Jointext("List of parts supplied by ",lower(makers.
  4425.       name))
  4426.  
  4427.  
  4428.       Acceptable parameters:
  4429.  
  4430.       Quoted text
  4431.       Text Field/variable
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.  
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.                                 - 75 -
  4471. ................................................................................
  4472.       MAKEDATE                   FUNCTION                    MAKEDATE
  4473.  
  4474.       The Easy base Date field is a six digit field which covers the
  4475.       century from 1 Jan 1981 to 31 Dec 2080 and upon which you can
  4476.       perform addition and subtraction operations in days.
  4477.  
  4478.       Ex. Duedate = Invoicedate + 30
  4479.  
  4480.       In order to provide this facility the date is held as a numeric
  4481.       value. You can only type a date directly into a date field.
  4482.  
  4483.       If you need to enter a date in a derivation or in a procedure
  4484.       code you must use the "makedate" function.
  4485.  
  4486.       Ex.  Makedate(5,11,95)
  4487.           < Returns 05/11/95 >
  4488.  
  4489.       Ex.  Nextmonth = month(system date)+1
  4490.            if nextmonth = 13 then nextmonth = 1
  4491.            Nextdelivery = makedate(1,nextmonth,year(system date))
  4492.            < Returns the date of the first of next month >
  4493.  
  4494.       Acceptable parameters
  4495.  
  4496.       Numeric value
  4497.       Numeric expression
  4498.       Numeric field/variable
  4499.       Any other function which returns a numeric value
  4500.  
  4501.  
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.                                 - 76 -
  4528. ................................................................................
  4529.       MAKETIME                   FUNCTION                    MAKETIME
  4530.  
  4531.       The value of a time field in Easy base is held as a numeric
  4532.       value representing the number of seconds past midnight. This
  4533.       allows you to perform addition and subtraction operations in
  4534.       seconds.
  4535.  
  4536.       Ex. Timetaken = Round(Endtime - Starttime / 60)
  4537.           < This returns the time taken in minutes >
  4538.  
  4539.       You can only enter a time directly into a time field.
  4540.  
  4541.       If you need to enter a time in a field derivation or in a
  4542.       procedure code you must use the "Maketime" function.
  4543.  
  4544.       Ex. Time = Maketime(20,20,00)
  4545.            <  returns 20:20:00  >
  4546.  
  4547.  
  4548.       Acceptable parameters:
  4549.  
  4550.       Numeric value
  4551.       Numeric expression
  4552.       Numeric field/variable
  4553.       Any other function which returns a numeric value
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.                                 - 77 -
  4585. ................................................................................
  4586.       Manual Feed            Procedure Command            Manual Feed
  4587.  
  4588.       When you set the paper type in use from the utilities menu, you
  4589.       tell Easy Base whether you have a manual or continuous feed
  4590.       printer. This is then used throughout all procedures.
  4591.  
  4592.       If your printer has a continuous feed but a particular
  4593.       procedure requires manual eg label or envelope printing you can
  4594.       force Easy Base to pause after each page without changing the
  4595.       default by issuing the Manual Feed command within the procedure
  4596.       code.
  4597.  
  4598.       Declare output fields
  4599.          mail.name :mail.address
  4600.       end
  4601.       manual feed
  4602.       for mail
  4603.          print envelope
  4604.       next
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.                                 - 78 -
  4642. ................................................................................
  4643.       MATHS                      FUNCTION                       MATHS
  4644.  
  4645.       The following maths functions can be used anywhere in Easy Base
  4646.       code or field derivations.
  4647.  
  4648.       Log()
  4649.       Log10()
  4650.       Sqrt()
  4651.       Sin()
  4652.       Cos()
  4653.       Tan()
  4654.       Atan()
  4655.       Deg-rad()     converts degrees to radians
  4656.       Rad-deg()     converts radians to degrees
  4657.       Exp()         Raises e (the base of natural logarithms) to the
  4658.                     power of the parameter
  4659.  
  4660.  
  4661.       Acceptable parameters:
  4662.  
  4663.       Numeric value
  4664.       Numeric expression
  4665.       Numeric field/variable
  4666.       Any function returning a numeric value
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.                                 - 79 -
  4699. ................................................................................
  4700.       MENU CALLS               MENU FUNCTION               MENU CALLS
  4701.  
  4702.       In addition to the utilities which can be called from user
  4703.       menus the following calls can also be made.
  4704.  
  4705.       Run Procedure        :   Runs a pre-defined procedure
  4706.  
  4707.       Last Output          :   Recalls the output from a procedure
  4708.  
  4709.       Data Entry           :   Allows direct access to a form
  4710.  
  4711.       User Menu            :   Calls another user menu
  4712.  
  4713.       System Menus         :   Calls the Easy Base System menus
  4714.  
  4715.       Exit to DOS          :   Terminates Easy Base
  4716.  
  4717.       Run external program : Shells to another program
  4718.  
  4719.       Notes:
  4720.  
  4721.  
  4722.       You cannot run another major program from within Easy Base -
  4723.       there is very little spare memory - this call is however useful
  4724.       for calling batch files which export data to other programs for
  4725.       later use.
  4726.  
  4727.       If you place "Exit to DOS" on a normal menu the user will be
  4728.       asked to confirm that he wishes to exit. If you place it on a
  4729.       batch execute menu he will not.
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.                                 - 80 -
  4756. ................................................................................
  4757.       MIDTEXT                    FUNCTION                     MIDTEXT
  4758.  
  4759.       This function returns a given number of characters from a given
  4760.       starting point in a field or variable.
  4761.  
  4762.       Ex.   Midtext(fileref,4,4)
  4763.             < Returns "Bill" from "TR/Bill/1243"
  4764.  
  4765.  
  4766.       Acceptable parameters:
  4767.  
  4768.       Text field/variable
  4769.       Any function returning a text value
  4770.  
  4771.  
  4772.  
  4773.  
  4774.  
  4775.  
  4776.  
  4777.  
  4778.  
  4779.  
  4780.  
  4781.  
  4782.  
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.                                 - 81 -
  4813. ................................................................................
  4814.       MINUTES                    FUNCTION                     MINUTES
  4815.  
  4816.       This function returns the minutes number from the time field
  4817.       parameter.
  4818.  
  4819.       Ex.    minutes(system time)
  4820.  
  4821.       Ex.
  4822.  
  4823.       Unitsperhour = rounddown(60/(minutes(endtime)-
  4824.       minutes(starttime)))
  4825.  
  4826.       Acceptable parameters:
  4827.  
  4828.       System time
  4829.       Time field
  4830.       Maketime function
  4831.       Time expression
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839.  
  4840.  
  4841.  
  4842.  
  4843.  
  4844.  
  4845.  
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.                                 - 82 -
  4870. ................................................................................
  4871.       MOD                        FUNCTION                         MOD
  4872.  
  4873.       The Mod function returns the remainder of an integer division
  4874.  
  4875.       Ex. surplus rounds = mod(bullets,soldiers * ammoissue)
  4876.  
  4877.  
  4878.       Ex.
  4879.  
  4880.       for Historydates
  4881.          historydates.leapyear = "No"
  4882.          if mod(historydates.year,4) = 0 then
  4883.             historydates.leapyear = "Yes"
  4884.             update record
  4885.          end if
  4886.       next
  4887.       < This example fills a new field "leapyear" which has been
  4888.       added to the "Historydates" form after data has been entered>
  4889.  
  4890.       Acceptable parameters:
  4891.  
  4892.       Numeric value
  4893.       Numeric expression
  4894.       Numeric field/variable
  4895.       Any other function which returns a numeric value
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  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.                                 - 83 -
  4927. ................................................................................
  4928.       MONTH                      FUNCTION                       MONTH
  4929.  
  4930.       This function returns the month number from a date parameter.
  4931.  
  4932.       Ex.    Month(system date)
  4933.  
  4934.       Ex.    Month(birthdate)
  4935.  
  4936.  
  4937.       Acceptable parameters
  4938.  
  4939.       System date
  4940.       Date field
  4941.       Makedate function
  4942.       Date expression
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.                                 - 84 -
  4984. ................................................................................
  4985.       MULTIPLE LINES         PROCEDURE COMMAND         MULTIPLE LINES
  4986.  
  4987.       You can place multiple code instructions on a single line of
  4988.       the code editor by separating them with a colon.
  4989.  
  4990.       Ex.
  4991.  
  4992.       for ledger with lineno = input.lineno
  4993.          ledger.net = input.net:ledger.vat = input.vat
  4994.          ledger.acno = input.acno:ledger.gross = input.gross
  4995.          update record
  4996.       next
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024.  
  5025.  
  5026.  
  5027.  
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034.  
  5035.  
  5036.  
  5037.  
  5038.  
  5039.  
  5040.                                 - 85 -
  5041. ................................................................................
  5042.       Next Batch             Procedure Command             Next Batch
  5043.  
  5044.       The Next Batch command resets the batch menu pointer from
  5045.       within a procedure. By using the Next Batch command you can
  5046.       cause a batch of procedures to repeat without returning to the
  5047.       menu in the same way that you can repeat a single procedure
  5048.       with an input screen.
  5049.  
  5050.       For example, in a variable length invoicing system you might
  5051.       have three procedures on a batch menu. The first procedure
  5052.       selects the current customer and invoice number, the second
  5053.       writes invoice lines to the lineitems form and the third prints
  5054.       the invoice. To have the entire process repeated after each
  5055.       invoice the last line of the last procedure should be:
  5056.  
  5057.       Next Batch 1
  5058.  
  5059.       Similarly, if the user inadvertently selects the wrong customer
  5060.       in the first procedure you can use an input screen field in the
  5061.       second to return to the first.
  5062.  
  5063.       If input.reselect = "yes" then Next Batch 1
  5064.  
  5065.       By using Next Batch and Global Number you can create a batch
  5066.       menu which reacts like a single procedure repeating until the
  5067.       Escape key is pressed.
  5068.  
  5069.       To exit from a batch of procedures on the escape key, set
  5070.       Global Number to 1 in the first procedure and to 0 in the last.
  5071.       Add a procedure immediately after the first with the code:-
  5072.  
  5073.       If Global Number = 0 then exit batch menu
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.                                 - 86 -
  5098. ................................................................................
  5099.       ODD/EVEN PAGE PRINT    PROCEDURE COMMAND    ODD/EVEN PAGE PRINT
  5100.  
  5101.       If you want to print procedure output on both sides of the
  5102.       paper then, unless you have a VERY expensive printer, the only
  5103.       way to achieve this is to print the odd pages, turn your paper
  5104.       over and print the even pages.  For a short report you can do
  5105.       this by setting paper feed to "Manual" from the utilities menu
  5106.       and turning each sheet over individually. If, however, you have
  5107.       a cut sheet feeder or a cartridge fed printer it is much
  5108.       quicker to print all the odd pages, turn them all over and then
  5109.       print all the even pages.
  5110.  
  5111.       To do this in Easy Base, issue the command "Odd Page Print"
  5112.       immediately before the print output and "Even Page Print"
  5113.       immediately after it.
  5114.  
  5115.       declare output fields
  5116.          customers.name : customers.phone
  5117.       end
  5118.       odd page print
  5119.       for customers with surname in order
  5120.          if bottom margin < .75 then page feed
  5121.          print list items
  5122.       next
  5123.       even page print    '(Easy Base pauses here till you are ready)
  5124.  
  5125.       If you will be binding your printed report down the left hand
  5126.       edge then you will need a larger left margin on the odd pages
  5127.       than on the even. If you start odd page printing with the
  5128.       command "Odd Page Print for Binding" then Easy Base will add
  5129.       half an inch to the format left margin when it prints the odd
  5130.       pages. You cannot alter the fixed value of half an inch but if
  5131.       you create your output format with a left margin of half an
  5132.       inch(suitable for the even pages) and print for binding, you
  5133.       will find that the resulting output suits most office binding
  5134.       systems.
  5135.  
  5136.       If you use Odd/Even page printing then it is important that you
  5137.       realize it is achieved by running the portion of your procedure
  5138.       between the "Odd Page Print" and "Even Page Print" twice -
  5139.       simply cancelling output to the printer at the appropriate
  5140.       times.  You must not, therefore include any commands which add,
  5141.       update or delete records between the commands. If you do they
  5142.       will be performed twice. Similarly if you are running a loop
  5143.       counter during the print process then it will have double the
  5144.       expected value after the "Even Page Print" command.
  5145.  
  5146.       The system value "Page Number" is reset to one at the "Even
  5147.       Page Print" command. If you include two separate sets of odd
  5148.       and even printing in a single procedure then you cannot use
  5149.       "Page Number" to number the second printout. You can of course
  5150.       use an ad hoc field. Just remember to reset it to one
  5151.       immediately before the "Even Page Print" command.
  5152.  
  5153.  
  5154.                                 - 87 -
  5155. ................................................................................
  5156.       ODD/EVEN PAGE PRINT    PROCEDURE COMMAND    ODD/EVEN PAGE PRINT
  5157.  
  5158.       This document was written in an Easy Base form "Ref" which has
  5159.       fields "Name", "Type", "Pageno" "Topicpage" and three text
  5160.       block fields "T1", "T2" and "T3". Each record holds one page of
  5161.       the reference manual and the pages were entered in no
  5162.       particular order. The following procedure was used to number,
  5163.       sort, index and print the manual.
  5164.  
  5165.       declare output fields
  5166.          ref.name : ref.type :ref.pageno
  5167.          ref.t1 : ref.t2 : ref.t3 : type : name
  5168.       end
  5169.       declare variables
  5170.          x as number : y as number
  5171.          namelen as number : typelen as number
  5172.       end
  5173.       '.....................NUMBER REFERENCE PAGES....
  5174.       for ref with name in order
  5175.          y = total records
  5176.          x = x + 1
  5177.          display status "Numbering page" + x + "of" + y
  5178.          ref.pageno = x : update record
  5179.       next
  5180.       odd page print for binding
  5181.       '...............PRINT COMMANDS INDEX........
  5182.       bold on : print commandheader : bold off
  5183.       for ref with type = "procedure command"
  5184.          subindex name
  5185.       next
  5186.       for ref with subindex in order
  5187.          if topicpage > 1 then skiprec  'only first page
  5188.          ref.name = proper(ref.name)    'of each topic listed
  5189.          print commands
  5190.       next
  5191.       '..............PRINT SYSTEM VALUES INDEX...
  5192.       bold on : print valuesheader : bold off
  5193.       for ref with type = "system value"
  5194.          subindex name
  5195.       next
  5196.       for ref with subindex in order
  5197.          if topicpage > 1  then skiprec
  5198.          ref.name = proper(ref.name)
  5199.          print values
  5200.       next
  5201.       page feed       '... eject first index page
  5202.  
  5203.       '......... subsequent index pages are produced with exactly
  5204.       '........ the sane code as above and are omitted for clarity.
  5205.  
  5206.       '......................MAIN REFERENCE.............
  5207.       page feed
  5208.       for ref with name in order
  5209.          namelen = lengthtext(ref.name)
  5210.  
  5211.                                 - 88 -
  5212. ................................................................................
  5213.       ODD/EVEN PAGE PRINT    PROCEDURE COMMAND    ODD/EVEN PAGE PRINT
  5214.  
  5215.          typelen = lengthtext(ref.type)
  5216.          '....centre justify type
  5217.          type = jointext(stringof((20-typelen)/2,chr$(255)),ref.type)
  5218.          '....right justify name
  5219.          name = jointext(stringof(20-namelen,chr$(255)),ref.name)
  5220.          bold on : print refheader : bold off  'type and names fields
  5221.          print list items                      't1, t2, t3
  5222.          bold on print reffoot                 'pageno
  5223.          page feed
  5224.       next
  5225.       even page print
  5226.  
  5227.  
  5228.  
  5229.  
  5230.  
  5231.  
  5232.  
  5233.  
  5234.  
  5235.  
  5236.  
  5237.  
  5238.  
  5239.  
  5240.  
  5241.  
  5242.  
  5243.  
  5244.  
  5245.  
  5246.  
  5247.  
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.                                 - 89 -
  5269. ................................................................................
  5270.       Open                     File Command                      Open
  5271.  
  5272.       The "Open" command is used to open a non-Easy Base file.
  5273.  
  5274.       The filename can be supplied within quotes or as a text
  5275.       variable or field.
  5276.  
  5277.       The filename can include a complete path. If a path is not
  5278.       included then the file is opened in the Easy Base System
  5279.       directory.
  5280.  
  5281.       If the filename supplied is that of an existing file, that file
  5282.       is opened for access with the Read or Write commands. If there
  5283.       is no file with the supplied filename then a new file with that
  5284.       name is created and opened.
  5285.  
  5286.       Ex.
  5287.  
  5288.       Open "C:\config.sys"
  5289.  
  5290.       Open Files.name
  5291.  
  5292.       Open jointext("C:\wp\",input.filename)
  5293.  
  5294.       See also: Close, Seek, Read, Write, Find, Erase
  5295.  
  5296.  
  5297.  
  5298.  
  5299.  
  5300.  
  5301.  
  5302.  
  5303.  
  5304.  
  5305.  
  5306.  
  5307.  
  5308.  
  5309.  
  5310.  
  5311.  
  5312.  
  5313.  
  5314.  
  5315.  
  5316.  
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.                                 - 90 -
  5326. ................................................................................
  5327.       OPERATORS                 ARITHMETIC                  OPERATORS
  5328.  
  5329.       The arithmetic operators used in Easy Base are:-
  5330.  
  5331.       +   (addition)
  5332.  
  5333.       -   (subtraction and negation)
  5334.  
  5335.       *   (multiplication)
  5336.  
  5337.       /   (division)
  5338.  
  5339.       ^   (exponentiation)
  5340.  
  5341.       Where there are multiple operators in a derivation they are
  5342.       processed with the following precedence:-
  5343.  
  5344.       1.   Exponentiation
  5345.       2.   Negation
  5346.       3.   Multiplication and Division
  5347.       4.   Addition and Subtraction
  5348.  
  5349.       The default precedence can be altered by the use of
  5350.       parenthesis.
  5351.  
  5352.            Easy base does not perform Integer Arithmetic.
  5353.  
  5354.       When a numeric field shows the result of a division the
  5355.       "displayed" number is "truncated" to an integer in Integer
  5356.       fields and has the last digit rounded in Fixed Point and
  5357.       Floating Point fields.  The "Stored" value which is used in any
  5358.       further calculations, however, is always correct to 15
  5359.       significant figures irrelevant of field type.  For Example: If
  5360.       three fields x,y and z are defined as integers, y is derived as
  5361.       x/4 and z is derived as y*4 then when 9 is entered in x, y will
  5362.       derive as 2 but z will derive as 9 because it multiplies the
  5363.       "stored value" of 2.25 by 4 not the displayed value of 2.
  5364.  
  5365.       Handling arithmetic in this way means that, by default there
  5366.       are no rounding errors. This has several advantages not least
  5367.       that currency values need only ever be defined to two decimal
  5368.       places.
  5369.  
  5370.       It does mean, however, that should you require rounding errors
  5371.       to be carried forward you must use one of the Easy Base
  5372.       rounding functions on the result of any intermediate division.
  5373.  
  5374.       In the above example, had y been derived as "round(x/4)" then z
  5375.       would derive as 8.
  5376.  
  5377.       If a fourth field had the formula:- if(y = 2,5,10) it would
  5378.       only derive as 5 if y had been rounded or if 8 had been entered
  5379.       in x.
  5380.  
  5381.  
  5382.                                 - 91 -
  5383. ................................................................................
  5384.       OPERATORS                 RELATIONAL                  OPERATORS
  5385.  
  5386.       Easy base uses the following relational operators:-
  5387.  
  5388.       =    (equals)
  5389.       <>   (not equals)
  5390.       >    (greater than)
  5391.       <    (less than)
  5392.       >=   (greater than or equal to)
  5393.       <=   (less than or equal to)
  5394.  
  5395.  
  5396.       Where relational operators and arithmetic operators are both
  5397.       used in a derivation. Relational operations are performed after
  5398.       arithmetic operations.
  5399.  
  5400.       Text values are not case sensitive when compared with
  5401.       relational operators.
  5402.  
  5403.       When you compare two fields or variables, the comparison is
  5404.       numeric if both are numeric and alphabetic if both are
  5405.       alphabetic.  If you compare a numeric field with a text field
  5406.       then Easy Base will test to see if the text field contains a
  5407.       number.  If it does then the comparison will be numeric and if
  5408.       it does not then the comparison will be alphabetic.
  5409.  
  5410.       WARNING
  5411.  
  5412.       If you compare the result of a division in an integer or fixed
  5413.       point field using the = or the <> operators, then the value
  5414.       used for comparison will be the (accurate) stored value and not
  5415.       the "Truncated" number shown in the field.
  5416.  
  5417.       See Operators Arithmetic
  5418.  
  5419.  
  5420.  
  5421.  
  5422.  
  5423.  
  5424.  
  5425.  
  5426.  
  5427.  
  5428.  
  5429.  
  5430.  
  5431.  
  5432.  
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.  
  5439.                                 - 92 -
  5440. ................................................................................
  5441.       OPERATORS                  LOGICAL                    OPERATORS
  5442.  
  5443.       Easy Base uses the following logical operators:-
  5444.  
  5445.       1.  and
  5446.       2.  or
  5447.       3.  xor     (or exclusive)
  5448.       4.  eqv     (equivalence)
  5449.       5.  imp     (implication)
  5450.  
  5451.       Logical operations are performed last after arithmetic and
  5452.       relational.
  5453.  
  5454.       Logical operators return a boolean (true or false) value from
  5455.       two other boolean expressions.
  5456.  
  5457.       Ex.
  5458.  
  5459.       If(x = y and a = b,"Yes","No")
  5460.          < Yes is returned if both expressions are true >
  5461.  
  5462.       If(x = y or a = b,"Yes","No")
  5463.          < Yes is returned if either or both expressions are true >
  5464.  
  5465.       If(x = y xor a = b,"Yes","No")
  5466.          < Yes is returned if either one but not both are true >
  5467.  
  5468.       If(x = y eqv a = b,"Yes","No")
  5469.          < Yes is returned if both expressions are true or if both
  5470.            expressions are false >
  5471.  
  5472.       If(x = y imp a = b,"Yes","No")
  5473.  
  5474.          < Yes is returned for all combinations except the first
  5475.            expression being true and the second false >
  5476.  
  5477.       The Easy Base logical operators are primarily designed for use
  5478.       within the "If" function and in "If..Then..Else" constructions
  5479.       where their actual value is not relevant. If you wish to use
  5480.       the value of "false" in formulae then it is represented by 0.
  5481.       True can be represented by any value other than 0 and should
  5482.       not be used.
  5483.  
  5484.  
  5485.  
  5486.  
  5487.  
  5488.  
  5489.  
  5490.  
  5491.  
  5492.  
  5493.  
  5494.  
  5495.  
  5496.                                 - 93 -
  5497. ................................................................................
  5498.       OPTIONS                    UTILITY                      OPTIONS
  5499.  
  5500.       The "Options" utility allows you to select your preferred date
  5501.       format (European or North American).
  5502.  
  5503.       You can also enable or disable screen saving. If enabled the
  5504.       screen saver operates after three minutes without a keypress
  5505.       during record entry, procedure screen entry or if a menu is
  5506.       being displayed. The screensaver is never invoked while a
  5507.       procedure is running or while reformatting or re-indexing is
  5508.       taking place.
  5509.  
  5510.       The third option allows you to select the border style you
  5511.       require around menus and message boxes.
  5512.  
  5513.       Option four selects whether or not screen clearing will be done
  5514.       with the curtain effect.
  5515.  
  5516.       Option five selects the COM port which will be used during
  5517.       Auto-dialling.
  5518.  
  5519.       The options utility can be called as a user menu function so
  5520.       that an end user can access the facilities without access to
  5521.       the system menus.
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.  
  5553.                                 - 94 -
  5554. ................................................................................
  5555.       OUTPUT                   SYSTEM VALUE                    OUTPUT
  5556.  
  5557.       When a user runs a procedure his choice of output, screen,
  5558.       printer or disk is stored in the system value "Output".
  5559.  
  5560.       By accessing the system value "Output" you can make your
  5561.       procedure do different things depending on where the output is
  5562.       to be sent.
  5563.  
  5564.       Ex.
  5565.  
  5566.       if output = "screen" then
  5567.          print heading1
  5568.       else
  5569.          print heading2
  5570.       end if
  5571.  
  5572.  
  5573.  
  5574.  
  5575.  
  5576.  
  5577.  
  5578.  
  5579.  
  5580.  
  5581.  
  5582.  
  5583.  
  5584.  
  5585.  
  5586.  
  5587.  
  5588.  
  5589.  
  5590.  
  5591.  
  5592.  
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.                                 - 95 -
  5611. ................................................................................
  5612.       PACK DATA FORMS            UTILITY              PACK DATA FORMS
  5613.  
  5614.       The process of actually removing a deleted record from a form
  5615.       is time consuming. What actually happens is that all the "Live"
  5616.       records are copied to a temporary file. The original file is
  5617.       then deleted and the temporary one re-named to the original
  5618.       name. Because of this it is actually quicker to remove fifty
  5619.       "Dead" records than it is to remove one. To save you time Easy
  5620.       base follows the traditional data-base custom of simply marking
  5621.       records for deletion when you delete them. They are only
  5622.       physically removed from the form during a "Pack" operation.
  5623.       When you "Pack" a data file Easy Base also re-writes all the
  5624.       index files for that form. You can pack individual forms with
  5625.       the "Pack Data Forms" utility accessed from the Utilities menu.
  5626.       You can also call the "Pack Data Forms" utility as a User menu
  5627.       function. In a finished application any necessary packing would
  5628.       normally be done from a batch execute menu which would run
  5629.       while the computer was unattended.
  5630.  
  5631.       Forms in which records are regularly deleted should be packed
  5632.       regularly. If packing is not done then not only will you be
  5633.       wasting disk space but search operations will become
  5634.       progressively slower as the percentage of "Dead" records
  5635.       increases.
  5636.  
  5637.       This is fairly obvious - however it is not so obvious that a
  5638.       forms index files can accumulate "Dead" records even though
  5639.       none have been deleted from the main file. An index file is
  5640.       simply the indexed fields contents and record number arranged
  5641.       in order. If, having filed a record you then alter the contents
  5642.       of an indexed field and update the record then the original
  5643.       record in the index file is deleted and a new one entered.
  5644.  
  5645.       Index files with "Dead records" also waste disk space and slow
  5646.       search operations. You should therefore regularly pack any
  5647.       forms which are regularly updated.
  5648.  
  5649.       If you are unsure which forms need to be packed you can use the
  5650.       "Auto-Pack" utility which tests each form and each forms index
  5651.       files for "Dead" records. The form is packed if it or any of
  5652.       its index files is found to have more then 100 total or 10 per
  5653.       cent "Dead" records.
  5654.  
  5655.       Although "Auto-Pack" may seem the easy answer, an application
  5656.       will almost certainly have several forms with "Core" data which
  5657.       remain unchanged and therefore never require packing. If you
  5658.       can identify the forms which do need to be packed and do them
  5659.       individually or from a batch execute menu this will be less
  5660.       time consuming than always using the "Auto-Pack" facility.
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.                                 - 96 -
  5668. ................................................................................
  5669.       PAGE NUMBER              SYSTEM VALUE               PAGE NUMBER
  5670.  
  5671.       Whenever Easy Base is processing a procedure with an output it
  5672.       keeps track of the current page number (Even if you have not
  5673.       included Page Feed commands). You can use the system value
  5674.       "Page Number" to number the pages of your output. To use the
  5675.       "Page Number" value just include "Page Number" in your output
  5676.       field declarations.
  5677.  
  5678.       Declare output fields
  5679.          Customers.name : Customers.ACNO : Page Number
  5680.       end
  5681.  
  5682.       You can then use the "Page Number" field in the Page Header or
  5683.       Page Footer section of your output format.
  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.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.                                 - 97 -
  5725. ................................................................................
  5726.       PAUSE ON/OFF           PROCEDURE COMMAND           PAUSE ON/OFF
  5727.  
  5728.       When an Easy Base procedure has an output to the screen, the
  5729.       output, by default scrolls continuously until the procedure is
  5730.       complete. You can allow the user to pause the output with the
  5731.       "Pause On" and "AutoPause On" commands.
  5732.  
  5733.       If a procedure performs several tasks then the pause facility
  5734.       can be selectively enabled and disabled at any point.
  5735.  
  5736.       Ex.
  5737.  
  5738.       for employees alias types with type in order unique
  5739.          pause off:escape off
  5740.          for employees alias group with type = types.type
  5741.             subindex surname
  5742.          next
  5743.          pause on
  5744.          for employees with subindex in order
  5745.             print list items
  5746.          next
  5747.       next
  5748.  
  5749.       The above code fragment prints employees details in type groups
  5750.       with surname in alphabetic order. During the procedure the user
  5751.       can pause the report while it is listing the output but not
  5752.       while it is subindexing the group.
  5753.  
  5754.       If you set pausing with "Pause On" then the user can pause the
  5755.       output at any point by pressing the return key. If you set
  5756.       pausing with "Autopause On" then the output stops after each
  5757.       screen page of output.
  5758.  
  5759.       If you set "Autopause On" and "Escape On" then the first press
  5760.       of the Escape key cancels the autopausing and the second press
  5761.       terminates the output.
  5762.  
  5763.       "Pause Off" cancels either.
  5764.  
  5765.       If a procedure has pausing set by "Autopause On" and its output
  5766.       is directed to the printer, Easy Base automatically switches to
  5767.       "Pause On"
  5768.  
  5769.       See also: Escape On/Off
  5770.  
  5771.  
  5772.  
  5773.  
  5774.  
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.                                 - 98 -
  5782. ................................................................................
  5783.       PI                       SYSTEM VALUE                        PI
  5784.  
  5785.       You can use the value of π anywhere in field derivations or
  5786.       procedure code by quoting "Pi".
  5787.  
  5788.       Ex     circlearea = Pi / 4 diam^2
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.  
  5814.  
  5815.  
  5816.  
  5817.  
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.  
  5824.  
  5825.  
  5826.  
  5827.  
  5828.  
  5829.  
  5830.  
  5831.  
  5832.  
  5833.  
  5834.  
  5835.  
  5836.  
  5837.  
  5838.                                 - 99 -
  5839. ................................................................................
  5840.       PRESELECT              PROCEDURE COMMAND              PRESELECT
  5841.  
  5842.       The "Preselect" command sets highlighting of the next user menu
  5843.       when the procedure terminates.  If a procedure is normally
  5844.       followed by a particular selection from the menu then you can
  5845.       save the user the trouble of choosing it by issuing the
  5846.       "Preselect" command within the procedure.
  5847.  
  5848.       for currentcustomer
  5849.          currentcustomer.acno = input.acno
  5850.          update record
  5851.       next
  5852.       preselect 4
  5853.  
  5854.       The parameter cannot be supplied as a variable.
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.  
  5885.  
  5886.  
  5887.  
  5888.  
  5889.  
  5890.  
  5891.  
  5892.  
  5893.  
  5894.  
  5895.                                 - 100 -
  5896. ................................................................................
  5897.       PRINT                  PROCEDURE COMMAND                  PRINT
  5898.  
  5899.       In Easy Base procedures, all output to the screen or printer is
  5900.       initiated with the "Print" command. The "Print" command prints
  5901.       sections from the procedures output format.
  5902.  
  5903.       Ex.
  5904.  
  5905.       '......................procedure code....
  5906.       Print report header
  5907.       for customers
  5908.          print list items
  5909.       next
  5910.       print report footer
  5911.       '......................Output Format.......
  5912.       .Report Header
  5913.             ════════════════════════════════════════════════
  5914.                           Customer List
  5915.             ════════════════════════════════════════════════
  5916.       .List Items
  5917.             {customers.name field}  {customers.phone field}
  5918.       .Report Footer
  5919.             ════════════════════════════════════════════════
  5920.       .end
  5921.  
  5922.       The format sections are marked with a full stop in the margin
  5923.       followed by the section name. When you type a full stop in the
  5924.       margin of the "Format editor" Easy Base will offer you a
  5925.       selection of section names. You do not have to use these - they
  5926.       are just some common names that can save you time. To enter
  5927.       your own section names just press escape and type in any name
  5928.       you wish.
  5929.  
  5930.       The ".end" section is not strictly necessary but it is easy to
  5931.       accidentally insert blank lines at the end of your format. By
  5932.       inserting ".end" at the end of the last section you will
  5933.       prevent these from being printed.
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.  
  5948.  
  5949.  
  5950.  
  5951.  
  5952.                                 - 101 -
  5953. ................................................................................
  5954.       PRINTER CONTROL        PROCEDURE COMMAND        PRINTER CONTROL
  5955.  
  5956.       When you send a procedure output to the printer Easy Base will
  5957.       initialize your printer at ten characters per inch, six lines
  5958.       per inch in draft mode.
  5959.  
  5960.       You can alter the printer mode anywhere within a procedure with
  5961.       the following printer controls.
  5962.  
  5963.       Bold On            Bold Off
  5964.       Underline On       Underline Off  (Underlines field contents)
  5965.       Italic On          Italic Off
  5966.       NLQ On             NLQ Off
  5967.  
  5968.       8 lpi      Sets printing to eight lines per inch
  5969.       6 lpi      Sets printing to six lines per inch
  5970.       10 cpi     Sets printing to ten characters per inch
  5971.       12 cpi     Sets printing to twelve characters per inch
  5972.       17 cpi     sets printing to either 15 or 17 depending on
  5973.                  printer
  5974.       Line Feed  Advances the print head one line
  5975.       Page Feed  Ejects the current page.
  5976.  
  5977.       Ex.
  5978.       NLQ On
  5979.       Bold on
  5980.       Print report header
  5981.       Bold Off
  5982.       12 CPI
  5983.       For customers
  5984.          print list items
  5985.          if bottom margin < 1.5 then
  5986.             Line feed : Bold On : 10 CPI
  5987.             Print Page footer
  5988.             Page feed
  5989.             Print Page header
  5990.             Bold Off : 12 CPI
  5991.          end if
  5992.       next
  5993.       Bold on:Italic On :10 CPI
  5994.       print report footer
  5995.  
  5996.       The above example turns Near Letter Quality printing on for the
  5997.       entire report. It prints page headers and footers in bold at 10
  5998.       characters per inch, list items at 12 characters per inch and
  5999.       the report footer in bold italics.
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.                                 - 102 -
  6010. ................................................................................
  6011.       Prog_Dir                 System Value                  Prog_Dir
  6012.  
  6013.       Whenever you run a procedure in Easy Base the drive and
  6014.       directory of the program files is available in the system value
  6015.       Prog_Dir.
  6016.  
  6017.       If you write applications for resale on the Easy Base Runtime
  6018.       module then you will not necessarily know the name of the
  6019.       directory to which the end user has installed your application.
  6020.       If your application opens external files you can ensure that
  6021.       they are in the Application directory by using Prog_Dir.
  6022.  
  6023.  
  6024.       declare variables
  6025.          pathfile as text
  6026.       end
  6027.       pathfile = jointext(Prog_Dir,"\NAMES.TXT")
  6028.       open pathfile
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.                                 - 103 -
  6067. ................................................................................
  6068.       PROPER                     FUNCTION                      PROPER
  6069.  
  6070.       This function returns the parameter with the first letter of
  6071.       each word in upper case and the rest in lower case. If you wish
  6072.       to enter initials in a field derived as proper and keep them in
  6073.       upper case then there must either be a space or a full stop
  6074.       between them.
  6075.  
  6076.       Ex.     Proper(Address)
  6077.  
  6078.       Ex.
  6079.  
  6080.       labelname = upper(company.name)
  6081.       insetname = proper(company.name)
  6082.  
  6083.  
  6084.       Acceptable parameters:
  6085.  
  6086.       Quoted text
  6087.       Text field/variable
  6088.  
  6089.  
  6090.  
  6091.  
  6092.  
  6093.  
  6094.  
  6095.  
  6096.  
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.                                 - 104 -
  6124. ................................................................................
  6125.       RANDOM                     FUNCTION                      RANDOM
  6126.  
  6127.       This function returns a random number between the upper and
  6128.       lower parameters.
  6129.  
  6130.       Ex.  Random(1,100)
  6131.          <Returns a random number between 1 and 100>
  6132.  
  6133.       Ex.  The two fields No and card simulate the random cutting of
  6134.       a deck of cards each time the No field is cleared.
  6135.  
  6136.       No field derivation:-
  6137.           if(no <> blank,no,random(1,52))
  6138.  
  6139.       Card field derivation:-
  6140.  
  6141.           jointext(if(mod(no,13) = 1,"Ace",mod(no,13) = 0,"King",
  6142.       mod(no,13) = 12,"Queen",mod(no,13) = 11,"Jack",mod(no,13)),
  6143.       " of ",if(no < 14,"Hearts",no < 27 ,"Clubs",no <40,"Diamonds",
  6144.       ,"Spades"))
  6145.  
  6146.  
  6147.       Acceptable parameters
  6148.  
  6149.       Numeric Value
  6150.       Numeric expression
  6151.       Numeric field/variable
  6152.       Any other function which returns a numeric value
  6153.  
  6154.  
  6155.  
  6156.  
  6157.  
  6158.  
  6159.  
  6160.  
  6161.  
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.  
  6173.  
  6174.  
  6175.  
  6176.  
  6177.  
  6178.  
  6179.  
  6180.                                 - 105 -
  6181. ................................................................................
  6182.       Read                     File Command                      Read
  6183.  
  6184.       The "Read" command reads data from a non Easy Base file which
  6185.       has been opened with the "Open" command.
  6186.  
  6187.       The syntax is:
  6188.       Read (Length) to (Field or variable)
  6189.  
  6190.       Length can be absolute, a variable or field or the keyword
  6191.       "Line".
  6192.  
  6193.       Ex.
  6194.  
  6195.       Read 45 to Keyvar
  6196.       Read GetLen to customers.name
  6197.       Read Line to Linestring
  6198.  
  6199.       In the "Line" example Easy Base reads from the current File_pos
  6200.       to the end of the current ASCII line.
  6201.  
  6202.       See also: Open, Close, Seek, Write, Find, Erase
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.  
  6212.  
  6213.  
  6214.  
  6215.  
  6216.  
  6217.  
  6218.  
  6219.  
  6220.  
  6221.  
  6222.  
  6223.  
  6224.  
  6225.  
  6226.  
  6227.  
  6228.  
  6229.  
  6230.  
  6231.  
  6232.  
  6233.  
  6234.  
  6235.  
  6236.  
  6237.                                 - 106 -
  6238. ................................................................................
  6239.       REBUILD DIRECTORIES        UTILITY          REBUILD DIRECTORIES
  6240.  
  6241.       In Easy Base, all DOS file handling is taken care of for you in
  6242.       the background. To do this Easy Base maintains three
  6243.       "Directory" files in which the names which you give to forms,
  6244.       procedures and choice field lists are linked to the actual DOS
  6245.       filenames.
  6246.  
  6247.       The three files are :-
  6248.  
  6249.       BASE.DIR     The forms directory
  6250.       PROC.DIR     The procedures directory
  6251.       CHOICES.DIR  The choice list directory
  6252.  
  6253.       Because these are key files, Easy Base includes a utility which
  6254.       will rebuild them in the event of accidental erasure or
  6255.       corruption.
  6256.  
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.  
  6278.  
  6279.  
  6280.  
  6281.  
  6282.  
  6283.  
  6284.  
  6285.  
  6286.  
  6287.  
  6288.  
  6289.  
  6290.  
  6291.  
  6292.  
  6293.  
  6294.                                 - 107 -
  6295. ................................................................................
  6296.       RECORD NUMBER            SYSTEM VALUE             RECORD NUMBER
  6297.  
  6298.       If you derive a field with the formula "record number" it will
  6299.       be filled with the record number at the time of filing or
  6300.       reformatting.  Record number differs from "sequence" in the
  6301.       following way. Each time you derive a field with "sequence" you
  6302.       get the next sequencial number irrespective of whether the form
  6303.       has had records deleted and has been repacked. If a file has
  6304.       had at some time 500 records but now only has 20 the next
  6305.       derivation of "sequence" will be 501 and the next derivation of
  6306.       "record number" will be 21.
  6307.  
  6308.       The main use of "record number" is to renumber a set of records
  6309.       after deletions. To do this just add a new field to the form
  6310.       derived as record number. The field will be filled
  6311.       automatically during the data reformatting process.
  6312.  
  6313.       Record Number has no meaning in procedure code.
  6314.  
  6315.       See Also:-  Current Record Number
  6316.  
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  
  6341.  
  6342.  
  6343.  
  6344.  
  6345.  
  6346.  
  6347.  
  6348.  
  6349.  
  6350.  
  6351.                                 - 108 -
  6352. ................................................................................
  6353.       REMARK                 PROCEDURE COMMAND                 REMARK
  6354.  
  6355.       You can place remarks anywhere within Easy base procedure code
  6356.       by prefixing them with an apostrophe.
  6357.  
  6358.       Ex.
  6359.  
  6360.       '.................This entire line is a remark.....
  6361.       for pupils with age > 9
  6362.          if grade = "g" then skip record   'exclude g's from count
  6363.          count = count + 1                 'These are remarks
  6364.       next
  6365.       '..............................................
  6366.  
  6367.       All text to the right of the apostrophe is ignored at run time.
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.                                 - 109 -
  6409. ................................................................................
  6410.       RESTORE                    UTILITY                      RESTORE
  6411.  
  6412.       Easy Base will restore applications or data which it has backed
  6413.       up. You can only restore an application with the "Restore
  6414.       Application" utility called from the utilities menu and you can
  6415.       only restore data-only backups with the "Restore Data" utility
  6416.       called from a user menu.
  6417.  
  6418.  
  6419.       See Also:-  Backup
  6420.  
  6421.  
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.  
  6428.  
  6429.  
  6430.  
  6431.  
  6432.  
  6433.  
  6434.  
  6435.  
  6436.  
  6437.  
  6438.  
  6439.  
  6440.  
  6441.  
  6442.  
  6443.  
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.                                 - 110 -
  6466. ................................................................................
  6467.       RETAIL                     FUNCTION                      RETAIL
  6468.  
  6469.       The retail function returns the retail price given the
  6470.       wholesale price and the discount as a percentage of retail.
  6471.  
  6472.       Ex   Retail(cost,discount)
  6473.  
  6474.            < returns 125 if cost = 100 and discount = 20>
  6475.  
  6476.  
  6477.  
  6478.  
  6479.  
  6480.  
  6481.  
  6482.  
  6483.  
  6484.  
  6485.  
  6486.  
  6487.  
  6488.  
  6489.  
  6490.  
  6491.  
  6492.  
  6493.  
  6494.  
  6495.  
  6496.  
  6497.  
  6498.  
  6499.  
  6500.  
  6501.  
  6502.  
  6503.  
  6504.  
  6505.  
  6506.  
  6507.  
  6508.  
  6509.  
  6510.  
  6511.  
  6512.  
  6513.  
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.                                 - 111 -
  6523. ................................................................................
  6524.       RETEST                 DERIVATION PREFIX                 RETEST
  6525.  
  6526.       In Easy Base, fields are derived when a new record is started
  6527.       and when any other field which affects the derivation is
  6528.       changed. You can force a field to be rederived when F2 is
  6529.       pressed by prefixing the derivation with "retest".
  6530.  
  6531.       Suppose you have a field "degrees" in which the user must enter
  6532.       a number between 1 and 360.
  6533.  
  6534.       To prevent him entering an out of range number you could derive
  6535.       the field :-
  6536.  
  6537.       If(degrees<1 or degrees > 360,blank[beepInvalid number of
  6538.       degreesCursor degrees],degrees)
  6539.  
  6540.       The above derivation would prevent the user from filing a
  6541.       record with an out of range number. However, by the time he
  6542.       read the message, his entry would be blanked out. It would be
  6543.       better if the number he had typed could be left in the field so
  6544.       that he could see his error. To do this all you have to do is
  6545.       change "blank" to "degrees" in the above derivation.
  6546.  
  6547.       This however would allow the user ( Should he decide to ignore
  6548.       the message ) to then file the incorrect value. To leave the
  6549.       value in the field and still prevent the user from filing it,
  6550.       use the "retest" prefix.
  6551.  
  6552.       Retest If(degrees<1 or degrees > 360,degrees[beepInvalid number
  6553.       of degreesCursor degrees],degrees)
  6554.  
  6555.  
  6556.       Note:-
  6557.  
  6558.       1. You can have more than one prefix on any one field
  6559.          derivation provided there is a space between each.
  6560.  
  6561.  
  6562.  
  6563.  
  6564.  
  6565.  
  6566.  
  6567.  
  6568.  
  6569.  
  6570.  
  6571.  
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.                                 - 112 -
  6580. ................................................................................
  6581.       REVERSE                    FUNCTION                     REVERSE
  6582.  
  6583.       The reverse function is used in the creation of compound index
  6584.       fields. What it actually does is alter the characters of the
  6585.       parameter in such a way that an alphabetic listing of a field
  6586.       after reversal will have the reverse order to that of the
  6587.       original characters before using the reverse function.
  6588.  
  6589.       In the example shown for the function "zeropad", had you wished
  6590.       to list the pupils in descending age order there would be no
  6591.       point in using the procedure code:
  6592.  
  6593.       for pupils with unifield in reverse order
  6594.  
  6595.       as this would not only reverse the age grouping but would also
  6596.       reverse the name order.
  6597.  
  6598.       To produce the desired printout use exactly the same procedure
  6599.       but derive "unifield" as:-
  6600.  
  6601.       Jointext(reverse(zeropad(age,2,0)),name)
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.  
  6608.  
  6609.  
  6610.  
  6611.  
  6612.  
  6613.  
  6614.  
  6615.  
  6616.  
  6617.  
  6618.  
  6619.  
  6620.  
  6621.  
  6622.  
  6623.  
  6624.  
  6625.  
  6626.  
  6627.  
  6628.  
  6629.  
  6630.  
  6631.  
  6632.  
  6633.  
  6634.  
  6635.  
  6636.                                 - 113 -
  6637. ................................................................................
  6638.       RIGHTTEXT                  FUNCTION                   RIGHTTEXT
  6639.  
  6640.       This function returns a specified number of characters from the
  6641.       end of a field or variable.
  6642.  
  6643.       Ex    Righttext(name,10)
  6644.  
  6645.  
  6646.       Ex.   Righttext(datetext(system date),4)
  6647.             < returns  1993 , 1994 Etc.>
  6648.  
  6649.  
  6650.       Acceptable parameters:
  6651.  
  6652.       Text field/variable
  6653.       Any function returning a text value
  6654.  
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661.  
  6662.  
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.  
  6673.  
  6674.  
  6675.  
  6676.  
  6677.  
  6678.  
  6679.  
  6680.  
  6681.  
  6682.  
  6683.  
  6684.  
  6685.  
  6686.  
  6687.  
  6688.  
  6689.  
  6690.  
  6691.  
  6692.  
  6693.                                 - 114 -
  6694. ................................................................................
  6695.       ROUND                      FUNCTION                       ROUND
  6696.  
  6697.       There are three rounding functions in Easy base:-
  6698.  
  6699.       Round
  6700.       Roundup
  6701.       Rounddown
  6702.  
  6703.       If a rounding function is called with a single parameter then
  6704.       the return value is the parameter rounded to the nearest
  6705.       integer value.
  6706.  
  6707.       Ex. Round(items/reps)
  6708.          < if items = 9 and reps = 4. 2 is returned >
  6709.  
  6710.       All rounding functions accept a second parameter indicating the
  6711.       number of decimal places (or powers of 10 if negative) to round
  6712.       to.
  6713.  
  6714.       Ex. Rounddown(vaton(net),2)
  6715.          < Rounds down the VAT on field "net" to the nearest penny.
  6716.  
  6717.       Ex. Jointext(roundup(if(mod(years,100) = 0,years+1,years),-2
  6718.           )/100,"th Century")
  6719.  
  6720.         < Returns "20th Century" for all values of years 1900-1999 >
  6721.  
  6722.  
  6723.       Round Produces a default rounding system in which:-
  6724.  
  6725.          2.4 rounds to  2
  6726.          2.5 rounds to  3
  6727.         -2.4 rounds to -2
  6728.         -2.5 rounds to -3
  6729.  
  6730.       In the Roundup and Rounddown functions the direction is sign
  6731.       sensitive:-
  6732.  
  6733.          2.5 roundsup to  3      2.5 roundsdown to  2
  6734.         -2.5 roundsup to -2     -2.5 roundsdown to -3
  6735.  
  6736.       Acceptable parameters:
  6737.  
  6738.       Numeric value
  6739.       Numeric expression
  6740.       Numeric field/variable
  6741.       Any other function which returns a numeric value
  6742.  
  6743.  
  6744.  
  6745.  
  6746.  
  6747.  
  6748.  
  6749.  
  6750.                                 - 115 -
  6751. ................................................................................
  6752.       RUN                      FIELD CONTROL                      RUN
  6753.  
  6754.       The "run" control is used to initiate procedures with input
  6755.       screens without the user having to press F2.
  6756.  
  6757.       Ex.   If(lookup(customers,name) = blank,blank,lookup(customers,
  6758.             name)[run])
  6759.  
  6760.       In the above example, a procedure which lists customers
  6761.       accounts has an input screen with a single field where the
  6762.       customers name is entered. When the user enters a name the
  6763.       above derivation will test whether or not the entered name is a
  6764.       customer. If the entered name does not exist in the customers
  6765.       file the field will be blanked out but if it does then the
  6766.       procedure will run without the user having to press F2.
  6767.  
  6768.  
  6769.  
  6770.  
  6771.  
  6772.  
  6773.  
  6774.  
  6775.  
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.  
  6788.  
  6789.  
  6790.  
  6791.  
  6792.  
  6793.  
  6794.  
  6795.  
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.  
  6806.  
  6807.                                 - 116 -
  6808. ................................................................................
  6809.       RUN                    PROCEDURE COMMAND                    RUN
  6810.  
  6811.       The "Run" command terminates the current procedure and starts
  6812.       another.
  6813.  
  6814.       The "Run" command can be used to chain procedures similar to
  6815.       placing them on a batch execute menu. Its main use, however, is
  6816.       to branch to other procedures depending on which function key
  6817.       was pressed from the input screen. Procedures can be initiated
  6818.       from their input screens by pressing any of the function keys
  6819.       F2, F4, F5, F7, F8, F9 or F10. The number of the function key
  6820.       which was pressed is returned in the system value "Fun_Key". If
  6821.       the procedure was initiated by the field control [Run] then the
  6822.       Fun_Key value returns 0.
  6823.  
  6824.       Example.
  6825.  
  6826.       If Fun_Key = 7 then Run Import1
  6827.       If Fun_Key = 8 then Run Import2
  6828.       If Fun_key = 2 then
  6829.          for customers with name = input.name
  6830.             print list items
  6831.          next
  6832.       end if
  6833.  
  6834.       If you press F1 after typing "Run" in the procedure code
  6835.       editor, Easy Base will list all your procedure names for you to
  6836.       pick from and ensure correct spelling.
  6837.  
  6838.       The Run command only transfers control to the next procedure
  6839.       when the main procedure is executed from a user menu. When you
  6840.       are developing your procedures in the procedure generator the
  6841.       called procedure cannot be loaded. If the code for a procedure
  6842.       being tested in the procedure generator reaches a "Run"
  6843.       command, the test ends with the message "Run call made to..OK"
  6844.       to let you know that the call will be made when the procedure
  6845.       is run live from a user menu.
  6846.  
  6847.       See also: Fun_Key Disable
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.  
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.                                 - 117 -
  6865. ................................................................................
  6866.       SCREEN COLOURS             UTILITY               SCREEN COLOURS
  6867.  
  6868.       The "Screen Colours" utility provides 14 pre defined colour
  6869.       sets including two for "Mono Graphics" cards together with a
  6870.       user defined setup. To change the colours of your system simply
  6871.       select "Screen Colours" from the Utilities menu and select the
  6872.       set you want.
  6873.  
  6874.       The "Screen Colours" utility can also be called as a User Menu
  6875.       function allowing an end user to change his screen set from
  6876.       your menus without accessing the system.
  6877.  
  6878.  
  6879.  
  6880.  
  6881.  
  6882.  
  6883.  
  6884.  
  6885.  
  6886.  
  6887.  
  6888.  
  6889.  
  6890.  
  6891.  
  6892.  
  6893.  
  6894.  
  6895.  
  6896.  
  6897.  
  6898.  
  6899.  
  6900.  
  6901.  
  6902.  
  6903.  
  6904.  
  6905.  
  6906.  
  6907.  
  6908.  
  6909.  
  6910.  
  6911.  
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.  
  6918.  
  6919.  
  6920.  
  6921.                                 - 118 -
  6922. ................................................................................
  6923.       SECONDS                    FUNCTION                     SECONDS
  6924.  
  6925.       This function returns the seconds number from the time
  6926.       parameter.
  6927.  
  6928.       Ex.    seconds(system time)
  6929.  
  6930.  
  6931.       Acceptable parameters:
  6932.  
  6933.       System time
  6934.       Time field
  6935.       Maketime function
  6936.       Time expression
  6937.  
  6938.  
  6939.  
  6940.  
  6941.  
  6942.  
  6943.  
  6944.  
  6945.  
  6946.  
  6947.  
  6948.  
  6949.  
  6950.  
  6951.  
  6952.  
  6953.  
  6954.  
  6955.  
  6956.  
  6957.  
  6958.  
  6959.  
  6960.  
  6961.  
  6962.  
  6963.  
  6964.  
  6965.  
  6966.  
  6967.  
  6968.  
  6969.  
  6970.  
  6971.  
  6972.  
  6973.  
  6974.  
  6975.  
  6976.  
  6977.  
  6978.                                 - 119 -
  6979. ................................................................................
  6980.       Seek                     File Command                      Seek
  6981.  
  6982.       The "Seek" command moves the Read/Write pointer within a non
  6983.       Easy Base file which has been opened with the "Open" Command.
  6984.       The actual position of the pointer at any time is available in
  6985.       the system value File_Pos. The File_Pos value is the pointers
  6986.       current offset in bytes (Numbering the first byte as 1).
  6987.  
  6988.       The Seek Command accepts an actual offset, an offset relative
  6989.       to File_Pos or File_Len or an ASCII line movement.
  6990.  
  6991.       Examples.
  6992.  
  6993.       Seek 245
  6994.       Seek File_Pos + 35
  6995.       Seek File_Len - 20
  6996.       Seek Line_Forward
  6997.       Seek Line_Back
  6998.  
  6999.       You cannot combine an ASCII line movement with an offset -
  7000.       To read ten bytes starting at byte 30 on the next line you need
  7001.       two Seek commands.
  7002.  
  7003.       Seek Line_Forward
  7004.       Seek File_Pos + 29
  7005.       read 10 to Parts.No
  7006.  
  7007.       The line movement Line_Forward always positions the pointer at
  7008.       the start of the next line.
  7009.  
  7010.       The line movement Line_Back moves the pointer to the start of
  7011.       the current line if it is not already there and to the start of
  7012.       the previous line if it is.
  7013.  
  7014.       Some files (Eg. Email) have a non ASCII header followed by
  7015.       ASCII lines for the actual message. You can use Seek
  7016.       Line_Forward within a Do Loop to skip though the non ASCII
  7017.       part. If Line_Forward does not find a Carriage Return and Line
  7018.       Feed sequence within 255 bytes then it leaves the file pointer
  7019.       255 bytes ahead of its last position. There is no corresponding
  7020.       facility in Line_Back. If Line_Back does not find a line feed
  7021.       (or Start of File) within 255 bytes then the file pointer does
  7022.       not move.
  7023.  
  7024.       See also: Open, Close, Read, Write, Find, Erase
  7025.  
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.                                 - 120 -
  7036. ................................................................................
  7037.       SEQUENCE                 SYSTEM VALUE                  SEQUENCE
  7038.  
  7039.       When you create a new form a sequence value is updated each
  7040.       time a record is entered. The "sequence" value starts at 1 and
  7041.       continues to 2 billion irrespective of whether or not records
  7042.       have been deleted from the form. If you derive a field as
  7043.       "sequence" then each new record will have the next sequenced
  7044.       number. Sequence derivations are useful for such things as
  7045.       invoice numbers.
  7046.  
  7047.       A sequence field need not start at one however.
  7048.  
  7049.       Ex.  sequence + 1000 would number the first record 1001
  7050.  
  7051.       The sequence value is only available in data entry to a form.
  7052.       A common problem in data systems is to produce a sequence
  7053.       number when records are entered to forms via procedures.
  7054.  
  7055.       To accomplish this define fields to hold the number on both the
  7056.       form and the procedure input screen. Also define a single
  7057.       character text field, let's call it x on both. This field can
  7058.       be invisible. The x field in the form is indexed but not
  7059.       derived. The x field on the input screen is derived as "x".
  7060.       A relationship, let's call it "invoice" is entered between the
  7061.       input screen and the form relating the two "x" fields.
  7062.       Assuming the fields for the sequence number are called "invno"
  7063.       the field on the input screen is derived as:-
  7064.  
  7065.          lookup(invoice,invno)+ 1
  7066.  
  7067.       To update the x field in the form which is used purely as a
  7068.       flag to mark the last record your procedure code would be
  7069.       something like:-
  7070.  
  7071.       for invoices with x = "x"
  7072.          invoices.x = blank
  7073.          update record
  7074.       next
  7075.       for invoices new record
  7076.          copy all from input
  7077.       next
  7078.  
  7079.  
  7080.  
  7081.  
  7082.  
  7083.  
  7084.  
  7085.  
  7086.  
  7087.  
  7088.  
  7089.  
  7090.  
  7091.  
  7092.                                 - 121 -
  7093. ................................................................................
  7094.       SET PAPER LENGTH           UTILITY             SET PAPER LENGTH
  7095.  
  7096.       The "Set Paper Length" utility is accessed from the
  7097.       Utilities menu and can also be called from a user menu.
  7098.  
  7099.       There are settings for A3, A4, A5, American Letter and
  7100.       American Legal in both portrait and landscape.
  7101.  
  7102.       When you change the paper length in use then you update
  7103.       pagination for all report outputs.
  7104.  
  7105.       The landscape options are for use in wide carriage printers
  7106.       where the paper can be fed in landscape orientation they do not
  7107.       produce "sideways" printing on narrow carriage printers.
  7108.  
  7109.       If the paper size you use is not one of those listed, select
  7110.       "Other" and you can enter the length and width of your paper
  7111.       manually.
  7112.  
  7113.       The Length is entered in "Lines" ( One Sixths of an inch ) and
  7114.       the width is entered in inches.
  7115.  
  7116.       For example, if your paper is 12 inches by 8.25 inches you
  7117.       would enter the length as 72 and the width as 8.25.
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.  
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.  
  7135.  
  7136.  
  7137.  
  7138.  
  7139.  
  7140.  
  7141.  
  7142.  
  7143.  
  7144.  
  7145.  
  7146.  
  7147.  
  7148.  
  7149.                                 - 122 -
  7150. ................................................................................
  7151.       Shell                    File Command                     Shell
  7152.  
  7153.       The "Shell" command executes a DOS command which you supply as
  7154.       the parameter.
  7155.  
  7156.       Shell "DIR C:\WP > C:\EB\DIR.TXT"
  7157.  
  7158.       This writes a directory listing of C:\WP to the file DIR.TXT
  7159.       which you can then open and read from.
  7160.  
  7161.       You can supply the parameter as quoted text, as a variable or
  7162.       field or with a function.
  7163.  
  7164.       Shell Jointext("copy C:\PROGS\",input.directory,"\*.* A:\")
  7165.  
  7166.       In this example a disk vendor can select programs by name on an
  7167.       input screen which looks up the directory in which the program
  7168.       is stored. The procedure then copies all files from that
  7169.       directory to the A: drive.
  7170.  
  7171.       Depending on the procedure you are running, Easy Base uses
  7172.       between 450K and 550K of base memory. You cannot therefore
  7173.       "Shell" to any major program. The main use of "Shell" is to use
  7174.       the DOS copy and Dir commands. You can also shell to a batch
  7175.       file of such commands if you have several tasks to perform.
  7176.  
  7177.       CAUTION
  7178.  
  7179.       The Easy Base Executable file expects to find its support files
  7180.       in the current default directory. If you change drive or
  7181.       directory while shelled out of Easy Base then you must change
  7182.       back before exiting the procedure.
  7183.  
  7184.       If you are writing an application for resale then remember that
  7185.       the end user might not have installed it to C:\EB. Change back
  7186.       to the correct drive and directory by using the system value
  7187.       "Prog_Dir".
  7188.  
  7189.       Declare variables
  7190.          Drive as text : Dir as text
  7191.       end
  7192.       drive = lefttext(prog_dir,2)
  7193.       dir = righttext(prog_dir,lengthtext(prog_dir)-3)
  7194.       shell "Job.Bat"
  7195.       shell drive
  7196.       shell jointext("CD\",dir)
  7197.  
  7198.       When you use "Shell" Easy Base clears the screen and pauses for
  7199.       any DOS error messages. If you know that the command you are
  7200.       about to shell to will not invoke a response from DOS you can
  7201.       add the keyword "Smooth" and Easy Base will not clear the
  7202.       screen or pause.
  7203.  
  7204.       Shell Smooth "DIR C:\FAX > C:\EB\DIR.TXT"
  7205.  
  7206.                                 - 123 -
  7207. ................................................................................
  7208.       Show PickList          PROCEDURE COMMAND          Show PickList
  7209.  
  7210.       In most instances where you select records for displaying,
  7211.       printing or further processing you will be able to select based
  7212.       on a group field or a range of field values. There will however
  7213.       be occasions where you need to select a set of records which
  7214.       are totally unrelated. To do this Easy Base includes a pre
  7215.       defined system form called "PickList". This form has two fields
  7216.       called "Item" and "Mark".  The PickList form is only accessible
  7217.       within procedures. You can process it just like one of your own
  7218.       forms (Except that you cannot "Create Temp as PickList") and
  7219.       you can display it at any point in a procedure with the command
  7220.       "Show PickList". The difference between PickList and any other
  7221.       form is that it displays as a table. The Item field is no entry
  7222.       and the Mark field is a choice field which is either Blank or
  7223.       ASCII 251 ( √ ). After displaying the form you can continue
  7224.       your processing based on the value of the "Mark" field.
  7225.  
  7226.       As an example of the use of the picklist form, suppose that you
  7227.       had a contacts form with names and addresses. There is also a
  7228.       group field which is either Customer, Supplier, or Employee
  7229.       You want to send a circular letter to your Customers - but not
  7230.       all of them - only the ones you know personally. There is no
  7231.       sub grouping for this - you need to actually "Tick off" the
  7232.       ones you require from a list.
  7233.       ..........................................
  7234.       Declare output fields
  7235.          Contacts.Name : Contacts.address : date
  7236.       End
  7237.       For Contacts with Group = "Customer"
  7238.          For PickList new record
  7239.             Picklist.Item = Contacts.Name
  7240.          Next
  7241.       Next
  7242.       Show PickList
  7243.       For Picklist with Mark = Chr$(251)
  7244.          For Contacts with name = Picklist.Item
  7245.             Print Letter
  7246.          Next
  7247.       Next
  7248.       Clear Records from PickList
  7249.       ............................................
  7250.       At the line "Show Picklist" Easy Base will display all your
  7251.       customers names in a table which you can scroll through
  7252.       marking or unmarking the customers to which you wish to print
  7253.       the circular. When you Escape from the PickList form,
  7254.       processing continues in the procedure code, printing the Letter
  7255.       only to those customers which you have "Ticked" ie with the
  7256.       "Mark" field = Chr$(251).
  7257.  
  7258.       PickList is not a temporary form. You can add or delete records
  7259.       in one procedure and show it in another. You must clear records
  7260.       from one usage before the next.
  7261.       Cont.
  7262.  
  7263.                                 - 124 -
  7264. ................................................................................
  7265.       Show PickList          PROCEDURE COMMAND          Show PickList
  7266.  
  7267.       The Item field in Picklist is a text field 80 characters in
  7268.       length. You can show from 1 to 65 characters of this field by
  7269.       stating the length after the command "Show PickList 20" If you
  7270.       do not enter a length the default is 35. There is no problem
  7271.       allocating numeric values to PickList.Item but you cannot show
  7272.       a Time field. You cannot show a date field directly but you can
  7273.       use Picklist for dates if you have a field with the date shown
  7274.       in text derived with the datetext function.
  7275.  
  7276.       For Events with Type = "Committee Meeting"
  7277.          For PickList new record
  7278.             Picklist.Item = Events.Dateastext
  7279.             PickList.Mark = Chr$(251)
  7280.          next
  7281.       Next
  7282.       Show PickList 18
  7283.  
  7284.       In the above example you will see that the "Mark" field is also
  7285.       pre filled. In this case, when the list displays, all the dates
  7286.       will be pre marked.
  7287.  
  7288.       The following keys are active when PickList is displayed.
  7289.  
  7290.       Up Down PgUp PgDn Home End
  7291.  
  7292.       Space     Marks or unmarks individual items
  7293.  
  7294.       F4        Marks or unmarks all items
  7295.  
  7296.       F5        Swaps marked for unmarked
  7297.  
  7298.       F10       Makes a shortlist of marked items only
  7299.  
  7300.       F2        Returns to the procedure code.
  7301.  
  7302.  
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.  
  7314.  
  7315.  
  7316.  
  7317.  
  7318.  
  7319.  
  7320.                                 - 125 -
  7321. ................................................................................
  7322.       SKIP GROUP             PROCEDURE COMMAND             SKIP GROUP
  7323.  
  7324.       The "Skip Group" command excludes an entire group of records
  7325.       from selection by a "For" loop.
  7326.  
  7327.       Ex.
  7328.  
  7329.       for employees with type in order
  7330.          if employees.type = "Part time" then skip group
  7331.          print list items
  7332.       next
  7333.  
  7334.       The "Skip Group" command is not the same as filtering with a
  7335.       "<>" condition.  You could achieve the same result with :-
  7336.  
  7337.       for employees with type in order
  7338.          if employees.type <> "Part time" then
  7339.             print list items
  7340.          end if
  7341.       next
  7342.  
  7343.       but the second procedure would take much longer to run as each
  7344.       part time employee's record would be loaded into memory only to
  7345.       be rejected by the "If" condition.  The first procedure on the
  7346.       other hand only loads a single part time employee's record then
  7347.       skips the entire group by advancing the index pointer in use
  7348.       for record selection.
  7349.  
  7350.       You can also use the "Skip Group" command to terminate
  7351.       selection of a group of records at a given point.
  7352.  
  7353.       declare variables
  7354.          count as number
  7355.       end
  7356.       for employees with type in order
  7357.          count = count + 1
  7358.          if count = 51 then
  7359.             count = 0
  7360.             skip group
  7361.          end if
  7362.          print list items
  7363.       next
  7364.  
  7365.       The above procedure prints the first fifty employees in each
  7366.       "type" group.
  7367.  
  7368.       The "Skip Group" command can be shortened to "Skipgrp"
  7369.  
  7370.       IMPORTANT: The condition for the Skip Group cannot be nested
  7371.       within another "If" condition or "DO LOOP" structure which is
  7372.       itself within the current "For" loop.
  7373.  
  7374.       :- See Skip Record for example.
  7375.  
  7376.  
  7377.                                 - 126 -
  7378. ................................................................................
  7379.       SKIP RECORD            PROCEDURE COMMAND            SKIP RECORD
  7380.  
  7381.       The "Skip Record" command is used to exclude individual records
  7382.       from selection in a "For" Loop.
  7383.  
  7384.       Ex.
  7385.  
  7386.       for employee with worksno in order
  7387.          if employees.worksno = 12 then skip record
  7388.          print list items
  7389.       next
  7390.  
  7391.       The "Skip Record" command has exactly the same effect as
  7392.       filtering with a "<>" condition but is much easier to write if
  7393.       there are many items to exclude
  7394.  
  7395.       for employees with worksno in order
  7396.          if employees.worksno = 12 or employees.worksno = 15 then
  7397.             skip record
  7398.          end if
  7399.          if employees.name = "smith" then skip record
  7400.          if employees.age > 50 then skip record
  7401.       next
  7402.  
  7403.       You can exclude groups of records from an inner loop by
  7404.       applying the "Skip Record" command to a "Unique" outer loop.
  7405.  
  7406.       for employees alias types with type in order unique
  7407.          if types.type = "director" then skip record
  7408.          if types.type = "part time" then skip record
  7409.          for employees with type = types.type
  7410.             print list items
  7411.          next
  7412.       next
  7413.  
  7414.       If you need to exclude groups of records from a single loop you
  7415.       must use the "Skip Group" command.
  7416.  
  7417.       The "Skip Record" command can be shortened to "Skiprec".
  7418.  
  7419.       IMPORTANT:
  7420.  
  7421.       The Skip Record command causes a direct jump to the start of
  7422.       the next iteration of the current "For" loop. The condition
  7423.       for the Skip Record must not be nested within another "If"
  7424.       condition or "Do Loop" structure which is itself within the
  7425.       current For loop.
  7426.  
  7427.       for form
  7428.          if (condition) then
  7429.             if form.type = "Part time" then skip record
  7430.          end if
  7431.       next
  7432.                    This will cause a system error.
  7433.  
  7434.                                 - 127 -
  7435. ................................................................................
  7436.       SPACEPAD                   FUNCTION                    SPACEPAD
  7437.  
  7438.       The Spacepad function pads a text variable to a given length
  7439.       with spaces.
  7440.  
  7441.       Ex.   Spacepad(name,10)
  7442.             < returns "Fred      " if name = "Fred"
  7443.  
  7444.       The spacepad function is used in the creation of compound index
  7445.       fields.
  7446.  
  7447.       For example:    A "Films" form has the fields "title" and
  7448.       "category". To list the films grouped by category in order and
  7449.       with the titles in each category in order create the field
  7450.       "groupindex" as text,long enough to hold both category and
  7451.       title fields and derived as :-
  7452.  
  7453.       Jointext(spacepad(category,15),title)
  7454.                       {15 is length of category field}
  7455.  
  7456.       You can then produce the required printout with the following
  7457.  
  7458.       procedure.
  7459.  
  7460.       ....................format.........................
  7461.  
  7462.       .Report header
  7463.         ═══════════════════════════════════════════════════════════
  7464.                        FILM LIST BY CATEGORY
  7465.         ═══════════════════════════════════════════════════════════
  7466.       .Group header
  7467.         Films in {category field}
  7468.       .List items
  7469.        {title field} Starring {Star field} Running time {length Fld}
  7470.       .end
  7471.  
  7472.       ......................procedure code.................
  7473.       declare output fields
  7474.          films.title:films.star:films.length:films.category
  7475.       end
  7476.       declare variables
  7477.          catcheck as text
  7478.       end
  7479.       '............
  7480.       bold on
  7481.       print report header
  7482.       for films with groupindex in order
  7483.          if films.category <> catcheck then
  7484.             bold on
  7485.             print group header
  7486.             bold off
  7487.          end if
  7488.          print list items
  7489.       next
  7490.  
  7491.                                 - 128 -
  7492. ................................................................................
  7493.       SPELLDAY                   FUNCTION                    SPELLDAY
  7494.  
  7495.       This function spells out the day of the number (1-7) parameter.
  7496.  
  7497.       Ex.   Spellday(dayofweek(system date))
  7498.  
  7499.  
  7500.       Acceptable parameters:
  7501.  
  7502.       Numeric value                              (1-7)
  7503.       Numeric expression evaluating to           (1-7)
  7504.       Numeric Field/variable holding value       (1-7)
  7505.       Any function returning a numeric value     (1-7)
  7506.  
  7507.  
  7508.  
  7509.  
  7510.  
  7511.  
  7512.  
  7513.  
  7514.  
  7515.  
  7516.  
  7517.  
  7518.  
  7519.  
  7520.  
  7521.  
  7522.  
  7523.  
  7524.  
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530.  
  7531.  
  7532.  
  7533.  
  7534.  
  7535.  
  7536.  
  7537.  
  7538.  
  7539.  
  7540.  
  7541.  
  7542.  
  7543.  
  7544.  
  7545.  
  7546.  
  7547.  
  7548.                                 - 129 -
  7549. ................................................................................
  7550.       SPELLMONTH                 FUNCTION                  SPELLMONTH
  7551.  
  7552.       This function spells out the day of the number (1-12)
  7553.       parameter.
  7554.  
  7555.  
  7556.       Ex.   Spellmonth(month(system date))
  7557.  
  7558.       Ex.   Month = Spellmonth(month(invoices.date))
  7559.  
  7560.  
  7561.       Acceptable parameters:
  7562.  
  7563.       Numeric value                           (1-12)
  7564.       Numeric expression evaluating to        (1-12)
  7565.       Numeric Field/variable holding value    (1-12)
  7566.       Any function returning a numeric value  (1-12)
  7567.  
  7568.  
  7569.  
  7570.  
  7571.  
  7572.  
  7573.  
  7574.  
  7575.  
  7576.  
  7577.  
  7578.  
  7579.  
  7580.  
  7581.  
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.  
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.  
  7598.  
  7599.  
  7600.  
  7601.  
  7602.  
  7603.  
  7604.  
  7605.                                 - 130 -
  7606. ................................................................................
  7607.       START HERE             DERIVATION PREFIX             START HERE
  7608.  
  7609.       If, in a form or procedure input screen, you want the cursor to
  7610.       start in other than the top left field then derive the field in
  7611.       which you wish the cursor to start with "Start here" .
  7612.  
  7613.       If the field in which the cursor is to start already has a
  7614.       derivation then simply prefix the derivation with "Start here".
  7615.  
  7616.       Ex.
  7617.  
  7618.       start here Lookup(customers,name)
  7619.  
  7620.  
  7621.  
  7622.       1. You can have more than one prefix on any one field
  7623.          derivation provided there is a space between each.
  7624.  
  7625.  
  7626.  
  7627.  
  7628.  
  7629.  
  7630.  
  7631.  
  7632.  
  7633.  
  7634.  
  7635.  
  7636.  
  7637.  
  7638.  
  7639.  
  7640.  
  7641.  
  7642.  
  7643.  
  7644.  
  7645.  
  7646.  
  7647.  
  7648.  
  7649.  
  7650.  
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.  
  7659.  
  7660.  
  7661.  
  7662.                                 - 131 -
  7663. ................................................................................
  7664.       STRINGOF                   FUNCTION                    STRINGOF
  7665.  
  7666.       This function returns a string of characters.
  7667.  
  7668.       Ex.   Stringof(12,"-")
  7669.              < Returns "------------">
  7670.  
  7671.  
  7672.       Ex.  Stringof(5,chr$(240))
  7673.             < Returns "≡≡≡≡≡">
  7674.  
  7675.  
  7676.       One of the most useful applications of the "Stringof" function
  7677.       is to pad output fields in tabular reports with "." characters.
  7678.  
  7679.       Ex.
  7680.  
  7681.       Declare output fields
  7682.          stock.name : stock.price
  7683.       end
  7684.       for stock with name in order
  7685.          stock.name = jointext(stock.name,stringof(30-lengthtext(
  7686.                       stock.name),".")
  7687.          print list items
  7688.       next
  7689.  
  7690.  
  7691.       The printed output from the above report would be in the form:-
  7692.  
  7693.             Gizmo.........................  2.50
  7694.             Sprocket......................  9.95
  7695.             Widget........................  3.10
  7696.  
  7697.  
  7698.  
  7699.       Acceptable parameters:
  7700.  
  7701.       1   Any numeric field, variable, expression or function
  7702.       2   Single quoted character - Function returning a single
  7703.           character
  7704.  
  7705.  
  7706.  
  7707.  
  7708.  
  7709.  
  7710.  
  7711.  
  7712.  
  7713.  
  7714.  
  7715.  
  7716.  
  7717.  
  7718.  
  7719.                                 - 132 -
  7720. ................................................................................
  7721.       SUBINDEX               PROCEDURE COMMAND               SUBINDEX
  7722.  
  7723.       The command Subindex is used to create an index file which
  7724.       contains only a subset of the records in a form.
  7725.  
  7726.       Subset indices are used in reports to output records in the
  7727.       order of one field when they have been selected using the index
  7728.       file on another field. For example, if you wish to list all the
  7729.       employees who work at the "Manchester" branch with their
  7730.       surnames in order you need to select the records using the
  7731.       index on the "Branch" field but you need to list them using an
  7732.       index on the "Surname" field. Since you can only use one index
  7733.       at a time you need to create an index on "Surname" which only
  7734.       contains the records which have "Manchester" as the branch.
  7735.  
  7736.       For Employees with branch = "Manchester"
  7737.          Subindex surname as #1
  7738.       next
  7739.       for Employees with subindex 1 in order
  7740.          print list items
  7741.       next
  7742.  
  7743.       You can have up to nine subset indices in any one procedure and
  7744.       you can select subsets from subsets. For example, if, in the
  7745.       employees list you only wished to list female employees whose
  7746.       salary was greater than 50,000 you would use:-
  7747.  
  7748.       For Employees with branch = "Manchester"
  7749.          Subindex sex as #1
  7750.       next
  7751.       For Employees with subindex 1 = "Female"
  7752.          Subindex salary as #2
  7753.       next
  7754.       For Employees with subindex 2 > 50000
  7755.          Subindex surname as #3
  7756.       next
  7757.       for Employees with subindex 3 in order
  7758.          Print List Items
  7759.       next
  7760.  
  7761.       Subset indices are temporary files. You cannot use a subset
  7762.       index in one procedure that was created in another.
  7763.  
  7764.       Within one procedure, however, you can use a subset index
  7765.       almost as if it were a form. You can add records to it as often
  7766.       as you wish before using it and you can erase its contents with
  7767.       the "Clear records from" command.
  7768.  
  7769.       Clear records from subindex 1
  7770.  
  7771.       This allows you to build subsets with multiple selections eg.
  7772.       Employees with branch = "Manchester" or branch = "Birmingham"
  7773.       and to reuse a subset index in a nested loop eg. Employees
  7774.       grouped by branch in surname order.
  7775.  
  7776.                                 - 133 -
  7777. ................................................................................
  7778.       SUBINDEX               PROCEDURE COMMAND               SUBINDEX
  7779.  
  7780.       Example of multiple selections:
  7781.  
  7782.       For Employees with branch = "Manchester"
  7783.          Subindex surname as #1
  7784.       next
  7785.       For Employees with branch = "Birmingham"
  7786.          Subindex surname as #1
  7787.       next
  7788.       For Employees with subindex 1 in order
  7789.          Print List Items
  7790.       next
  7791.  
  7792.       Example of nested subset:
  7793.  
  7794.       For Branches with name in order
  7795.          Print group header
  7796.          For Employees with branch = branches.name
  7797.             Subindex surname as #1
  7798.          next
  7799.          For Employees with subindex 1 in order
  7800.             Print List Items
  7801.          next
  7802.          Print group footer
  7803.          Clear records from subindex 1
  7804.       next
  7805.  
  7806.       In the first example, the records with branch = "Birmingham"
  7807.       are added to those with branch = "Manchester" and both are
  7808.       listed as a single subset.
  7809.  
  7810.       In the second example each individual branch subset is printed
  7811.       and then erased ready for the next.
  7812.  
  7813.       Whenever Easy Base is writing to a subset index the "Running"
  7814.       flash on the upper status line is replaced with "Sorting".
  7815.  
  7816.  
  7817.  
  7818.  
  7819.  
  7820.  
  7821.  
  7822.  
  7823.  
  7824.  
  7825.  
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.  
  7833.                                 - 134 -
  7834. ................................................................................
  7835.       SYSTEM DATE              SYSTEM VALUE               SYSTEM DATE
  7836.  
  7837.       You can use your computers inbuilt date anywhere in field
  7838.       derivations or procedure code by simply quoting "system date".
  7839.  
  7840.       Ex.
  7841.  
  7842.       for diary with date = system date
  7843.          print list items
  7844.       next
  7845.  
  7846.  
  7847.  
  7848.  
  7849.  
  7850.  
  7851.  
  7852.  
  7853.  
  7854.  
  7855.  
  7856.  
  7857.  
  7858.  
  7859.  
  7860.  
  7861.  
  7862.  
  7863.  
  7864.  
  7865.  
  7866.  
  7867.  
  7868.  
  7869.  
  7870.  
  7871.  
  7872.  
  7873.  
  7874.  
  7875.  
  7876.  
  7877.  
  7878.  
  7879.  
  7880.  
  7881.  
  7882.  
  7883.  
  7884.  
  7885.  
  7886.  
  7887.  
  7888.  
  7889.  
  7890.                                 - 135 -
  7891. ................................................................................
  7892.       SYSTEM TIME              SYSTEM VALUE               SYSTEM TIME
  7893.  
  7894.       You can use your computers inbuilt time anywhere in field
  7895.       derivations or procedure code by simply quoting "system time".
  7896.  
  7897.       Ex.
  7898.  
  7899.       for stockitems with stockno = input.stockno
  7900.          lastcheckeddate = system date
  7901.          lastcheckedtime = system time
  7902.          update record
  7903.       next
  7904.  
  7905.  
  7906.  
  7907.  
  7908.  
  7909.  
  7910.  
  7911.  
  7912.  
  7913.  
  7914.  
  7915.  
  7916.  
  7917.  
  7918.  
  7919.  
  7920.  
  7921.  
  7922.  
  7923.  
  7924.  
  7925.  
  7926.  
  7927.  
  7928.  
  7929.  
  7930.  
  7931.  
  7932.  
  7933.  
  7934.  
  7935.  
  7936.  
  7937.  
  7938.  
  7939.  
  7940.  
  7941.  
  7942.  
  7943.  
  7944.  
  7945.  
  7946.  
  7947.                                 - 136 -
  7948. ................................................................................
  7949.       TEXT                      FIELD TYPE                       TEXT
  7950.  
  7951.       The text field type can be up to 80 characters long.
  7952.  
  7953.       Cut copy and paste operations are available between all text,
  7954.       and textblock fields :
  7955.  
  7956.       Use Shift plus the arrow keys to mark the text you wish to cut
  7957.       or copy. When you release the keys the cut or copy choice will
  7958.       appear.
  7959.  
  7960.       To paste cut text position the cursor where you want it
  7961.       inserted and press Shift plus Ins.
  7962.  
  7963.       Spell Checking is also available in text fields -
  7964.          Press Ctrl + S
  7965.  
  7966.  
  7967.  
  7968.  
  7969.  
  7970.  
  7971.  
  7972.  
  7973.  
  7974.  
  7975.  
  7976.  
  7977.  
  7978.  
  7979.  
  7980.  
  7981.  
  7982.  
  7983.  
  7984.  
  7985.  
  7986.  
  7987.  
  7988.  
  7989.  
  7990.  
  7991.  
  7992.  
  7993.  
  7994.  
  7995.  
  7996.  
  7997.  
  7998.  
  7999.  
  8000.  
  8001.  
  8002.  
  8003.  
  8004.                                 - 137 -
  8005. ................................................................................
  8006.       TEXT BLOCK                FIELD TYPE                 TEXT BLOCK
  8007.  
  8008.       When you Define a field with the field type "Text Block" then
  8009.       instead of entering a field length you shade out the area which
  8010.       you wish the field to cover using the arrow keys.
  8011.  
  8012.       Textblock fields offer many of the facilities of a
  8013.       wordprocessor including cut and paste, wordwrap and spell
  8014.       checking.
  8015.  
  8016.       Useful widths for A4 and Letter size paper are 63 characters if
  8017.       you intend to print at 10 characters per inch and 75 characters
  8018.       if you intend to print at 12 characters per inch. This document
  8019.       for instance was created in 63 character wide text blocks.
  8020.  
  8021.       The maximum width of a text block field on screen is 80
  8022.       characters. You can however redefine it up to 230 characters
  8023.       wide in procedure printouts and Easy Base will reformat your
  8024.       paragraphs to the new width.
  8025.  
  8026.       A text block field is not a "memo" field. It can be indexed and
  8027.       derived.
  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.  
  8058.  
  8059.  
  8060.  
  8061.                                 - 138 -
  8062. ................................................................................
  8063.       TIME                      FIELD TYPE                       TIME
  8064.  
  8065.       The Easy Base "time" field has the eight character format:-
  8066.  
  8067.       11:20:20    (Hours:Minutes:Seconds)
  8068.  
  8069.       You can record time data in any format you wish by using a
  8070.       "Formatted Text" field but you must use a "Time" field if you
  8071.       wish to perform addition and subtraction operations on time
  8072.       values.  (in seconds)
  8073.  
  8074.       Time fields are automatically checked for validity.
  8075.  
  8076.  
  8077.       See Also:-  Maketime
  8078.  
  8079.  
  8080.  
  8081.  
  8082.  
  8083.  
  8084.  
  8085.  
  8086.  
  8087.  
  8088.  
  8089.  
  8090.  
  8091.  
  8092.  
  8093.  
  8094.  
  8095.  
  8096.  
  8097.  
  8098.  
  8099.  
  8100.  
  8101.  
  8102.  
  8103.  
  8104.  
  8105.  
  8106.  
  8107.  
  8108.  
  8109.  
  8110.  
  8111.  
  8112.  
  8113.  
  8114.  
  8115.  
  8116.  
  8117.  
  8118.                                 - 139 -
  8119. ................................................................................
  8120.       TIMEAMPM                   FUNCTION                    TIMEAMPM
  8121.  
  8122.       This function returns the hour ( 0 - 12) plus am. or pm. from
  8123.       the time field parameter.
  8124.  
  8125.       Ex. Timeampm(system time)
  8126.  
  8127.       Ex.
  8128.       -------------------------format----------------------------
  8129.       .Report header
  8130.                      Appointments for {Apps.Date Field}
  8131.       .List items
  8132.                 {Apps.Name Field      }   at  {Time Field}
  8133.       .End
  8134.       -------------------------code----------------------------
  8135.       declare output fields
  8136.          Apps.name
  8137.          Apps.date
  8138.          Time
  8139.       end
  8140.       print report header
  8141.       for apps with date = system date
  8142.          time = timeampm(apps.time)
  8143.          print list items
  8144.       next
  8145.  
  8146.  
  8147.       Acceptable parameters:
  8148.  
  8149.       System time
  8150.       Time field
  8151.       Maketime function
  8152.       Time expression
  8153.  
  8154.  
  8155.  
  8156.  
  8157.  
  8158.  
  8159.  
  8160.  
  8161.  
  8162.  
  8163.  
  8164.  
  8165.  
  8166.  
  8167.  
  8168.  
  8169.  
  8170.  
  8171.  
  8172.  
  8173.  
  8174.  
  8175.                                 - 140 -
  8176. ................................................................................
  8177.       TOTAL COPIES             SYSTEM VALUE              TOTAL COPIES
  8178.  
  8179.       Whenever a procedure enters a "FOR" loop qualified by "With
  8180.       fieldname = " the total number of records which match the
  8181.       qualification value is available in the system value "Total
  8182.       Copies"
  8183.  
  8184.       Total Copies is extracted directly from the index file and
  8185.       relieves you of a time consuming loop all the way through a
  8186.       form updating a counter.
  8187.  
  8188.       In other words:-
  8189.  
  8190.       for books with category = "fiction"
  8191.          count = count + 1
  8192.       next
  8193.  
  8194.       can be replaced with:-
  8195.  
  8196.       for books with category = "fiction"
  8197.          count = total copies
  8198.          exit for
  8199.       next
  8200.  
  8201.       Unlike "Total Records" the "Total Copies" value never includes
  8202.       records marked for deletion.
  8203.  
  8204.       Easy Base does not track separate values for "Total Records" or
  8205.       "Total Copies" when there are nested "For" loops. The values
  8206.       are set for the outer loop on the first iteration and reset for
  8207.       the inner loop on its first iteration. If you need a value for
  8208.       "Total Records" or for "Total Copies" after your procedure has
  8209.       entered another loop then you must transfer the value to a
  8210.       variable while it is available. (See the example for "Display
  8211.       Status")
  8212.  
  8213.       Easy Base does not update "Total Records" or "Total Copies"
  8214.       when records are added or deleted during a procedure.
  8215.  
  8216.  
  8217.  
  8218.  
  8219.  
  8220.  
  8221.  
  8222.  
  8223.  
  8224.  
  8225.  
  8226.  
  8227.  
  8228.  
  8229.  
  8230.  
  8231.  
  8232.                                 - 141 -
  8233. ................................................................................
  8234.       TOTAL RECORDS            SYSTEM VALUE             TOTAL RECORDS
  8235.  
  8236.       Whenever a procedure enters a "FOR" loop the total number of
  8237.       records in the form is available in the system value "Total
  8238.       records"
  8239.  
  8240.       Ex.
  8241.       The following code fragment updates a "Customer summary" form
  8242.       with the total number of customers in the "Customers" form.
  8243.  
  8244.       declare variables
  8245.         tot as number
  8246.       end
  8247.       for customers with acno = 1
  8248.          tot = total records
  8249.          exit for
  8250.       next
  8251.       for customersummary
  8252.          customersummary.totalcustomers = tot
  8253.          update record
  8254.       next
  8255.  
  8256.       Caution.
  8257.  
  8258.       Provided that the "For" loop is qualified by a "with" statement
  8259.       then the "Total Records" value is extracted directly from the
  8260.       open index file and is the total number of "Live Records".
  8261.  
  8262.       If you access the "Total records" value in an unqualified "For"
  8263.       loop then there is no index file open and the "Total Records"
  8264.       value is derived by dividing the forms file length by the
  8265.       record length. It therefore represents the total number of
  8266.       records in the form "Live" and "Deleted".
  8267.  
  8268.       Ex.
  8269.  
  8270.       If a form "books" has 2000 records and 10 are marked for
  8271.       deletion at the next re-pack then "count" returns 1990 in:-
  8272.  
  8273.       for books with catalogueno = 1
  8274.         count = total records
  8275.       next
  8276.  
  8277.       and 2000 in :-
  8278.  
  8279.       for books
  8280.          count = total records
  8281.          exit for
  8282.       next
  8283.  
  8284.  
  8285.  
  8286.  
  8287.  
  8288.  
  8289.                                 - 142 -
  8290. ................................................................................
  8291.       UPDATE RECORD          PROCEDURE COMMAND          UPDATE RECORD
  8292.  
  8293.       The "Update record" command is used to alter the contents of
  8294.       one or many records in a form.
  8295.  
  8296.       Ex.
  8297.  
  8298.       for stock with item = input.item
  8299.          stock.price = input.price
  8300.          stock.pricechangedate = system date
  8301.          update record
  8302.       next
  8303.  
  8304.       This example changes the price of a single "Stock" item.
  8305.  
  8306.  
  8307.       for employees with taxcode = input.oldtaxcode
  8308.          employees.taxcode = input.newtaxcode
  8309.          update record
  8310.       next
  8311.  
  8312.       This example changes the taxcode field of all the employees
  8313.       whose present taxcode is the same as the input screen
  8314.       "oldtaxcode" to the input screen "newtaxcode".
  8315.  
  8316.  
  8317.       for employees
  8318.          employees.taxcode = employees.taxcode + 60
  8319.          update record
  8320.       next
  8321.  
  8322.       This example increases the taxcode of all employees by sixty.
  8323.  
  8324.  
  8325.  
  8326.  
  8327.  
  8328.  
  8329.  
  8330.  
  8331.  
  8332.  
  8333.  
  8334.  
  8335.  
  8336.  
  8337.  
  8338.  
  8339.  
  8340.  
  8341.  
  8342.  
  8343.  
  8344.  
  8345.  
  8346.                                 - 143 -
  8347. ................................................................................
  8348.       UPPER                      FUNCTION                       UPPER
  8349.  
  8350.       Returns the Uppercase of a text field or variable.
  8351.  
  8352.       Ex.  Upper(postcode)
  8353.            < shows the postcode field in uppercase>
  8354.  
  8355.       Ex.
  8356.       '.......................
  8357.       declare output fields
  8358.          labelname
  8359.          labeladdress
  8360.          labelcode
  8361.       end
  8362.       for customers with maillist = "yes"
  8363.          Labelname = Upper(customers.name)
  8364.          Labeladdress = Upper(customers.address)
  8365.          Labelcode = customers.postcode
  8366.          print labels
  8367.       next
  8368.  
  8369.       Acceptable parameters:
  8370.  
  8371.       Quoted text
  8372.       Text field/variable
  8373.  
  8374.  
  8375.  
  8376.  
  8377.  
  8378.  
  8379.  
  8380.  
  8381.  
  8382.  
  8383.  
  8384.  
  8385.  
  8386.  
  8387.  
  8388.  
  8389.  
  8390.  
  8391.  
  8392.  
  8393.  
  8394.  
  8395.  
  8396.  
  8397.  
  8398.  
  8399.  
  8400.  
  8401.  
  8402.  
  8403.                                 - 144 -
  8404. ................................................................................
  8405.       V.A.T. FUNCTIONS           FUNCTION            V.A.T. FUNCTIONS
  8406.  
  8407.       Easy Base has a set of five VAT rates which can be altered from
  8408.       the utilities menu. There are four VAT functions:-
  8409.          VATin
  8410.          VATon
  8411.          PlusVAT
  8412.          MinusVAT
  8413.  
  8414.       Ex.   VATin(retailprice,2)
  8415.              < Returns the VAT content of "retailprice" at VAT rate 2
  8416.  
  8417.       Ex.   VATon(netprice,4)
  8418.             < Returns the VAT to be added to "netprice" at VAT rate 4
  8419.  
  8420.       Ex.   PlusVAT(netprice,3)
  8421.             < Returns the VAT inclusive price at VAT rate 3>
  8422.  
  8423.       Ex.   MinusVAT(retailprice,2)
  8424.             < Returns the net price of "retailprice" before VAT at
  8425.               VAT rate 2>
  8426.  
  8427.        (assumes Retailprice as VAT Inclusive and Netprice exclusive)
  8428.  
  8429.       If the second parameter (rate) is omitted from any of the VAT
  8430.       functions then Rate 1 is assumed.
  8431.  
  8432.       Ex.   Gross = PlusVAT(input.net)
  8433.             < The variable "Gross" = the VAT inclusive of the input
  8434.              screen field "net" calculated at rate 1.>
  8435.  
  8436.       Although the VAT functions are primarily included for business
  8437.       applications, they can be used for any purpose where a
  8438.       percentage needs to be changed globally throughout an
  8439.       application without the need to alter each procedure or field
  8440.       derivation in which it is used.
  8441.  
  8442.       Acceptable parameters:
  8443.  
  8444.       1   Any numeric value, field, variable, expression or function
  8445.       2   As Parameter 1 but evaluating between 1 an 5
  8446.  
  8447.  
  8448.  
  8449.  
  8450.  
  8451.  
  8452.  
  8453.  
  8454.  
  8455.  
  8456.  
  8457.  
  8458.  
  8459.  
  8460.                                 - 145 -
  8461. ................................................................................
  8462.       Write                    File Command                     Write
  8463.  
  8464.       The "Write" command writes data to a non Easy Base file which
  8465.       has been opened with the "Open" command.
  8466.  
  8467.       The Syntax is:
  8468.  
  8469.       Write (Text, Variable, Field or Function) [Line_len (length)]
  8470.  
  8471.       The Line_Len keyword and parameter are not required.
  8472.  
  8473.       Ex.
  8474.  
  8475.       Write "Once upon a time"
  8476.       Write LineVar
  8477.       Write Customers.name
  8478.       Write Jointext(customers.forname," ",customers.surname)
  8479.       Write Customers.notes line_len 60
  8480.  
  8481.       Notes:-
  8482.  
  8483.       The contents of a text field is supplied without leading or
  8484.       trailing spaces. The contents of a text variable is supplied
  8485.       without trailing spaces. You can pad the output with either of
  8486.       the functions "Spacepad" or "stringof".
  8487.  
  8488.       The following code writes customers names and account Nos in
  8489.       two columns to an ASCII file.
  8490.  
  8491.       Open "C:\WP\NAMES.TXT"
  8492.       for customers with name in order
  8493.          write stringof(5,chr$(32))
  8494.          write spacepad(customers.name,30)
  8495.          write customers.acno
  8496.          write chr$(13)
  8497.          write chr$(10)
  8498.       next
  8499.  
  8500.       The contents of a text block field is supplied reformatable ie
  8501.       a single CHR$(13) is used to denote where a new line is to be
  8502.       forced. If you write a text block field without the Line_len
  8503.       keyword it will be written in this format.
  8504.  
  8505.       To write a text block field as ASCII Lines use the Line_Len
  8506.       keyword. The Line_Len value does not have to be the same as the
  8507.       width of the text block field. Easy Base will word wrap the
  8508.       contents to whatever Lin_Len value you supply.
  8509.  
  8510.       You cannot write quotation marks within quoted text.
  8511.       To write "Fred said "@*!" to Bill" you must replace the inner
  8512.       quotation marks with ASCII character 127. (Hold down the Alt
  8513.       key and type 127 on the numeric keypad)
  8514.  
  8515.       See also: Open, Close, Read, Seek, Find
  8516.  
  8517.                                 - 146 -
  8518. ................................................................................
  8519.       YEAR                       FUNCTION                        YEAR
  8520.  
  8521.       This function returns the year number from a date parameter.
  8522.  
  8523.       Ex.    Year(system date)
  8524.  
  8525.       Ex.
  8526.  
  8527.       Carage = jointext((year(system date)-year(registered))," Years
  8528.       old")
  8529.  
  8530.  
  8531.       Acceptable parameters:
  8532.  
  8533.       System date
  8534.       Date field
  8535.       Makedate function
  8536.       Date expression
  8537.  
  8538.  
  8539.  
  8540.  
  8541.  
  8542.  
  8543.  
  8544.  
  8545.  
  8546.  
  8547.  
  8548.  
  8549.  
  8550.  
  8551.  
  8552.  
  8553.  
  8554.  
  8555.  
  8556.  
  8557.  
  8558.  
  8559.  
  8560.  
  8561.  
  8562.  
  8563.  
  8564.  
  8565.  
  8566.  
  8567.  
  8568.  
  8569.  
  8570.  
  8571.  
  8572.  
  8573.  
  8574.                                 - 147 -
  8575. ................................................................................
  8576.       ZEROPAD                    FUNCTION                     ZEROPAD
  8577.  
  8578.       The Zeropad function pads an integer or fixed point field to a
  8579.       given number of places left and right of the decimal point.
  8580.  
  8581.       Ex.  Zeropad(price,3,2)
  8582.            <Returns "001.50" if price = 1.5>
  8583.  
  8584.       Ex.  Zeropad(acno,6,0)
  8585.            <Returns "004532" if acno = 4,532>
  8586.  
  8587.       The Zeropad function can be used as in the second example to
  8588.       return a fixed length numeric string from an integer field.
  8589.       It's main use, however, is in the creation of fields for
  8590.       compound indices where one of the fields to be compounded is a
  8591.       number.
  8592.  
  8593.       For example: A school has all pupils names and ages recorded on
  8594.       a form in fields "name" and "age". To create an index which
  8595.       will list pupils names alphabetically but grouped by age a
  8596.       compound field which is invisible and does not allow user entry
  8597.       is created as a text field derived with:-
  8598.       Jointext(zeropad(age,2,0),name)
  8599.  
  8600.       Because the compound field is text the index file will be
  8601.       sorted alphabetically. If you sort the numbers 8,9 and 12
  8602.       alphabetically you get 12,8,9 because the one in 12 comes
  8603.       before 8. If however you sort the numbers 08,09 and 12
  8604.       alphabetically you get the correct numeric order.
  8605.  
  8606.       By using the zeropad function in the above example and indexing
  8607.       the compound field,let's call it "unifield" you could then
  8608.       print out the pupils in age groups with the names in each group
  8609.       arranged alphabetically.
  8610.       .........................format.................
  8611.       .group header
  8612.        Pupils aged {pupils.age field}
  8613.       .list items
  8614.               {pupils.name field}
  8615.       .end
  8616.       .........................procedure code.........
  8617.       declare output fields
  8618.          pupils.name:pupils.age
  8619.       end
  8620.       declare variables
  8621.          agecheck as number
  8622.       end
  8623.       agecheck = 0
  8624.       for pupils with unifield in order
  8625.          if pupils.age <> agecheck then print group header
  8626.          agecheck = pupils.age
  8627.          print list items
  8628.       next
  8629.  
  8630.  
  8631.                                 - 148 -
  8632. ................................................................................
  8633.