home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 10 / Amoszine 10 (Disk 3 of 3).adf / Amos_Procs.lha / XStringUpperLower.proc / XStringUpperLower.amosSourceCode
Encoding:
AMOS Source Code  |  1991-12-03  |  474 b   |  20 lines

  1. Procedure XSTRINGUPPERLOWER[Z$]
  2.    ' By John Smit 
  3.    ' Used to convert a string into lower case with each word beginning with 
  4.    '    an Upper case letter. 
  5.    '    
  6.    If Z$="" Then Pop Proc
  7.    Z$=Lower$(Z$)
  8.    Left$(Z$,1)=Upper$(Left$(Z$,1))
  9.    X=Instr(Z$," ")
  10.    While X
  11.       Mid$(Z$,X+1,1)=Upper$(Mid$(Z$,X+1,1))
  12.       X=Instr(Z$," ",X+1)
  13.    Wend 
  14. End Proc[Z$]
  15. '
  16. ' example
  17. Z$="hi there - whATS NEw"
  18. XSTRINGUPPERLOWER[Z$]
  19. Print Z$+"  (Before)"
  20. Print Param$+"  (After)"