![]() |
|
![]() |
--*
-- InfoLib - Access to information in a DFL.
--
-- When requesting information, the standard name (not the alias)
-- should be used for relation, field, and form names. This name
-- may be derived from the alias name by calling the
-- "Sage.ConvertRelationAliasToName", "Sage.ConvertFieldAliasToName",
-- or "Sage.ConvertFormAliasToName" procedures. To convert a
-- name returned by this package to its alias, you may use
-- "Sage.GetRelationAlias", "Sage.GetFieldAlias", or
-- "Sage.GetFormAlias".
--
subtype InfoName is string (1 .. 8);
type DesInfo is record
TheName : InfoName;
Des : string (1 .. 30) := (others => ASCIIX.nul);
end record;
type JoinInfo is record
rel1 : InfoName;
Field1 : InfoName;
rel2 : InfoName;
Field2 : InfoName;
end record;
type FieldID is record
relName : InfoName;
fieldName : InfoName;
end record;
type InfoName_U_Array is array (ModSys.S_Integer range <>) of InfoName;
type DesInfo_U_Array is array (ModSys.S_Integer range <>) of DesInfo;
type JoinInfo_U_Array is array (ModSys.S_Integer range <>) of JoinInfo;
type FieldID_U_Array is array (ModSys.S_Integer range <>) of FieldID;
procedure CurrentFieldInfo
(currentRecord : out string;
currentField : out string;
currentRepeat : out ModSys.S_Natural);
--*
-- CurrentFieldInfo - Return the current form status information.
--
--
-- This procedure returns the information concerning the
-- current record and field. This may be the field in which the
-- cursor resides on a form, and, if not in a form, the current
-- or last referenced field of a record. If in DefineFieldCheck,
-- it is the record and field which is being checked.
--
-- CALLING SEQUENCE -
--
-- CurrentFieldInfo (currentRecord, currentField, currentRepeat)
--
-- EXIT -
--
-- currentRecord : string
-- Name of current relation.
--
-- currentField : string
-- Name of the current relation field.
--
-- currentRepeat : ModSys.S_natural
-- The repeat value of the current field (1..n).
--
procedure CurrentFormInfo
(currentForm : out string;
currentRecord : out string;
currentField : out string;
currentRepeat : out ModSys.S_Natural;
tabOrder : out ModSys.S_Natural);
--*
-- CurrentFormInfo - Return the current form status information.
--
--
-- This procedure returns the information concerning the current form
-- where the cursor resides. This information is useful for such
-- functions as the DefinedFieldCheck for checking valid field values and
-- for the DisplayFormV-type calls.
--
-- CALLING SEQUENCE -
--
-- CurrentFormInfo (currentForm, currentRecord, currentField, currentRepeat)
--
-- EXIT -
--
-- currentForm : string
-- The current form where the cursor resides.
--
-- currentRecord : string
-- Name of relation on the form where cursor currently resides
--
-- currentField : string
-- Name of the relation field associated with the field on the form where
-- the cursor currently resides.
--
-- currentRepeat : ModSys.S_natural
-- The repeat value of the current field (1..n).
--
-- tabOrder : ModSys.S_natural
-- The tab order (1..n) or the indicated field within the form.
--
-- EXAMPLE -
--
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo2 is
--
-- -- Assume that we are in CheckLib. This Demo will return the
-- -- current form information so that you can check various fields.
-- -- (See also Checklib.)
--
-- returnfieldname : string(1..8);
-- returnrelation : string(1..8);
-- returnform : string(1..8);
--
-- fieldrepeat : ModSys.S_Natural;
-- tabPosition : ModSys.S_Natural;
-- errorvalue : ModSys.S_Natural;
--
-- begin
-- -- Assume that OpenSystem has been called and that a DisplayForm
-- -- or similar procedure was called just prior to this statement.
-- -- We also assume that this code is in a CheckLib.ADB.
--
-- InfoLib.CurrentFormInfo (currentForm => returnform,
-- currentRecord => returnrelation,
-- currentField => returnfieldname,
-- currentRepeat => fieldrepeat;
-- tabOrder => tabPosition);
-- end InDemo2;
--
procedure FieldBlank
(Relation : in string;
Field : in string;
Blank : in out boolean;
Error : in out ModSys.S_Natural);
--*
-- FieldBlank - Return a field blank/empty indicator.
--
--
-- This routine returns TRUE if the requested field in memory is blank
-- (nul and/or blank filled).
--
-- CALLING SEQUENCE -
--
-- FieldBlank (relation, field, blank, error)
--
-- ENTRY -
--
-- relation : string
-- The name of the relation to get the information from.
--
-- field : string
-- The name of the field to be used.
--
-- EXIT -
--
-- blank : boolean
-- Field is blank (TRUE) or not.
--
-- error : ModSys.S_Natural
-- An error flag indicating the result of the operation.
--
-- EXAMPLE -
--
-- with Display;
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo22 is
-- -- Suppose in Checklib you wanted to see if a field was blank or
-- -- not. This demo will detect a blank field.
--
-- blank : boolean;
--
-- errorValue : ModSys.S_Natural;
--
-- begin
-- -- Assume that 'OpenSystem' has been called and there is a
-- -- relation 'DEMOREL2' with a field 'PSSN' in the DFL. Also,
-- -- assume that we are in Checklib after a form has been displayed
-- -- and the field 'PSSN' was defined as the current field.
--
-- InfoLib.FieldBlank (relation => "DEMOREL2",
-- field => "PSSN",
-- blank => blank,
-- error => errorvalue);
--
-- if blank then
-- Display.DisplayMessage (Message => "Fill out information.",
-- Bell => True);
-- end if;
--
-- -- continue on with other Checklib items.
-- end InDemo22;
--
procedure FieldEmpty
(Relation : in string;
Field : in string;
Empty : in out boolean;
Error : in out ModSys.S_Natural);
--*
-- FieldEmpty - Return a field empty indicator.
--
--
-- This routine returns TRUE if the requested field in memory is empty
-- (nul-filled).
--
-- CALLING SEQUENCE -
--
-- FieldEmpty (relation, field, empty, error)
--
-- ENTRY -
--
-- relation : string
-- The name of the relation to get the information from.
--
-- field : string
-- The name of the field to be used.
--
-- EXIT -
--
-- empty : boolean
-- Field is empty (TRUE) or not.
--
-- error : ModSys.S_Natural
-- An error flag indicating the result of the operation.
--
-- EXAMPLE -
--
-- with Display;
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo21 is
-- -- Suppose in Checklib you wanted to see if a field was
-- -- nul-filled. This demo will detect an empty field.
--
-- empty : boolean;
--
-- errorValue : ModSys.S_Natural;
--
-- begin
-- -- Assume that 'OpenSystem' has been called and there is a
-- -- relation 'DEMOREL2' with a field 'PSSN' in the DFL. Also,
-- -- assume that we are in Checklib after a form has been displayed
-- -- and the field 'PSSN' was defined as the current field.
--
-- InfoLib.FieldEmpty (relation => "DEMOREL2",
-- field => "PSSN",
-- empty => empty,
-- error => errorvalue);
--
-- if empty then
-- Display.DisplayMessage (Message => "Fill out information.",
-- Bell => True);
-- end if;
--
-- -- continue on with other Checklib items.
-- end InDemo21;
--
procedure GetDes
(relName : in string;
desMax : in ModSys.S_Natural;
Des : in out DesInfo_U_Array;
desTotal : in out ModSys.S_Natural;
Error : in out ModSys.S_Natural);
--*
-- GetDes - Get the description for a relation and its fields.
--
--
-- This procedure retrieves the descriptions for the specified relation
-- and as many of its fields as can be contained in the supplied array.
--
-- CALLING SEQUENCE -
--
-- GetDes (relName, desMax, des, desTotal, error)
--
-- ENTRY -
--
-- relName : string
-- Relation name.
--
-- desMax : ModSys.S_natural
-- Maximum number of name/description (DesInfo) pairs to be retrieved.
--
-- EXIT -
--
-- des : DesInfo_u_array
-- Name/description pairs requested. The first pair will be for the
-- relation; the remaining pairs will be the field names and descriptions,
-- up to 'desMax' or the total number of fields in the relation, which
-- ever comes first.
--
-- desTotal : ModSys.S_natural
-- Total number of name/description pairs returned in the 'des' array.
--
-- error : ModSys.S_natural
-- Sage error (0=ok)
--
-- EXAMPLE -
--
-- with Display;
-- with InfoLib;
-- with ModSys;
-- with ThorPort;
--
-- procedure InDemo10 is
-- -- Suppose you wanted to show the user all of the names and
-- -- descriptions of the relation 'DEMOREL2', including the relation
-- -- description. Also, the maximum descriptions (including the
-- -- relation description) to be shown is 5.
--
-- descArray : InfoLib.DesInfo_u_array(1..5);
--
-- descTotal : ModSys.S_Natural;
-- errorValue : ModSys.S_Natural;
--
-- begin
-- -- Assume that 'OpenSystem' has been called and 'DEMOREL2' is
-- -- in the DFL.
--
-- InfoLib.GetDes (relName => "DEMOREL2",
-- desMax => 5,
-- des => descArray,
-- desTotal => descTotal,
-- error => errorValue);
--
-- for numDesc in 1..descTotal loop
-- Display.DisplayMessage (message => descArray(numDesc).name &
-- " " &
-- descArray(numDesc).des,
-- bell => False);
--
-- ThorPort.Pause(ThousandthSecond => 2000);
-- end loop;
--
-- end InDemo10;
--
procedure GetDFLVersion
(Indicator1 : in out ModSys.S_Natural;
Indicator2 : in out ModSys.S_Natural;
Indicator3 : in out ModSys.S_Natural);
--*
-- GetDFLVersion - Retreive the version ids for the current DFL.
--
--
-- This procedure returns the version ids for the current DFL file.
--
-- CALLING SEQUENCE -
--
-- GetDFLVersion (Indicator1, Indicator2, Indicator3);
--
-- ENTRY -
--
-- EXIT -
--
-- Indicator1 : Modsys.S_Natural
-- First version id.
--
-- Indicator2 : Modsys.S_Natural
-- Second version id.
--
-- Indicator3 : Modsys.S_Natural
-- Third version id.
--
procedure GetFieldDes
(relName : in string;
fieldName : in string;
Des : in out string;
Error : in out ModSys.S_Natural);
--*
-- GetFieldDes - Get a field's description.
--
--
-- This procedure retrieves a field's description (available if the DFL
-- was produced with THOR 3.1 or higher) for the specified field.
--
-- CALLING SEQUENCE -
--
-- GetFieldDes (relName, fieldName, des, error)
--
-- ENTRY -
--
-- relName : string
-- Relation name.
--
-- fieldName : string
-- Name of the relation's field.
--
-- EXIT -
--
-- des : string (1..30)
-- Field's description.
--
-- error : ModSys.S_natural
-- Sage error (0=ok)
--
-- EXAMPLE -
--
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo9 is
-- -- Suppose you wanted to show the user the description of the
-- -- field. 'PSSN' in the relation 'DEMOREL2'. This Demo will get
-- -- the description of 'PSSN' as it was entered in THOR.
--
-- description : string(1..30) := (others => ASCIIX.nul);
-- errorValue : ModSys.S_Natural;
--
-- begin
-- -- Assume that 'OpenSystem' has been called and the relation
-- -- 'DEMOREL2' with the field 'PSSN' is contained in the DFL.
--
-- InfoLib.GetFieldDes (relName => "DEMOREL2",
-- fieldName => "PSSN",
-- des => description,
-- error => errorValue);
--
-- end InDemo9;
--
procedure GetJoins
(viewName : in string;
startJoin : in ModSys.S_Natural;
TotalJoins : in out ModSys.S_Natural;
joinPairs : in out JoinInfo_U_Array);
--*
-- GetJoins - Return join pairs.
--
--
-- This procedure returns requested join pairs.
--
-- CALLING SEQUENCE -
--
-- GetJoins (viewName, startJoin, totalJoins, joinPairs)
--
-- ENTRY -
--
-- viewName : string
-- The name of the view.
--
-- startJoin : ModSys.S_natural
-- The number of the first join pair to return.
--
-- totalJoins : ModSys.S_natural
-- Max number of join pairs to return in the 'joinPairs' array. (1..n)
--
-- EXIT -
--
-- totalJoins : ModSys.S_natural
-- The number of join pairs returned in 'joinPairs'.
--
-- joinPairs : JoinInfo_u_array
-- The join pairs.
--
-- EXAMPLE -
--
-- SEE TotalViews
--
procedure GetMasterView
(viewName : in out string;
viewDes : in out string;
viewNum : in out ModSys.S_Natural);
--*
-- GetMasterView - Return master view information.
--
--
-- This procedure returns the master view information. If no master view
-- is available, then the 'viewNum' variable is returned with a 0 (zero).
--
-- CALLING SEQUENCE -
--
-- GetMasterView (viewName, viewDes, viewNum)
--
-- EXIT -
--
-- viewName : string
-- The name of the master view (up to 8 char).
--
-- viewDes : string
-- The description accompanying the master view (up to 30 char).
--
-- viewNum : ModSys.S_natural
-- View number (0..n) where 0 (zero) indicates that no master view is
-- present. Note - IF NO MASTER VIEW EXISTS, NO VIEWS ARE AVAILABLE.
--
-- EXAMPLE -
--
-- with Display;
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo11 is
-- -- Suppose you wanted to know if views exist, and if so, what is
-- -- the name of the master view. This demo will find out the
-- -- master view name.
--
-- viewName : string(1..8) := (others => ASCIIX.nul);
-- description : string(1..30) := (others => ASCIIX.nul);
--
-- numOfView : ModSys.S_Natural;
--
-- begin
-- -- Assume that 'OpenSystem' has been called.
--
-- InfoLib.GetMasterView (viewName => viewName,
-- viewDes => description,
-- viewNum => numOfView);
--
-- if numOfView > 0 then -- master view available
-- Display.DisplayMessage (message => "Master View is " &
-- viewName,
-- bell => False);
-- else
-- Display.DisplayMessage (message => "No views available.",
-- bell => True);
-- end if;
--
-- end InDemo11;
--
procedure GetRecordDes
(relName : in string;
Des : in out string;
Error : in out ModSys.S_Natural);
--*
-- GetRecordDes - Get a record's description.
--
--
-- This procedure retrieves the description (available if the DFL was
-- produced with THOR 3.1 or higher) for the specified record.
--
-- CALLING SEQUENCE -
--
-- GetRecordDes (relName, des, error)
--
-- ENTRY -
--
-- relName : string
-- Relation name.
--
-- EXIT -
--
-- des : string (1..30)
-- Record's (relation's) description.
--
-- error : ModSys.S_natural
-- Sage error (0=ok)
--
-- EXAMPLE -
--
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo8 is
-- -- Suppose you wanted to show the user the description of the
-- -- relation 'DEMOREL2'. This Demo will get the description of
-- -- 'DEMOREL2' as it was entered in THOR.
--
-- description : string(1..30) := (others => ASCIIX.nul);
--
-- errorValue : ModSys.S_Natural;
--
-- begin
-- -- Assume that 'OpenSystem' has been called and the relation
-- -- 'DEMOREL2' is contained in the DFL.
--
-- InfoLib.GetRecordDes (relName => "DEMOREL2",
-- des => description,
-- error => errorValue);
--
-- end InDemo8;
--
procedure GetViewFields
(viewName : in string;
startField : in ModSys.S_Natural;
totalFields : in out ModSys.S_Natural;
fields : in out FieldID_U_Array);
--*
-- GetViewFields - Return the requested field identifier.
--
--
-- This procedure returns the requested field identifiers (relation name
-- and field name pairs) from the selected view.
--
-- CALLING SEQUENCE -
--
-- GetViewFields (viewName, startField, totalFields, fields)
--
-- ENTRY -
--
-- viewName : string
-- The name of the view.
--
-- startField : ModSys.S_natural
-- The number of the first field ID to return.
--
-- totalFields : ModSys.S_natural
-- Max number of field ID values to return in the 'fields' array. (1..n)
--
-- EXIT -
--
-- totalFields : ModSys.S_natural
-- The number of field ID values returned.
--
-- fields : FieldID_u_array
-- An array of the requested field data. These data are in the form of
-- paired names of 8 characters each (see the 'FieldID' type description
-- at the first of this package) that contain the relation name/field name.
--
-- EXAMPLE -
--
-- SEE TotalViewFields
--
procedure GetViewNames
(startView : in ModSys.S_Natural;
TotalViews : in out ModSys.S_Natural;
viewNames : in out DesInfo_U_Array);
--*
-- GetViewNames - Return a list of view names and descriptions.
--
--
-- This procedure returns a list of the requested view names along with
-- their descriptions.
--
-- CALLING SEQUENCE -
--
-- GetViewNames (startView, totalViews, viewNames)
--
-- ENTRY -
--
-- startView : ModSys.S_natural
-- Starting view number to return in name list (1..n where n=total views).
--
-- totalViews : ModSys.S_natural
-- Total number of views to return in the list beginning at startView.
-- If more views are requested than available, the number available will
-- be returned.
--
-- EXIT -
--
-- totalViews : ModSys.S_natural
-- The number of view names/descriptions returned.
--
-- viewName : DesInfo_u_array
-- A list of view names and descriptions.
--
-- EXAMPLE -
--
-- SEE TotalViews
--
procedure GetViewRelations
(viewName : in string;
startRel : in ModSys.S_Natural;
totalRels : in out ModSys.S_Natural;
Rels : in out InfoName_U_Array);
--*
-- GetViewRelations - Get relation info from a view.
--
--
-- This procedure returns requested relation info from the selected view.
--
-- CALLING SEQUENCE -
--
-- GetViewRelations (viewName, startRel, totalRels, rels)
--
-- ENTRY -
--
-- viewName : string
-- The name of the view.
--
-- startRel : ModSys.S_natural
-- The number of the first relation to return;
--
-- totalRels : ModSys.S_natural
-- Max number of relations to return in 'rels' array (1..n).
--
-- EXIT -
--
-- totalRels : ModSys.S_natural
-- The number of relations returned.
--
-- rels : InfoName_u_array
-- The requested relation names from the view.
--
-- EXAMPLE -
--
-- SEE TotalViewRelations
--
procedure LastCursorField
(FormName : in string;
relName : out string;
fieldName : out string;
FldRepeat : out ModSys.S_Natural;
Error : out ModSys.S_Natural);
--*
-- LastCursorField - Return the last field the cursor was in.
--
--
-- This procedure returns the last field in the requested form in which
-- the cursor was located. This procedure should be called immediately
-- following the display and return from the form; otherwise, the saved
-- cursor location will be lost as subsequent forms are displayed.
-- Execution of this procedure resets the current form information.
--
-- CALLING SEQUENCE -
--
-- LastCursorField (formName, relName, fieldName, FldRepeat, error)
--
-- ENTRY -
--
-- formName : string
-- The name of the form
--
-- EXIT -
--
-- relName : string
-- The relation name of the associated field.
--
-- fieldName : string
-- Field name where cursor was located. This will be a null string if
-- the results could not be found
--
-- FldRepeat : ModSys.S_natural
-- The repeat value for the field.
--
-- error : ModSys.S_natural
-- Sage error status return (0=ok).
--
-- EXAMPLE -
--
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo1 is
--
-- -- Assume you need to know the last field you were in on a form
-- -- so that you could return to that same place on the form later.
-- -- This demo will give you the last field the cursor was in.
--
-- returnfieldname : string(1..8);
-- returnrelation : string(1..8);
--
-- fieldrepeat : ModSys.S_Natural;
-- errorvalue : ModSys.S_Natural;
--
-- begin
-- -- Assume that OpenSystem has already been called and that a
-- -- DisplayForm or similar procedure call has been called just
-- -- before this statement. Also, assume that 'STUDENT' is the
-- -- form that was last displayed.
--
-- InfoLib.LastCursorField (formName => "STUDENT",
-- relName => returnrelation,
-- fieldName => returnfieldname,
-- repeat => fieldrepeat,
-- error => errorvalue);
--
-- end InDemo1;
--
procedure RelationViewInfo
(viewName : in string;
relNumber : in ModSys.S_Natural;
relName : in string;
firstField : in out ModSys.S_Natural;
totalFields : in out ModSys.S_Natural);
--*
-- RelationViewInfo - Return info about a relation in a view.
--
--
-- This procedure returns field info about a relation from a
-- selected view. A view is composed of fields from one or
-- more relations. This procedure returns the field number of
-- the first field within all of the viewable fields that belong
-- to the given relation number.
--
-- CALLING SEQUENCE -
--
-- RelationViewInfo (viewName, relNumber, relName, firstField,
-- totalFields)
--
-- ENTRY -
--
-- viewName : string
-- The name of the view.
--
-- relNumber : ModSys.S_natural
-- Number of the relation within the view for which field information is
-- requested (set to 0 if 'relName' is to be supplied instead).
--
-- relName : string
-- The name of the relation for which information is required.
-- This is only used if 'relNumber' is set to 0 (zero).
--
-- EXIT -
--
-- firstField ; ModSys.S_natural
-- First field within all of the fields of the view which comes from the
-- requested relation.
--
-- totalFields : ModSys.S_natural
-- Total number of fields (numbered from 'firstField') contained in the
-- view and come from the selected relation. For example, of 'firstField'
-- were 3 and 'totalFields' were 5, then the fields for the relation
-- in the view would be field numbers 3..7.
--
-- EXAMPLE -
--
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo17 is
-- -- This demo will get the number of fields of a relation that are
-- -- associated with a view.
--
-- firstField : ModSys.S_Natural;
-- totalFields : ModSys.S_Natural;
--
-- begin
-- -- Assume that 'OpenSystem' has been called and that there is
-- -- a View name 'SSNS' and relation name 'DEMOREL2' in the DFL.
--
-- InfoLib.RelationViewInfo (viewName => "SSNS",
-- relNumber => 0,
-- relName => "DEMOREL2",
-- firstField => firstField,
-- totalFields => totalFields);
-- end InDemo17;
--
procedure ShowConcatInfo
(recordName : in string;
fieldNumber : in ModSys.S_Natural;
fieldName : in out string;
concatFields : in out InfoName_U_Array;
concatTotal : in out ModSys.S_Natural;
Error : in out ModSys.S_Natural);
--*
-- ShowConcatInfo - Return sub-fields of a concatenated field.
--
--
-- This procedure returns the subfields of a concatenated field. If the
-- field is not a concatenated field, the 'concatTotal' is returned with
-- a zero (0).
--
-- CALLING SEQUENCE -
--
-- ShowConcatInfo (recordName, FieldNumber, fieldName, concatFields,
-- concatTotal, error)
--
-- ENTRY -
--
-- recordName : string
-- Name of relation to which the field belongs.
--
-- FieldNumber : ModSys.S_natural
-- The number of the field (1..n) to be located. If this value
-- is set to 0 (zero), then the 'fieldName' is used.
--
-- fieldName : string
-- Name of the field to be located (if 'fieldNumber' is set to 0 (zero)).
--
-- EXIT -
--
-- fieldName : string
-- The name of the field.
--
-- concatFields : InfoName_u_array
-- Array of 8 character field names.
--
-- concatTotal : ModSys.S_natural
-- Number of names returned in 'concatFields'.
--
-- error : ModSys.S_natural
-- Sage error return (0 if ok).
--
-- EXAMPLE -
--
-- SEE ShowRecordInfo
--
procedure ShowFieldEnumeration
(recordName : in string;
fieldName : in string;
valueNumber : in ModSys.S_Natural;
eValue : out string;
totalValues : out ModSys.S_Natural;
Error : out ModSys.S_Natural);
--*
-- ShowFieldEnumeration - Return enumeration value for field.
--
--
-- This procedure returns the specified enumeration values for the
-- field if it exists.
--
-- CALLING SEQUENCE -
--
-- ShowFieldEnumeration (recordName, fieldName, valueNumber,
-- eValue, totalValues, error)
--
-- ENTRY -
--
-- recordName : string
-- Name of relation to which the field belongs.
--
-- fieldName : string
-- The name of the field.
--
-- valueNumber : ModSys.S_natural
-- The enumeration value number (1..n).
--
-- EXIT -
--
-- eValue : string
-- The enumeration value, if it exists
--
-- totalValues : ModSys.S_natural
-- The total number of enumeration values for the
-- field (0..n).
--
-- error : ModSys.S_natural
-- Sage error return (0 if ok). This value will be
-- set to zero if the field exists but no enumeration
-- values exists. In this case, the 'totalValues' will
-- be set to zero as well.
--
procedure ShowFieldInfo
(recordName : in string;
fieldNumber : in ModSys.S_Natural;
fieldName : in out string;
fieldType : in out ModSys.S_Natural;
alphaLength : in out ModSys.S_Natural;
definedLength : in out ModSys.S_Natural;
decimalDigits : in out ModSys.S_Natural;
fieldSubType : in out ModSys.S_Natural;
repeatTotal : in out ModSys.S_Natural;
KeyType : in out character;
Error : in out ModSys.S_Natural);
--*
-- ShowFieldInfo - Show information about the requested field.
--
--
-- This procedure displays information about the requested field if it
-- exists. Either the field number or the field name may be used to
-- reference the field.
--
-- CALLING SEQUENCE -
--
-- ShowFieldInfo (recordName, FieldNumber, fieldName, fieldType,
-- alphaLength, definedLength, decimalDigits,
-- fieldSubType, repeatTotal, keyType, error)
--
-- ENTRY -
--
-- recordName : string
-- Name of relation to which the field belongs.
--
-- FieldNumber : ModSys.S_natural
-- The number of the field (1..n) to be located. If this value
-- is set to 0 (zero), then the 'fieldName' is used.
--
-- fieldName : string
-- Name of the field to be located (if fieldNumber is set to zero).
--
-- EXIT -
--
-- fieldName : string
-- The name of the field if it exists.
--
-- fieldType : ModSys.S_natural
-- The type of the field.
--
-- alphaLength : ModSys.S_natural
-- Length of field as displayed on a form or returned as an alpha value.
--
-- definedLength : ModSys.S_natural
-- User-defined length of field. This is the length specified in the
-- THOR editor during schema definition. The length might not be the
-- same as the alphaLength since fields such as scientific notation fields
-- display longer than their defined length.
--
-- decimalDigits : ModSys.S_natural
-- Number of digits to right of decimal. This is only valid if the field
-- is one of the real number type fields (real, sci. notation, money).
--
-- fieldSubType : ModSys.S_natural
-- The field subtype.
--
-- repeatTotal : ModSys.S_natural
-- The number of repeat values defined for the field.
--
-- keyType : CHAR
-- The key type of the field ("P"=primary, "A"=alternate, "N"=non-keyed).
--
-- error : ModSys.S_natural
-- Sage error return (0 if ok).
--
-- EXAMPLE -
--
-- SEE ShowRecordInfo
--
procedure ShowFileInfo
(fileNumber : in ModSys.S_Natural;
dataFile : out string;
indexFile : out string;
blockFile : out string;
maxRecords : out ModSys.S_Natural;
Error : out ModSys.S_Natural);
--*
-- ShowFileInfo - Show the names associated with the given number.
--
--
-- This procedure returns the file names associated with the given file
-- set number, 'fileNumber'. These will be the names as defined within
-- the data dictionary (DFL) file. If any other path has been defined
-- from CONFIGUR or Sage.ResetRelationPath, the path may be retrieved
-- using Sage.GetRelationPath.
--
-- CALLING SEQUENCE -
--
-- ShowFileInfo (fileNumber, dataFile, indexFile, blockFile,
-- MaxRecords, error)
--
-- ENTRY -
--
-- fileNumber : ModSys.S_natural
-- The file set number.
--
-- EXIT -
--
-- dataFile : string
-- Name of data file and path as defined in current data dictionary file
-- (DFL file).
--
-- indexFile : string
-- The name of the index file and path as defined in the current
-- data dictionary file (DFL file).
--
-- blockFile : string
-- The name of the block file and path as defined in the current
-- data dictionary file (DFL file).
--
-- MaxRecords : Modsys.S_Natural
-- The maximum number of records allowed in this relation.
--
-- error : ModSys.S_natural
-- Sage error return (0 if ok).
--
procedure ShowFormFieldInfo
(FormName : in string;
fieldNumber : in ModSys.S_Natural;
relName : in out string;
fieldName : in out string;
FldRepeat : in out ModSys.S_Natural;
HelpForm : in out string;
displayType : in out ModSys.S_Natural;
row : in out ModSys.S_Natural;
column : in out ModSys.S_Natural;
tabOrder : in out ModSys.S_Natural;
Error : in out ModSys.S_Natural);
--*
-- ShowFormFieldInfo - Show information about a form's field.
--
--
-- This procedure displays information about a field of a requested form.
--
-- CALLING SEQUENCE -
--
-- ShowFormFieldInfo (formName, fieldNumber, relName, fieldName, FldRepeat,
-- helpForm, displayType, row, column, error)
--
-- ENTRY -
--
-- formName : string
-- Name of the requested form.
--
-- fieldNumber : ModSys.S_natural
-- Number of the requested field on the form. All fields are numbered
-- sequentially starting from the top left corner of the form and going
-- from left to right, top to bottom. (1..n)
--
-- EXIT -
--
-- relName : string
-- Name of the relation associated with the requested form field.
--
-- fieldName : string
-- Name of relation's field associated with requested form field.
--
-- FldRepeat : ModSys.S_natural
-- Repeat number of the relation's field used for the requested
-- field (1..n).
--
-- helpForm : string
-- Name of the help form associated with requested form field.
-- ("EXIT" is a reserved name for help processing termination.)
--
-- displayType : ModSys.S_natural
-- 0-Display only, 1-Display/Entry, 2-Highlighted.
--
-- row : ModSys.S_natural
-- The row on the screen where the form field begins (1..24).
--
-- column : ModSys.S_natural
-- The column on the screen where the form field begins (1..80).
--
-- tabOrder : ModSys.S_natural
-- The tab order of the specified field.
--
-- error : ModSys.S_natural
-- Sage error (0=ok)
--
-- EXAMPLE -
--
-- SEE ShowFormInfo
--
procedure ShowFormFieldColor
(FormName : in string;
fieldNumber : in ModSys.S_Natural;
normalColor : out ModSys.S_Natural;
highlightColor : out ModSys.S_Natural;
Error : out ModSys.S_Natural);
procedure ShowFormInfo
(FormNumber : in ModSys.S_Natural;
FormName : in out string;
FieldTotal : in out ModSys.S_Natural;
HelpForm : in out string;
topRow : in out ModSys.S_Natural;
bottomRow : in out ModSys.S_Natural;
leftColumn : in out ModSys.S_Natural;
rightColumn : in out ModSys.S_Natural;
Error : in out ModSys.S_Natural);
--*
-- ShowFormInfo - Show information about the requested form.
--
--
-- This procedure returns information about the requested form. The form
-- may be designated by sequential number (sorted alphabetically) or name.
--
-- CALLING SEQUENCE -
--
-- ShowFormInfo (formNumber, formName, fieldTotal, helpForm, topRow,
-- bottomRow, leftColumn, rightColumn, error)
--
-- ENTRY -
--
-- formNumber : ModSys.S_natural
-- Sequential number of form (1..n) or 0 if the form name is to
-- be used instead.
--
-- formName : string
-- The name of the requested form if the 'formNumber' has been
-- set to 0 (zero).
--
-- EXIT -
--
-- formName : string
-- The name of the form.
--
-- fieldTotal : ModSys.S_natural
-- The number of fields found on the form.
--
-- helpForm : string
-- The name of the general help form associated with the requested
-- form (or null string if none defined). ("EXIT" is a reserved
-- name for help processing termination.)
--
-- topRow : ModSys.S_natural
-- The top row of the form on the screen (1..24).
--
-- bottomRow : ModSys.S_natural
-- The bottom row of the form on the screen (topRow..24).
--
-- leftColumn : ModSys.S_natural
-- The left column of the form on the screen (1..80).
--
-- rightColumn : ModSys.S_natural
-- The right column of the form on the screen (leftColumn..80).
--
-- error : ModSys.S_natural
-- Sage error (0=ok).
--
-- EXAMPLE -
--
-- with Display;
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo7 is
--
-- -- Assume that for a particular form we want to see if a field is
-- -- named 'PSSN'. Use ShowFormInfo to get how many fields are in
-- -- the form and then use ShowFormFieldInfo to get each field's
-- -- name.
--
-- returnHelpForm : string(1..8) := (others => ASCIIX.nul);
-- returnFormName : string(1..8) := (others => ASCIIX.nul);
-- returnFieldName : string(1..8) := (others => ASCIIX.nul);
-- returnRelName : string(1..8) := (others => ASCIIX.nul);
--
-- repeatValue : Modsys.S_Natural := 0;
-- typeOfDisplay : Modsys.S_Natural := 0;
-- row : Modsys.S_Natural := 0;
-- column : Modsys.S_Natural := 0;
-- tabPosition : Modsys.S_Natural := 0;
-- errorValue : Modsys.S_Natural := 0;
--
-- numOfFields : Modsys.S_Natural := 0;
-- topRow : Modsys.S_Natural := 0;
-- bottomRow : Modsys.S_Natural := 0;
-- leftcolumn : Modsys.S_Natural := 0;
-- rightcolumn : Modsys.S_Natural := 0;
--
-- begin
-- -- assume that OpenSystem has been called and that the form
-- -- 'STUDENT' is in the DFL.
--
-- returnFormName(1..7) := "STUDENT";
--
-- InfoLib.ShowFormInfo (formNumber => 0,
-- formName => returnFormName,
-- fieldTotal => numOfFields,
-- helpForm => returnHelpForm,
-- topRow => topRow,
-- bottomRow => bottomRow,
-- leftColumn => leftColumn,
-- rightColumn => rightColumn,
-- error => errorValue);
--
-- for fieldnum in 1..numOfFields loop
-- InfoLib.ShowFormFieldInfo (formName => "STUDENT",
-- fieldNumber => fieldnum,
-- relName => returnRelName,
-- fieldName => returnFieldName,
-- repeat => repeatValue,
-- helpForm => returnHelpForm,
-- displayType => typeOfDisplay,
-- row => row,
-- column => column,
-- tabOrder => tabPosition,
-- error => errorValue);
--
-- if returnFieldName(1..4) = "PSSN" then
-- Display.DisplayMessage (message => "PSSN found.",
-- bell => True);
--
-- exit;
-- end if;
-- end loop;
--
-- end InDemo7;
--
procedure ShowRecordInfo
(recordNumber : in ModSys.S_Natural;
recordName : in out string;
fileNumber : out ModSys.S_Natural;
FieldTotal : out ModSys.S_Natural;
recordSize : out ModSys.S_Natural;
Version : out TimeDate.Time;
Error : out ModSys.S_Natural);
--*
-- ShowRecordInfo - Retrieve and show record information.
--
--
-- This procedure retrieves information about the specified record and
-- returns it. Either the record number or the record name may be used.
--
-- CALLING SEQUENCE -
--
-- ShowRecordInfo (recordNumber, recordName, fileNumber, fieldTotal,
-- recordSize, Version, error)
--
-- ENTRY -
--
-- recordNumber : ModSys.S_natural
-- Number of the record (1..n) to be located. If this value is set to
-- zero, the 'recordName' will be used to locate the requested record.
--
-- recordName : string
-- Name of record to be located if 'recordNumber' is set to zero.
--
-- EXIT -
--
-- recordName : string
-- The name of the record.
--
-- fileNumber : ModSys.S_natural
-- Number of file associated with relation (zero if a temporary relation).
--
-- fieldTotal : ModSys.S_natural
-- The number of fields in the record.
--
-- recordSize : ModSys.S_natural
-- The actual byte size of the record.
--
-- Version : TimeDate.Time
-- The version of the relation. Can be converted to usable format with
-- TimeLib.ClockToTime1.
--
-- error : ModSys.S_natural
-- Sage error return (0 if ok).
--
-- EXAMPLE -
--
-- with Display;
-- with InfoLib;
-- with ModSys;
--
-- procedure InDemo3 is
-- -- Suppose that we need to know if any fields are concatenated within
-- -- the relation 'DEMOREL2' and what fields are concatenated. First,
-- -- use ShowRecordInfo to find out how many fields are in the relation.
-- -- Next, use ShowFieldInfo to get each field name and check if its
-- -- fieldType is 0 (concatenated). With the name of the concatenated
-- -- field, call ShowConcatInfo to see which fields are used for the
-- -- concatenation.
--
-- returnRecord : string(1..8);
-- returnFieldName : string(1..8);
--
-- sizeOfRecord : ModSys.S_Natural;
-- fileNum : ModSys.S_Natural;
-- numFields : ModSys.S_Natural;
-- errorValue : ModSys.S_Natural;
--
-- typeOfField : ModSys.S_Natural;
-- fieldAlphaLength : ModSys.S_Natural;
-- fieldDefLength : ModSys.S_Natural;
-- numDecDigits : ModSys.S_Natural;
-- numRepeats : ModSys.S_Natural;
-- totalConcat : ModSys.S_Natural;
--
-- keyValue : character;
-- nullstring : string(1..8) := (others => ASCIIX.nul);
-- concatFields : Infolib.InfoName_u_array(1..5) :=
-- (others => nullstring);
--
-- begin
-- -- Assume that OpenSystem has been called and that the relation
-- -- 'DEMOREL2' is in the DFL.
--
-- returnRecord := "DEMOREL2";
--
-- InfoLib.ShowRecordInfo (recordNumber => 0,
-- recordName => returnRecord,
-- fileNumber => fileNum,
-- fieldTotal => numFields,
-- recordsize => sizeOfRecord,
-- error => errorValue);
--
-- for fieldNumb in 1..numFields loop
--
-- InfoLib.ShowFieldInfo (recordName => returnRecord,
-- fieldNumber => fieldNumb,
-- fieldName => returnFieldName,
-- fieldType => typeOfField,
-- alphaLength => fieldAlphaLength,
-- definedLength => fieldDefLength,
-- decimalDigits => numDecDigits,
-- repeatTotal => numRepeats,
-- keyType => keyValue,
-- error => errorValue);
--
-- if typeOfField = 0 then -- concatenated field
-- InfoLib.ShowConcatInfo (recordName => returnRecord,
-- fieldNumber => 0,
-- fieldName => returnFieldName,
-- concatFields => concatFields,
-- concatTotal => totalConcat,
-- error => errorValue);
--
-- Display.DisplayMessage (message => "Concat Field found.",
-- bell => True );
-- exit;
-- end if;
--
-- end loop;
--
-- end InDemo3;
--
function TotalJoins
(viewName : in string) return ModSys.S_Natural;
--*
-- TotalJoins - Return the total number of join pairs in a view.
--
--
-- This function returns the total number of join pairs in a selected
-- view.
--
-- CALLING SEQUENCE -
--
-- j := TotalJoins (viewName);
--
-- ENTRY -
--
-- viewName : string
-- The view name for which the number of joins is requested.
--
-- EXIT -
--
-- j : ModSys.S_natural
-- The total number of joins associated with the specified view.
--
-- EXAMPLE -
--
-- SEE TotalViews
--
function SystemModNumber return ModSys.S_Natural; --* -- SystemModNumber - Retrieve the system modification number. -- -- This is the number that controls access to DFL versions. -- For instance you can't open a version 2 DFL with the -- current libraries since they have advanced beyond that -- point. -- -- -- This procedure returns the system modification number. -- -- CALLING SEQUENCE - -- -- ModNumber := SystemModNumber (); -- -- ENTRY - -- -- None -- N/A -- -- EXIT - -- -- ModSys.S_Natural -- The system modification number. --
function TotalRelations return ModSys.S_Natural; --* -- TotalRelations - Retrieve the number of relations. -- -- -- This procedure returns the number of relations for the -- currently opened system. -- -- CALLING SEQUENCE - -- -- NumRels := TotalRelations; -- -- ENTRY - -- -- None -- N/A -- -- EXIT - -- -- ModSys.S_Natural -- Number of relations belonging to the current system. --
function TotalViewFields
(viewName : in string) return ModSys.S_Natural;
--*
-- TotalViewFields - The total number of fields in a view.
--
--
-- This function returns the total number of visible fields in the
-- selected view.
--
-- CALLING SEQUENCE -
--
-- r := TotalViewFields (viewName)
--
-- ENTRY -
--
-- viewName : string
-- The view name for which the number of associated fields is required.
--
-- EXIT -
--
-- r : ModSys.S_natural
-- The total number of fields associated with the specified view.
--
-- EXAMPLE -
--
-- with Display;
-- with InfoLib;
-- with ModSys;
-- with ThorPort;
--
-- procedure InDemo19 is
-- -- This demo will show how many fields are visible from a View and
-- -- then show some of those relation/field pairs.
--
-- fields : InfoLib.FieldID_u_array(1..10);
-- totalViewFields : ModSys.S_Natural;
--
-- begin
-- -- Assume that 'OpenSystem' has been called and that the View
-- -- name 'SSNS' is in the DFL.
--
-- totalViewFields := InfoLib.TotalViewFields (viewName => "SSNS");
--
-- Display.DisplayMessage (message => "Total fields viewable is " &
-- integer'image(totalViewFields),
-- bell => False);
--
-- ThorPort.Pause (ThousandthSecond => 2000);
--
-- if totalViewFields > 10 then
-- totalViewfields := 10;
-- end if;
--
-- InfoLib.GetViewFields (viewName => "SSNS",
-- startField => 1,
-- totalFields => totalViewFields,
-- fields => fields);
--
-- for fieldNum in 1..totalViewFields loop
--
-- Display.DisplayMessage (message => fields(fieldNum).relName &
-- " " &
-- fields(fieldNum).fieldName,
-- bell => False);
--
-- ThorPort.Pause (ThousandthSecond => 2000);
--
-- end loop;
--
-- end InDemo19;
--
function TotalViewRelations
(viewName : in string) return ModSys.S_Natural;
--*
-- TotalViewRelations - Total number of relations accessed by view.
--
--
-- This function returns the total number of relations that are visible
-- from the selected view.
--
-- CALLING SEQUENCE -
--
-- r := TotalViewRelations (viewName)
--
-- ENTRY -
--
-- viewName : string
-- View name for which number of associated relations is required.
--
-- EXIT -
--
-- r : ModSys.S_natural
-- Total number of relations associated with the specified view.
--
-- EXAMPLE -
--
-- with Display;
-- with InfoLib;
-- with ModSys;
-- with ThorPort;
--
-- procedure InDemo is
-- -- This demo will show how many relations are visible from a View
-- -- and then show some of those relations.
--
-- totalRelations : ModSys.S_Natural;
-- relations : InfoLib.InfoName_u_array(1..10);
--
-- begin
-- -- Assume that 'OpenSystem' has been called and that the View
-- -- name 'SSNS' is in the DFL.
--
-- totalRelations := InfoLib.TotalViewRelations
-- (viewName => "SSNS");
--
-- Display.DisplayMessage (message =>
-- "Total relations viewable is " &
-- integer'image(totalRelations),
-- bell => False);
--
-- ThorPort.Pause (ThousandthSecond => 2000);
--
-- if totalRelations > 10 then
-- totalRelations := 10;
-- end if;
--
-- InfoLib.GetViewRelations (viewName => "SSNS",
-- startRel => 1,
-- totalRels => totalRelations,
-- rels => relations);
--
-- for relationNum in 1..totalRelations loop
-- Display.DisplayMessage (message => relations(relationNum),
-- bell => False);
--
-- ThorPort.Pause (ThousandthSecond => 2000);
--
-- end loop;
--
-- end InDemo;
--
function TotalViews return ModSys.S_Natural; --* -- TotalViews - Return the total number of views available. -- -- -- This function returns the total number of views available in the -- current data base dictionary file. -- -- CALLING SEQUENCE - -- -- t := TotalViews; -- -- EXIT - -- -- t : ModSys.S_natural -- The total number views available. -- -- EXAMPLE - -- -- with Display; -- with InfoLib; -- with ModSys; -- with ThorPort; -- -- procedure InDemo12 is -- -- This Demo shows how many views exist in the DFL and goes -- -- through each view, displaying the view name and the associated -- -- joins. It also shows how many joins exist for the view name. -- -- viewNames : InfoLib.DesInfo_u_array(1..5); -- joinPairs : InfoLib.JoinInfo_u_array(1..5); -- -- numOfViews : ModSys.S_Natural; -- totalnumJoins : ModSys.S_Natural; -- -- begin -- -- Assume that 'OpenSystem' has been called. -- -- numOfViews := InfoLib.TotalViews; -- -- Display.DisplayMessage (message => "Total Number of Views = " & -- integer'image(numOfViews), -- bell => False); -- -- ThorPort.Pause(ThousandthSecond => 2000); -- -- InfoLib.GetViewNames (startView => 1, -- totalViews => numOfViews, -- viewNames => viewNames); -- -- for viewNum in 1..numOfViews loop -- -- Display.DisplayMessage (message => "View name = " & -- viewNames(viewNum).name, -- bell => False); -- -- ThorPort.Pause (ThousandthSecond => 2000); -- -- totalNumJoins := -- InfoLib.TotalJoins (viewName => viewNames(viewNum).name); -- -- Display.DisplayMessage (message =>"Total Number of Joins = " & -- integer'image(totalNumJoins), -- bell => False); -- -- ThorPort.Pause(ThousandthSecond => 2000); -- -- InfoLib.GetJoins (viewName => "SSNS", -- startJoin => 1, -- totalJoins => totalNumJoins, -- joinPairs => joinPairs); -- -- for joinNum in 1..totalNumJoins loop -- Display.DisplayMessage (message => "Relation 1 name = " & -- joinPairs(joinNum).rel1, -- bell => False); -- -- ThorPort.Pause (ThousandthSecond => 2000); -- -- Display.DisplayMessage (message => "Relation 2 name = " & -- joinPairs(joinNum).rel2, -- bell => False); -- -- ThorPort.Pause (ThousandthSecond => 2000); -- end loop; -- end loop; -- -- end InDemo12; --
procedure CharacterIsValid
(RelationName : in string;
fieldName : in string;
TheChar : in out character;
charOffset : in ModSys.S_Natural;
valid : in out boolean);
--*
-- CharacterIsValid - Check validity of character in field.
--
--
-- This procedure checks the validity of a given character against
-- a field at a specified position.
--
-- CALLING SEQUENCE -
--
-- CharacterIsValid (relationName, fieldName,
-- TheChar, charOffset)
--
-- ENTRY -
--
-- relationName : String
-- Name of relation.
--
-- fieldName : String
-- Name of field within 'relationName'.
--
-- TheChar : Character
-- Character to check.
--
-- charOffset : ModSys.S_Natural
-- Positon of character within the field (0..n).
--
-- EXIT -
--
-- valid : boolean
-- TRUE = character is valid.
--
procedure ValidateField
(RelationName : in string;
fieldName : in string;
Value : in string;
Error : in out ModSys.S_Natural);
--*
-- ValidateField - Check validity of Field in record.
--
--
-- This procedure checks the validity of a given Field in the record.
-- This procedure is NOT TO BE USED FOR CONCATENATED FIELDS, and such
-- fields.
--
-- CALLING SEQUENCE -
--
-- ValidateField (relationName, fieldName, value, error)
--
-- ENTRY -
--
-- relationName : String
-- Name of relation.
--
-- fieldName : String
-- Name of field within 'relationName'.
--
-- value : String
-- Field value to check.
--
-- EXIT -
--
-- error : ModSys.S_Natural
-- Error status return (0=ok).
--
Send mail to
warren.merrill@inl.gov
with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance