home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
NAMES.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
4KB
|
74 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME NAMES .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
COLOR 7,0
CLS
? "┌─────────────────────────────────────────────────────────────────────────────
? "│ fDisplayName$ ( D$, Sep? )
? "│ fDisplayNameLF$ ( D$, Sep? )
? "│ fDisplayNameLFH$ ( D$, Sep? )
? "│ StripName ( D$, Sep?, L$, F$, H$ )
? "├─────────────────────────────────────────────────────────────────────────────
? "│ Storage and manipulation of names is a very important part of any program
? "│ that is in the business of using this data. It is difficult for a programmer
? "│ to get it all right all the time but there is some small flicker of light at
? "│ the end of the tunnel! Throughout most of the western world there is a single
? "│ governing rule for printing names and honorifics: (Mr. PhD. etc) Preceding
? "│ honorifics are followed by a space and trailing honorifics are preceded by a
? "│ comma. Despite this, there are at least 3 formats that are required by the
? "│ users and, possibly, the program. Another problem is just how much space
? "│ should be reserved for the name? 17 chars is the average in the USofA but
? "│ if you force your user to input LASTNAME, FIRSTNAME you will quickly end-up
? "│ with a FIRSTNAME LASTNAME input that gets index all out of whack until it's
? "│ fixed. I offer my users 3 fields for a name: Last, First & Middle, and
? "│ honorifics. Each field is about 30 chars in length and I impose a maximum
? "│ length of the 3. This allows a variable length for each of the 3, protects
? "│ the data against bad input, and allows me to make several different styles
? "│ of the name for printing & displaying.
? "└──────────────────────────────────────────────────────────────────────────
LOCATE 25, 65 : PRINT "THUMP A BUTTON";
fAnyKey
CLS
D$ = "Schullian|Donald A.|Mr., Jr.,Esq."
Sep? = ASCII( "|" )
PRINT "Our data is stored like this: "; CHR$(34); D$; CHR$(34)
PRINT
StripName D$, Sep?, L$, F$, H$
PRINT " First Name: "; F$
PRINT " Last Name: "; L$
PRINT " Honorifics: "; H$
PRINT
N$ = fDisplayName$( D$, Sep? )
PRINT "The formal format: "; N$
PRINT
N$ = fDisplayNameLF$ ( D$, Sep? )
PRINT " Index style: "; N$
PRINT
N$ = fDisplayNameLFH$( D$, Sep? )
PRINT " Alternate Style: "; N$