home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / 9291 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  2.5 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!ucbeh.san.uc.edu!torbecvs
  2. From: torbecvs@ucbeh.san.uc.edu
  3. Newsgroups: comp.databases
  4. Subject: re:Dbase III question
  5. Message-ID: <1993Jan21.181803.2523@ucbeh.san.uc.edu>
  6. Date: 21 Jan 93 18:18:03 EST
  7. References: <93020.210833U56779@uicvm.uic.edu>
  8. Distribution: world
  9. Organization: Univ. of Cincinnati
  10. Lines: 49
  11.  
  12. In article <93020.210833U56779@uicvm.uic.edu>, <U56779@uicvm.uic.edu> writes:
  13. > I working on a programm where I want to be as easy as possible.
  14. > I created a name field in the .dbf file.  I call it by using
  15. > x=space(20)
  16. >  @12,12 "Enter name " get x picture "!XXXXXXXXXXXXXXXXXXXX"
  17. > read
  18. > This way it will allow user to type name with first letter being
  19. > capitalized.  My question is that is there a way so that last name
  20. > typed after a space within the same field could also have the
  21. > first letter capitalized?
  22. > I would appreciate all the help.
  23. >                                                    -AP.
  24. Well AP, unless you are willing to simply capitalize the whole picture
  25. (EX: PICTURE "!!!!!!!!!!!!!!!!!!!!") I can't think of any way to capitalize the
  26. first letter of the last name while still in the READ.
  27.           You're OPTIONS as I see it:
  28.         1) Use PICTURE "!!!!!!!!!!!!!!!!!!!!" and capitalize the whole
  29.            thing when getting input, 
  30.  
  31.         2) Add a last name field (or initialize/get a last name 
  32.                    variable if operating outside .dbf file) and use another
  33.            picture statement to control the input case of the variable
  34.                     or
  35.         3) Alter the variable "x" after the READ is executed.
  36.  
  37.     The first two options are self explanatory, the last is pretty easy too!
  38.     (with the use of a couple dBASE string functions).
  39.  
  40.     For #3
  41.    >    nMEMVAR=AT(x," ") ... (check syntax, it may be AT(" ",x), I'm not sure)
  42.                 - if there isn't a space, a value will be 0, otherwise
  43.           the location of the space is returned.
  44.  
  45.    >    x=LEFT(x,nMEMVAR)+UPPER(SUBSTR(X,nMEMVAR+1,1))+RIGHT(x,20-(nMEMVAR-1))
  46.                     |                 |                      |
  47.                     |                 |                      |
  48.             First Name + space        |                      |
  49.                              Capitalize first letter         |
  50.                                   of Last Name               |
  51.                                                   Remainder of Last Name
  52.  
  53.                This will give you the name in the format "Zeke Jones"
  54.  
  55.     But seriously, it would probably be best to just capitalize everything,
  56.     or use seperate First and Last Name variables.
  57.  
  58.     Good Luck,  Scott
  59.