home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
USCX
/
DOSUT-03.ZIP
/
EDITNO.DOC
< prev
next >
Wrap
Text File
|
1983-07-20
|
2KB
|
39 lines
EDITNO consists of three BASIC subroutines for editing numeric
fields in a way that PRINT USING can not, especially for printing
Date and Time fields edited with a delimiter other than a comma, i.e.;
12/21/82 12-15-77 10:15 to 12:30, for example.
You tell EDITNO the number of significant digits desired in the
output field, LEFT of the decimal point if any ( ISIG ) and the
number of digits to the RIGHT of the decimal point ( IDEC ).
the DELIMITER to be used (such as a slash or colon ) is stored in the
string constant DLM$. If the number you supply to the routine is smaller
than the number of significant digits you requested, the field will be
padded to the left with the left pad character LPAD$. This would normally
be either a blank, a zero, or an asterisk, for example.
" " "0" "*"
For example, you might want the number 415 to appear as " 04:15 "
or the number 62782 to appear " 6/27/82 " in print.
INSTRUCTIONS FOR USE:
1. You should have a " DEFINT I " statement in your program for speediest
execution of the routines.
2. Renumber the routine as needed to be merged into your program
with the BASIC editor, if necessary.
3. You PASS the field you want edited to the routine by setting variable
"A2" equal to it:
100 DATE = 60283: A2 = DATE ' set input field for routine
4. the paramers discussed above are set for the desired options:
110 ISIG = 6% ' Number of significant digits desired for date field
120 IDEC = 0 ' No decimal places - for date field
130 DLM$ = "/" ' Edit with slashes
140 LPAD$=" " ' Pad to the left with blanks, i.e. Leading Zero Supress!
5. GOSUB to the desired routine (Take note when RENUM ming)
200 GOSUB 1730 ' First add the leading blank if required
210 GOSUB 1600 ' Stick Slash after every 2nd Character (including blanks)
6. Use the RETURNED field from O$ as your edited field:
220 DATX$=O$: PRINT DATX$ ' Print Result Field
6/27/83
7. Remember the field is returned as O$ and you set YOUR field equal to O$.