I was trying to get the number of characters in a field. I tried doing that in two different ways. However, I got different results.
Does anybody have an idea why the result is different?
Regards,
Aras
Code: Select all
local tString
put field "Field" into tString
set the caseSensitive to true
repeat for each char tChar in tString
if toLower(tChar) is tChar then
## If we make the character lower case is it the same as the original character?
add 1 to tLowercaseCount
end if
if toUpper(tChar) is tChar then
## If we make the character upper case is it the same as the original character?
add 1 to tUppercaseCount
end if
end repeat
put tLowercaseCount + tUppercaseCount into tCount
answer "Lower case characters:" & tLowercaseCount && "Upper case characters:" & tUppercaseCount && "Total character count:" & tCount
Code: Select all
Lower case characters:32615 Upper case characters:19640 Total character count:52255
Code: Select all
local tStringUni
put field "Field" into tStringUni
repeat for each char tCharUni in tStringUni
add 1 to tCountUni
end repeat
answer "tCountUni:" & tCountUni
Code: Select all
tCountUni:34437