Most annoying "feature" when i started to learn objectscript was the very strict left to right processing
e.g. if a>0 & b< 0 {} get evaluated as (((a>0) & b) <0) not as you would expect (a>0) & ( b<0)
also very strange variable casting from number to string.
e.g
set a=1
set b="7 dwarves"
w a+b
actually return 8 instead of e.g. concatted string "17 dwarves" or a variable casting error as in other languages
But meanwhile i love it :D
size 258 249
all unit tests passed
ClassMethod Type(a...) As %String
{
s (f,r)=0,c=2 i $g(a){f i=1:1:a{s $p(b,",",*+1)=$zstrip(a(i),"*"," ")} f{q:(c=$l(b,",")) s p=$l($p(b,",",$i(c)-1))-$l($p(b,",",c)),f=$s(p>0:-1,p<0:1,1:0) i f,r,r'=f{ret "Unsorted"} s:f r=f}} ret $s(r<0:"Decreasing",r>0:"Increasing",1:"Constant")
}
Certifications & Credly badges:
Timo has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Timo has no followers yet.
Following:
Timo has not followed anybody yet.
another option is to use a list
set x=$listfromstring("1,4,6,8,9,12") SET ptr=0 WHILE $LISTNEXT(x,ptr,y) { WRITE !,y }