home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!ucbeh.san.uc.edu!torbecvs
- From: torbecvs@ucbeh.san.uc.edu
- Newsgroups: comp.databases
- Subject: re:Dbase III question
- Message-ID: <1993Jan21.181803.2523@ucbeh.san.uc.edu>
- Date: 21 Jan 93 18:18:03 EST
- References: <93020.210833U56779@uicvm.uic.edu>
- Distribution: world
- Organization: Univ. of Cincinnati
- Lines: 49
-
- In article <93020.210833U56779@uicvm.uic.edu>, <U56779@uicvm.uic.edu> writes:
- > I working on a programm where I want to be as easy as possible.
- > I created a name field in the .dbf file. I call it by using
- > x=space(20)
- > @12,12 "Enter name " get x picture "!XXXXXXXXXXXXXXXXXXXX"
- > read
- >
- > This way it will allow user to type name with first letter being
- > capitalized. My question is that is there a way so that last name
- > typed after a space within the same field could also have the
- > first letter capitalized?
- > I would appreciate all the help.
- >
- > -AP.
- Well AP, unless you are willing to simply capitalize the whole picture
- (EX: PICTURE "!!!!!!!!!!!!!!!!!!!!") I can't think of any way to capitalize the
- first letter of the last name while still in the READ.
- You're OPTIONS as I see it:
- 1) Use PICTURE "!!!!!!!!!!!!!!!!!!!!" and capitalize the whole
- thing when getting input,
-
- 2) Add a last name field (or initialize/get a last name
- variable if operating outside .dbf file) and use another
- picture statement to control the input case of the variable
- or
- 3) Alter the variable "x" after the READ is executed.
-
- The first two options are self explanatory, the last is pretty easy too!
- (with the use of a couple dBASE string functions).
-
- For #3
- > nMEMVAR=AT(x," ") ... (check syntax, it may be AT(" ",x), I'm not sure)
- - if there isn't a space, a value will be 0, otherwise
- the location of the space is returned.
-
- > x=LEFT(x,nMEMVAR)+UPPER(SUBSTR(X,nMEMVAR+1,1))+RIGHT(x,20-(nMEMVAR-1))
- | | |
- | | |
- First Name + space | |
- Capitalize first letter |
- of Last Name |
- Remainder of Last Name
-
- This will give you the name in the format "Zeke Jones"
-
- But seriously, it would probably be best to just capitalize everything,
- or use seperate First and Last Name variables.
-
- Good Luck, Scott
-