CamelCase в Clarion
Пример для версий
Clarion C7
PROGRAM
MAP
END
InitStr STRING('Some string with any symbols')
Str CSTRING(100),AUTO
symbol STRING(1)
CODE
j# = 1 ! implicit variable
loop i# = 1 to len(InitStr) by 1
symbol = lower(InitStr[i#]) ! string can be considered as array
case symbol
of 'a' to 'z'
Str[j#] = choose(was_letter#,symbol,upper(symbol))
j# += 1 ! using of add equals operator for increment
was_letter# = TRUE
else
was_letter# = FALSE
end
end
message(Str,'CamelCase')
Комментарии
]]>blog comments powered by Disqus
]]>