[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Uppercasing Initial charchters.
Unix KSH
Oracle 6
sqr 2.5 (upgrading to NT and sqr3 soon)
Hi all,
Im taking name and address' off a table and inserting them into a mail
merge. I need to upper case the initials on each field. I have the below
procedure which will work, but does anyone have anything easier as I have
to put each field into the procedure and take it back out again?
Is there some sort of initcaps function in sqr 2.5? There doesnt seem to
be anything in the manual.
Many thanks,
Chad.
---------------------------------------------------------------------------
--------------------------------------------------
I move name to incaps as the passed in field and move it back again when it
comes out.
I do the same for all address fields.
begin-procedure init_names
let #len = length($incaps)
let #rest = #len - 1
extract $initial from $incaps 0 1
extract $rest from $incaps 1 #rest
uppercase $initial
let $incaps = $initial
lowercase $rest
let #i = 0
while #i < #rest
extract $more from $rest #i 1
if $more = ' '
concat $more with $incaps
add 1 to #i
extract $more from $rest #i 1
uppercase $more
concat $more with $incaps
else
concat $more with $incaps
end-if
add 1 to #i
end-while
end-procedure