"@(#)capitalizestring 08/20/08 "
"V.Zorin, Varian, UK, august 2008"
"capitalizestring(string1):string2 - Capitalize string1 and return in string2"

clear

if ($# < 1) then
    write('error','Usage: %s(\'string1\'):\'string2\'',$0)
    abort
endif

substr($1,1,1):$first
length($1):$size
substr($1,2,$size-1):$rest

$c=''
$result=''
if $first='a' then
	$c='A'
elseif $first='b' then
	$c='B'
elseif $first='c' then
	$c='C'
elseif $first='d' then
	$c='D'
elseif $first='e' then
	$c='E'
elseif $first='f' then
	$c='F'
elseif $first='g' then
	$c='G'
elseif $first='h' then
	$c='H'
elseif $first='i' then
	$c='I'
elseif $first='j' then
	$c='J'
elseif $first='k' then
	$c='K'
elseif $first='l' then
	$c='L'
elseif $first='m' then
	$c='M'
elseif $first='n' then
	$c='N'
elseif $first='o' then
	$c='O'
elseif $first='p' then
	$c='P'
elseif $first='q' then
	$c='Q'
elseif $first='r' then
	$c='R'
elseif $first='s' then
	$c='S'
elseif $first='t' then
	$c='T'
elseif $first='u' then
	$c='U'
elseif $first='v' then
	$c='V'
elseif $first='w' then
	$c='W'
elseif $first='x' then
	$c='X'
elseif $first='y' then
	$c='Y'
elseif $first='z' then
	$c='Z'
else
	$result=$1
endif
$result=$c+$rest
//echo('result', $result)
return($result)
