PAL CARD CATALOG ENTRY

SHORT DESCRIPTION

Build string from batch/interactive input


MOVEMENT WITHIN THE PAL CARD CATALOG
Move to top-level taxonomy
Move to keyword list

ASSET PROFILE

UNIT NAME
User_Input
VERSION
1
REVIEW CODE
C1 1.0 A
INET ADDRESS
sun1.disacim.osd.mil (134.152.9.140)
AUTHOR
Retired Army Personnel Systems
Software Development Center
Washington, D.C.
RIGHTS
Approved for Public Release; Distribution Unlimited
COPYRIGHT
None -- Public Domain.
DATE CREATED
July 3, 1991
DATE RELEASED
January 17, 1994
DATE LAST UPDATED
January 17, 1994
LOCATION
DSRS Library
PAL
ENVIRONMENT
DEC MICROVAX II running DEC Ada Version 2.0.
LIMITATIONS
Not documented in PAL database
CERTIFICATION
Ada System Certifier_1 1.0
Date/Time of Processing: Wednesday 25 May       1994 02:38:15Pm
Overall Assessment of System: OK
Classification of System: A
Basis of Classification --
Syntax Errors                               PASS
Completeness                                PASS
Independence from External Libraries        PASS
Independence from a Specific Ada Compiler   PASS

Number of ...
Files               3
Library Units       7
Lines            3253
Statements        506
Comments         1743

FILE LISTING

Directory Display


languages/ada/swcomps/dsrs/userin:
  File Name                 Size
  ---------                 ----
  userin.zip              30,000

languages/ada/swcomps/dsrs/strutil:
  File Name                 Size
  ---------                 ----
  strutil.zip             23,876

languages/ada/swcomps/dsrs/charutil:
  File Name                 Size
  ---------                 ----
  charutil.zip            15,401


Totals
  ==============  ==============
    3 Files               69,277

ABSTRACT

                                   User_Input
                                   01D001P2.1
                               (Old ID: WIC0003A)
PURPOSE/INTENDED USE:
User_Input is an Ada generic package that provides the operations
necessary to  build a string consisting of substrings input from either
a terminal (interactive mode) or a text file (batch mode).  It allows
the user to validate the input strings, to prompt for the input strings
to the current output file (usually the terminal), and/or to uppercase
the input strings.  These options are determined in the object "Values"
passed to the function Get. Any additional operations needed can be
built out of the operations provided in this package. 

User_Input also allows the user to define the input mode (from a file or
from the current input device).  If the input comes from a text file,
the user must call the procedure Open_Batch_File before the function
Get, and Close_Batch_File after.  Open_Batch_File and Close_Batch_File
procedures only open and close a text file, respectively.  Otherwise,
the user can either specify the input mode in the generic formal
procedure Get_Value or use the default procedure Get_Input which gets
the input string from the current input device (usually the terminal). 

EXAMPLE APPLICATIONS:
Reuse of this package would be valuable when an application needs to get
and  validate user input.  User input can be validated to insure that an
input  field contains no special characters, is numeric, is
alphanumeric, is empty, etc. 

An example of instantiating this package for a system wanting to
validate user input from a batch file is as follows: 

    package Validate is new User_Input;

CERTIFICATION LEVEL:
User_Input is certified at Level 4.  This means that the Defense
Information  Systems Agency/Center for Information Management Software
Reuse Program (SRP)  management office has successfully compiled the
code of this Reusable Software  Asset (RSA) and measured
maintainability, portability, reliability and reusability.  In addition,
this RSA includes a test suite and a Reuser's Manual, which will be
provided when the asset is extracted. 
 
IMPLEMENTATION ISSUES:
User_Input depends on (withs) String_Utilities (01D001O3) and the Ada 
predefined package Text_Io.

User_Input has the generic formal parameter procedure Get_Value.  A
sample of a file that may be used for the instantiation, procedure
Get_Input, is supplied as part of the extracted code.  The sample
Get_Input procedure depends on the Ada predefined package Text_Io.
Get_Value gets the user input string.  The form in which the string is
obtained is application specific. The declaration of the generic formal
parameter is 

   with procedure Get_Value (Input_String : in out STRING) is Get_Input; 

The batch file opened by the procedure Open_Batch_File and closed by the
procedure Close_Batch_File must be a text file. 

User_Input defines these exceptions:
  Batch_File_Already_Open       Batch_File_Does_Not_Exist 
  Batch_File_Is_Not_Open        Invalid_Input             
  Error_Getting_Input       

All system-defined exceptions will raise an appropriate package defined
exception and will propagate the exception back to the user. 

HARDWARE/ENVIRONMENT CONSTRAINTS AND LIMITATIONS:
This package was compiled on a DEC MICROVAX II running DEC Ada Version
2.0.

SUBUNITS:
User_Input has the following visible subunits:

  Open_Batch_File     Opens the specified text file for input.
  Close_Batch_File    Closes the open text file.
  Get                 Builds a string consisting of substrings input from 
                      either a terminal or a text file.  Each substring 
                      can be checked for validation, prompted with an input 
                      string and changed to uppercase.

DSRS CLASSIFICATION:
availability:  extractable
certification level:  level_4
component type:  implementation
data representation:  string
environment:  mvii/vms/vaxada
function:  close
function:  get
function:  open
function:  validate
function:  verify
language:  ada
object:  user_defined
object:  user_input
originator:  raps
unit type:  generic_package
unit type:  package

LEGAL RESTRICTIONS:
This RSA contains public domain data with unlimited rights for all
users.   Extraction is permitted to all authorized library users. This
software and its documentation are provided "as is" and without any
expressed or implied warranties whatsoever.  No warranties as to
performance, merchantability, or fitness for a particular purpose exist.

The user is advised to test the software thoroughly before relying on
it.  The user must assume the entire risk and liability of using this
software.  In no event shall any person or organization of people be
held responsible for any direct, indirect, consequential or
inconsequential damages or lost profits. 

MISCELLANEOUS:
The standard for Level 4 certification has recently been upgraded. This
asset is currently undergoing modification to meet the new Level 4
requirements. 


REVISION HISTORY

January 17, 1994 Version 1 Original submission to PAL


RELEASE NOTICE

This prologue must be included in all copies of this software.
Restrictions on use or distribution:  NONE

LEGAL RESTRICTIONS:
This RSA contains public domain data with unlimited rights for all
users.   Extraction is permitted to all authorized library users. This
software and its documentation are provided "as is" and without any
expressed or implied warranties whatsoever.  No warranties as to
performance, merchantability, or fitness for a particular purpose exist.


DISCLAIMER

 This software and its documentation are provided "AS IS" and
without any expressed or implied warranties whatsoever.  No warranties
as to performance, merchantability, or fitness for a particular
purpose exist.
 The user is advised to test the software thoroughly before
relying on it.  The user must assume the entire risk and liability of
using this software.  In no event shall any person or organization of
people be held responsible for any direct, indirect, consequential or
inconsequential damages or lost profits.