160 likes | 307 Views
Formatted Input. Similar to column input in that fixed column locations are assumed for variable valuesAllows for standard or non-standard numeric or character valuesNon-standard numeric: dates, numbers with commas and/or dollar signs12JAN2000$1,245.2311/21/02. For formatted input, the form of
E N D
1. Formats and Formatted Input STT 305
2. Formatted Input Similar to column input in that fixed column locations are assumed for variable values
Allows for standard or non-standard numeric or character values
Non-standard numeric: dates, numbers with commas and/or dollar signs
12JAN2000 $1,245.23 11/21/02
3. For formatted input, the form of the input statement is:
input pointer-control variable informat … ;
Pointer control is of the form
@n — moves pointer to column n
+n — moves the pointer n positions
An informat specifies
The width of the field to be read
How (what type of data) to read the field
Formatted Input