Desculpe, acho que quando colei do Studio ele acabou embaralhando o codigo, mas o correto é o abaixo.
ClassMethod ToNato(a As %String, s As %String, i As %String, x As %String) As %Integer
{
x x q o
}
ClassMethod Test(val = "If, you can read?") As %Status
{
S a="Alfa,Bravo,Charlie,Delta,Echo,Foxtrot,Golf,Hotel,India,Juliett,Kilo,Lima,Mike,November,Oscar,Papa,Quebec,Romeo,Sierra,Tango,Uniform,Victor,Whiskey,Xray,Yankee,Zulu"
s s=","
S i=val
s x="f j=1:1:$l(i) s c=$e(i,j),o=$g(o)_$s("",.!?""[c:c,c="" "":"""",1:$e("" "",j>1)_$p(a,s,$a(c)#32))"
set res = ..ToNato(a,s,i,x)
zw res
#dim methodObj As %Dictionary.MethodDefinition
set methodObj = ##class(%Dictionary.MethodDefinition).IDKEYOpen($ClassName(), "ToNato")
Write !,"Size: ", methodObj.Implementation.Size
}
O "Xecute" foi a carta na manga.
ClassMethod ToNato ( a As % String , s As % String , i As % String , x As % String ) As % Integer
{
x x q o
}
Teste ClassMethod ( val = "If, you can read?" ) As % Status
{
S a = "Alfa, Bravo, Charlie, Delta, Echo, Foxtrot, Golf, Hotel, India, Juliett, Kilo, Lima, Mike, November, Oscar, Papa, Quebec, Romeo, Sierra, Tango, Uniform, Victor, Whisky, Raio X, Yankee, Zulu"
s s= ","
S i = val
s x = "fj = 1: 1: $ l (i) sc = $ e (i, j), o = $ g (o) _ $ s (" ",.!? "" [c: c, c = "" "": "" "", 1: $ e ("" "", j> 1) _ $ p (a, s, $ a (c) # 32)) "
set res = .. ToNato ( a , s , i , x )
zw res
#dim methodObj As % Dictionary.MethodDefinition
set methodObj = ## class ( % Dictionary.MethodDefinition ). IDKEYOpen ( $ ClassName (), "
"Tamanho:" , métodoObj . Implementação . Tamanho
}
Muito bom!! kkk