Sage-ST ä

Msagelib

Documentation

Global Declarations (Constants, Types, Variables)
CursorEditPosition RecordEd RecordEdH
RecordEdit RecordEditH ScrollRelation





  type PreModifyProcType is access
  procedure (TheChar : in out character);

  pragma Convention
          (WIN32,
           PreModifyProcType);

  type PostLocateProcType is access
  procedure;

  pragma Convention
          (WIN32,
           PostLocateProcType);




  procedure CursorEditPosition
             (RelationName : in     string;
              fieldName    : in     string);

  --*
  --  CursorEditPosition - Specify field to place the cursor during edit.
  --
  --
  --  This procedure allows the specification of the field in which
  --  to place the cursor if other than the command field as specified
  --  in the various editing procedures in this library.  This must
  --  be specified each time one of the editing procedures are called.
  --  The default is the command key field.
  --
  --  CALLING SEQUENCE -
  --
  --    CursorEditPosition (RelationName, FieldName)
  --
  --  ENTRY -
  --
  --    RelationName : string
  --      Name of record whose field will contain the cursor.
  --
  --    FieldName : string
  --      Name of field in which to place the cursor.
  --




  procedure RecordEdit
             (FormName        : in     string;
              RelationName    : in     string;
              KeyFieldName    : in     string;
              CommandRelation : in     string;
              CommandKey      : in     string);

  --*
  --  RecordEdit - Edit a relation's records.
  --
  --
  --  This procedure allows editing of a relations records.  Functions
  --  include locating, finding the next record, finding the previous
  --  record, adding a record, modifying an existing record, and deleting
  --  record.
  --
  --  CALLING SEQUENCE -
  --
  --    RecordEdit (FormName, RelationName, KeyFieldName, CommandRelation,
  --                CommandKey)
  --
  --  ENTRY -
  --
  --    FormName : string
  --      Name of form used for editing
  --
  --    RelationName : string
  --      Name of record to be edited
  --
  --    KeyFieldName : string
  --      Name of primary keyed field within the relation being edited that
  --      uniquely identifies a record.  An entry field on the form must
  --      exist for this field.  If the primary field is concatenated, the
  --      fields which are components of that field must have entry fields
  --      on the form.
  --
  --    CommandRelation : string
  --      Name of relation which contains the 'CommandKey' field.
  --
  --    CommandKey : string
  --      Key name used to receive the single letter command from the form.
  --      This field should be a 1-character upper-case-only type field.
  --      Commands processed in this procedure include the following -
  --
  --         'A'dd           'N'ext
  --         'D'elete        'M'odify
  --         'E'xit          'P'revious
  --         'L'ocate
  --
  --  EXAMPLE -
  --
  --    with MultSage;
  --    with MSageLib;
  --
  --    procedure Test is
  --    begin
  --      MultSage.OpenSystem ("Test.dfl",3,3,3000);
  --      MSageLib.RecordEdit ("MyForm","MyRel","MyFld","CmndR","CmndF");
  --      MultSage.CloseSystem;
  --    end Test;
  --




  procedure RecordEd
             (FormName        : in     string;
              RelationName    : in     string;
              KeyFieldName    : in     string;
              CommandRelation : in     string;
              CommandKey      : in     string;
              PreModify       : in     PreModifyProcType;
              PostLocate      : in     PostLocateProcType);

  --*
  --  RecordEd - Edit a relation's records.
  --
  --
  --  This procedure allows editing of a relations records.  Functions
  --  include locating, finding the next record, finding the previous
  --  record, adding a record, modifying an existing record, and
  --  deleting a record.
  --
  --  This procedure allows the programmer to execute two variable
  --  procedures which are passed in the argument list.  The first,
  --  or 'PreModify' procedure is executed after each form is sent
  --  with a modify type option such as 'add', 'delete', 'modify',
  --  or any command that is not a locate type command.
  --
  --  The second procedure, 'PostLocate', is executed after each
  --  locate type command is performed and before the form is again
  --  displayed.  Locate type commands are 'locate', 'next', and
  --  'previous'.  This is only executed if the 'SageError' is
  --  returns as 0 after a locate operation.
  --
  --  CALLING SEQUENCE -
  --
  --    RecordEd (FormName, RelationName, KeyFieldName,
  --              CommandRelation, CommandKey, PreModify, PostLocate)
  --
  --  ENTRY -
  --
  --    FormName : string
  --      Name of form used for editing
  --
  --    RelationName : string
  --      Name of record to be edited
  --
  --    KeyFieldName : string
  --      Name of primary keyed field within the relation to be
  --      edited that uniquely identifies a record.  An entry
  --      field in the form must exist for this field.  If the
  --      primary field is concatenated, the fields which are
  --      components of that field must have entry fields
  --      on the form.
  --
  --    CommandRelation : string
  --      Name of relation which contains the 'CommandKey' field.
  --
  --    CommandKey : string
  --      Key name used to receive the single letter command  from
  --      the  form.   This  field   should  be  a  1   characters
  --      upper-case only type field.  Commands processed in  this
  --      procedure include the following.
  --
  --        locate commands    modify commands       exit commands
  --        ---------------    ---------------       -------------
  --        "L"ocate           "A"dd                 "E"xit
  --        "P"revious         "M"odify              " " (exit)
  --        "N"ext             "D"elete
  --
  --    PreModify : PreModifyProcType
  --      The name of a procedure to be executed after a form  has
  --      been sent by the user and before any non-exit request is
  --      performed.   The  argument  is  the  1  letter   command
  --      requested by the user  as returned from the  form.  This
  --      command  may  be  any  letter.   If  the  command is not
  --      recognized as one of  the standard operations, an  error
  --      will  be  given  after  'PreModify'  is  executed.   The
  --      command letter may be  changed in 'PreModify' to  one of
  --      the acceptable commands  or a blank (" ") which will  be
  --      interpreted as a "do nothing" command.
  --
  --    PostLocate : PostLocateProcType
  --      The name of a procedure to be executed after the actual
  --      locate type command is successfully executed.  The
  --      locate commands are "L", "P", or "N" (locate, next, or
  --      previous).  If a Sage.SageError is returned as non-zero
  --      after execution of a locate type command, this
  --      procedure is not executed.
  --




  procedure RecordEditH
             (FormNameI        : in     string;
              RelationNameI    : in     string;
              KeyFieldNameI    : in     string;
              JoinFieldNameI   : in     string;
              FatherRelationI  : in     string;
              FatherJoinFieldI : in     string;
              CommandRelationI : in     string;
              CommandKeyI      : in     string);

  --*
  --  RecordEditH - Edit relation's records using hierarchical restrictions.
  --
  --
  --  This procedure allows editing of a relations records.
  --  Functions include locating, finding the next record, finding
  --  the previous record, adding a record, modifying an existing
  --  record, and deleting record.
  --
  --  The records available for editing may be restricted by a
  --  joined field from another existing record.  Only those records
  --  whose "join" field is equal to the "join" field of the defined
  --  "father" relation may be accessed.
  --
  --  CALLING SEQUENCE -
  --
  --    RecordEditH (FormNameI, RelationNameI, KeyFieldNameI,
  --                 JoinFieldNameI, FatherRelationI, FatherJoinFieldI)
  --
  --  ENTRY -
  --
  --    FormNameI : string
  --      Name of form used for editing
  --
  --    RelationNameI : string
  --      Name of record to be edited
  --
  --    KeyFieldNameI : string
  --      Name of primary keyed field within the relation being edited that
  --      uniquely identifies a record.  An entry field on the form must
  --      exist for this field.  If the primary field is concatenated, the
  --      fields which are components of that field must have entry fields
  --      on the form.
  --
  --    JoinFieldNameI : string
  --      Name of field in relation being edited to restrict by.
  --
  --    FatherRelationI : string
  --      Name of other relation that contains a field to restrict the
  --      editing of the fields in 'RelationNameI'.
  --
  --    FatherJoinFieldI : string
  --      Name of field in 'FatherRelationI' to use to restrict access to
  --      the relation being edited.  The current cpmtemts are compared
  --      against 'JoinFieldName' for equality.
  --
  --    CommandRelationI : string
  --      Name of relation which contains the 'CommandKeyI' field.
  --
  --    CommandKeyI : string
  --      Key name used to receive the single letter command from the form.
  --      This field should be a 1-character upper-case-only type field.
  --      Commands processed in this procedure include the following -
  --
  --           locate commands       modify commands       other
  --           ---------------       ---------------       -----
  --           'L'ocate              'A'dd                 'E'xit
  --           'P'revious            'M'odify
  --           'N'ext                'D'elete
  --




  procedure RecordEdH
             (FormName        : in     string;
              RelationName    : in     string;
              KeyFieldName    : in     string;
              JoinFieldName   : in     string;
              FatherRelation  : in     string;
              FatherJoinField : in     string;
              CommandRelation : in     string;
              CommandKey      : in     string;
              PreModify       : in     PreModifyProcType;
              PostLocate      : in     PostLocateProcType);

  --*
  --  RecordEdH - Edit a relation's records using hierarchical restrictions.
  --
  --
  --  This procedure allows editing of a relations records.  Functions
  --  include locating, finding the next record, finding the previous
  --  record, adding a record, modifying an existing record, and
  --  deleting a record.
  --
  --  This procedure allows the programmer to execute two variable
  --  procedures which are passed in the argument list.  The first,
  --  or 'PreModify' procedure is executed after each form is sent
  --  with a modify type option such as 'add', 'delete', 'modify',
  --  or any command that is not a locate type command.
  --
  --  The second procedure, 'PostLocate', is executed after each
  --  locate type command is performed and before the form is again
  --  displayed.  Locate type commands are 'locate', 'next', and
  --  'previous'.  This is only executed if the 'SageError' is
  --  returns as 0 after a locate operation.
  --
  --  The records available for editing may be restricted by
  --  a joined field from another existing record.  Only those records
  --  whose "join" field is equal to the "join" field of the defined
  --  "father" relaion may be accessed.
  --
  --  CALLING SEQUENCE -
  --
  --    RecordEdH (FormName, RelationName, KeyFieldName,
  --               JoinFieldName, FatherRelation, FatherJoinField,
  --               CommandRelation, CommandKey, PreModify, PostLocate)
  --
  --  ENTRY -
  --
  --    FormName : string
  --      Name of form used for editing
  --
  --    RelationName : string
  --      Name of record to be edited
  --
  --    KeyFieldName : string
  --      Name of primary keyed field within the relation to be
  --      edited that uniquely identifies a record.  An entry
  --      field in the form must exist for this field.  If the
  --      primary field is concatenated, the fields which are
  --      components of that field must have entry fields
  --      on the form.
  --
  --    JoinFieldName : string
  --      Name of field in relation being edited to restrict by.
  --
  --    FatherRelation : string
  --      Name of other relation that contains a field to restrict
  --      the editing of the fields in 'RelationName'.
  --
  --    FatherJoinField : string
  --      Name of field withing 'FatherRelation' to restrict
  --      access to the relation being edited.  The current
  --      contents are compared against 'JoinFieldName' for
  --      equality.
  --
  --    CommandRelation : string
  --      Name of relation which contains the 'CommandKey' field.
  --
  --    CommandKey : string
  --      Key name used to receive the single letter command from
  --      the form.  This field should be a 1 characters upper-case
  --      only type field.  Commands processed in this procedure
  --      include the following.
  --
  --        locate commands    modify commands       other
  --        ---------------    ---------------       -----
  --        "L"ocate           "A"dd                 "E"xit
  --        "P"revious         "M"odify
  --        "N"ext             "D"elete
  --
  --    PreModify : PreModifyProcType
  --      The name of a procedure to be executed after a form  has
  --      been sent by the user and before any non-exit request is
  --      performed.   The  argument  is  the  1  letter   command
  --      requested by the user  as returned from the  form.  This
  --      command  may  be  any  letter.   If  the  command is not
  --      recognized as one of  the standard operations, an  error
  --      will  be  given  after  'PreModify'  is  executed.   The
  --      command letter may be  changed in 'PreModify' to  one of
  --      the acceptable commands  or a blank (" ") which will  be
  --      interpreted as a "do nothing" command.
  --
  --    PostLocate : PostLocateProcType
  --      The name of a procedure to be executed after the actual
  --      locate type command is successfully executed.  The
  --      locate commands are "L", "P", or "N" (locate, next, or
  --      previous).  If a Sage.SageError is returned as non-zero
  --      after execution of a locate type command, this
  --      procedure is not executed.
  --
  --  EXAMPLE -
  --
  --    with MultSage;
  --    with MSageLib;
  --
  --    procedure Test is
  --
  --      procedure SonEdit;
  --
  --      procedure FamPreMod
  --                 (c : in out character) is
  --      begin
  --        IF (c = 'S') then      -- intercept the 'S' command
  --          SonEdit ("Form","SonR","KeyF","JoinFld",
  --                   "SonR","SonF","CmndR","CmndF");
  --          c := ' ';
  --        end if;
  --      end FamPreMod;
  --
  --      procedure MyPreMod
  --                 (c : in out character) is
  --      begin
  --        null;
  --      end MyPreMod;
  --
  --      procedure MyPostLoc is
  --      begin
  --        null;
  --      end MyPostLoc;
  --
  --      procedure FatherEdit is new MSageLib.RecordEditH
  --                 (FamPreMod,
  --                  MyPostLoc);
  --      procedure SonEdit is new MSageLib.RecordEditH
  --                 (FamPreMod,
  --                  MyPostLoc);
  --      procedure MyEdit is new MSageLib.RecordEditH
  --                 (MyPreMod,
  --                  MyPostLoc);
  --
  --    begin
  --      MultSage.OpenSystem ("Test.dfl",3,3,3000);
  --
  --    -- hierarchically constrained editor example
  --
  --      FatherEdit ("FamForm","FamRel","FamFld","JoinFld",
  --                  "FatherR","FatherF","CmndR","CmndF");
  --
  --    -- Special editor example (hierarchical editing inhibited)
  --
  --      MyEdit ("MyForm","MyRel","MyFld","","","","CmndR","CmndF");
  --
  --      MultSage.CloseSystem;
  --    end Test;
  --




  procedure ScrollRelation
             (FormName    : in     string;
              formRel     : in     string;
              formField   : in     string;
              relName     : in     string;
              fldName     : in     string;
              Format      : in     string;
              quickSearch : in     boolean);

  --*
  --  ScrollRelation - Display a highlighted scroll form for a relation.
  --
  --
  --  This procedure displays a form (similar to Display.DisplayFormVIP)
  --  fed by fields from the specified relation.  The relation name
  --  and keyed field are given as well as the format of the
  --  displayed line.  The form used to display the data is a form with
  --  multiple highlighted fields.   The format string used to define
  --  the contents (format) of each line contains pairs of field names
  --
  --  EXAMPLE -
  --
  --    format := "field1,1,field2,23,field3,50";
  --
  --    The format specification may be greater than can be contained within
  --    the field to which it is assigned on the form.  The right and left
  --    arrows are used to scroll right and left within the displayed
  --    data window.
  --
  --    This procedure may be called with the 'quickSearch' option set
  --    to true.  If so, a character pressed by the user will cause
  --    the cursor to be moved to and positioned on the record whose
  --    keyed field ('fldName') is less than or equal to that character.
  --    As each character is pressed, the internal search string is
  --    added to, and the associated record greater than or equal to
  --    that string will be positioned on.  The search continues adding to
  --    and searching on the progressively user supplied string until
  --    a space is encountered (entered by the user) or the requested
  --    search goes beyond the supplied records, at which time the string
  --    is cleared and starts over.
  --
  --    Key functions 57 through 60 (special exits 27 through 60) are used
  --    by this procedure for internal exits. (see Display.DefineFunctionKey
  --    documentation for further explanation)  After this procedure
  --    terminates, it will reset these key functions to whatever initial
  --    value they were previously assigned.
  --
  --  CALLING SEQUENCE -
  --
  --    ScrollRelation (formName, formRel, formField, relName, fldName,
  --                    format, quickSearch)
  --
  --  ENTRY -
  --
  --    formName : string
  --      Form to be used for the display.
  --
  --    formRel : string
  --      Relation associated with the field on the form used as the
  --      highlighted field (formField).
  --
  --    formField : string
  --      Field used as the highlighted field on the form.  This field will
  --      also be the field in which the cursor will be positioned.  This
  --      field name may include the "/n" format to designate in which
  --      occurrence of the field the cursor should be positioned.  If you
  --      want to position on the same line as as it was positioned the
  --      last time the form was shown, "/0" should be added to the form
  --
  --  EXAMPLE -
  --
  --    formField := "field1/581";   -- positions on line 581
  --      or
  --    formField := "field1/0";     -- positions at former line
  --
  --    relName : string
  --      Name of relation whose records appear on the form.
  --
  --    fldName : string
  --      Name of keyed field from 'relName' used to sort the records
  --      presented on the form.
  --
  --    format : string
  --      The format of fields to be presented within each highlighted
  --      field on the form.  Each field or literal string is presented
  --      as a pair (the name or literal and the location within the
  --      highlighted field (1..n)) with the comma (,) used as the
  --      separator.  For example -
  --
  --      format := "field1,1,'---',12,field2,5";
  --
  --    quickSearch : boolean
  --      Invoke the quick search option for any alpha keys pressed during
  --      the scroll presentation.  The space bar clears the search as
  --      previously described.
  --
  --  EXAMPLE -
  --
  --    with MultSage;
  --    with Display;
  --    with MSageLib;
  --    with ModSys;
  --
  --    procedure Test is
  --      fld : string (1..4);
  --      i   : ModSys.S_Natural16;
  --
  --    begin
  --      MultSage.OpenSystem ("Test.dfl",3,3,5000);
  --      fld := "A1  ";
  --      loop
  --        MSageLib.ScrollRelation ("MyForm","Utility",fld,"relName",
  --                 "keyName", "keyName,1,'*',16,des,17",TRUE);
  --        fld := "A1/0";
  --        i   := Display.VariableIndex;  -- the highlighted record #
  --        if (i = 0) then
  --          exit;
  --        end if;
  --      end loop;
  --      MultSage.CloseSystem;
  --    end Test;
  --




Send mail to   warren.merrill@inl.gov with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance