Tried the solution that ZitRo posted, but i have the error - Inconsitent use of QUITs within the tag. Any ideas how i can fix this?
n key,char,i
s ary(1)="abcabc aba"
s key =""
f{
s key=$Order(ary(key))
i key="" q
f i=1:1:$L(ary(key)){
set char=$E(ary(key),i)
set countByChar(char)=$get(countByChar(char))+1}}
q countByChar
I managed to figure it out. The error message was caused by two quits in the code; one quit with a value and one quite without a value.
Final code: