I did this function and I use it to convert a string to PROPER CASE (first
letetr cap)
So we got LCASE()
and UCASE()
now we got PCASE :0)
pCase("this iS my string") ====> "This Is My String"
pCase("variablename") ====> "Variablename"
or
sVar = "variablename"
pCase(sVar) =====> "Variablename"
have fun!
function pCase(str) 'Check the cAsE on that
putCap = True 'First Letter Gonna be
Caps
myString = trim(str) 'Remove Leading and
Trailing Spaces
sInc = Chr(32) & Chr(9) & Chr(13) 'Charaters we look for (found
their char codes online sumwhere)
for iLen = 1 to Len(myString) 'Check each Character
mStr = Mid(myString, iLen, 1)
if putCap = true then 'From previous run -->
instructed to make this a UCASE char
bStr = bStr & UCASE(mStr)
else
bStr = bStr & LCase(mStr) 'LCASE char
end if
if instr(sInc, mStr) then 'Check if this is one
of our 'Triggers'(like a space or carriage return or tab)
putCap = true
else
putCap = false
end if
next
pCase = bStr 'eH Voila!
end function
"Nacho" <na********@yahoo.com.ar> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
i need to convert the first letter of a veriable to uppercase (the
veriable is loaded and the applied LCase() )
thanks
--
Nacho