instead of using a magic number 10000, it would be better to use a macro $$$MaxLocalLength, see %Stream.FileBinary:ReadLine
- Log in to post comments
instead of using a magic number 10000, it would be better to use a macro $$$MaxLocalLength, see %Stream.FileBinary:ReadLine
Thank you again! Updated
but remember about performance ...
/// Process private global with indirection
ClassMethod Test(val = 3) [ ProcedureBlock = 0 ]{
s:'$d(^||addr) ^||addr(1)=1, (^(2),^(8),^(9))=289, ^(3)=3
d @("t1case" _ $g( ^||addr( val ) ) ) Q
t1case1 w !, "Case 1" Q
t1case3 w !, "Case 3" Q
t1case289 w !, "Case 2 or 8 or 9" Q
t1case w !,"Case default" Q
}
/// Local variable with indirection
ClassMethod Test2(val = 3) [ ProcedureBlock = 0 ]{
s:'$d(addr) addr(1)=1, (addr(2),addr(8),addr(9))=289, addr(3)=3
d @( "t2case"_$g( addr( val ) ) ) Q
t2case1 w !, "Case 1" Q
t2case3 w !, "Case 3" Q
t2case289 w !, "Case 2 or 8 or 9" Q
t2case w !,"Case default" Q
}
/// Without indirection
ClassMethod Test3(val = 3) [ ProcedureBlock = 0 ]{
if val=1 w !, "Case 1" Q
if val=3 w !, "Case 3" Q
if (val=2)!(val=8)!(val=9) w !, "Case 2 or 8 or 9" Q
w !,"Case default"
}
/// Process private global without indirection
ClassMethod Test4(val = 3) [ ProcedureBlock = 0 ]{
s:'$d(^||addr) ^||addr(1)=1, (^(2),^(8),^(9))=289, ^(3)=3
d $case($g(^||addr(val)),1:t4case1,289:t4case289,3:t4case3,:t4case)
Q
t4case1 w !, "Case 1" Q
t4case3 w !, "Case 3" Q
t4case289 w !, "Case 2 or 8 or 9" Q
t4case w !,"Case default" Q
}
/// Local variable without indirection
ClassMethod Test5(val = 3) [ ProcedureBlock = 0 ]{
s:'$d(addr) addr(1)=1, (addr(2),addr(8),addr(9))=289, addr(3)=3
d $case($g(addr(val)),1:t5case1,289:t5case289,3:t5case3,:t5case)
Q
t5case1 w !, "Case 1" Q
t5case3 w !, "Case 3" Q
t5case289 w !, "Case 2 or 8 or 9" Q
t5case w !,"Case default" Q
}
ClassMethod Run() {
s repeat = 1000
s ts = $zh for i=1:1:repeat { d ..Test( $r(10)+1 ) } s t1 = ( $zh - ts )
s ts = $zh for i=1:1:repeat { d ..Test2( $r(10)+1 ) } s t2 = ( $zh - ts )
s ts = $zh for i=1:1:repeat { d ..Test3( $r(10)+1 ) } s t3 = ( $zh - ts )
s ts = $zh for i=1:1:repeat { d ..Test4( $r(10)+1 ) } s t4 = ( $zh - ts )
s ts = $zh for i=1:1:repeat { d ..Test5( $r(10)+1 ) } s t5 = ( $zh - ts )
w !, "do @( ^||addr() ) : ", t1
w !, "do @( addr() ) : ", t2
w !, "if val=case Q : ", t3
w !, "do $case( ^||addr() ) : ", t4
w !, "do $case( addr() ) : ", t5
}
Output:
do @( ^||addr() ) : .019535
do @( addr() ) : .016482
if val=case Q : .015183
do $case( ^||addr() ) : .015971
do $case( addr() ) : .015078
updated
Hi, Vitaliy!
1,2,3 - fix it and update, thank you; 4 - agree with you
Thank you, Evgeny!
Congrats also should go to @Nikita Savchenko, @Dmitry Maslennikov, @Tobias Graupner
But it's not installations, it's counter of downloads. After each version release, VS Code automatically download it.
According to my observations, there are approximately 100 active users of the plugin.
... at least Atelier API ...
Especially, documentation for Atelier Debugger API?
Hi, Andreas!
Sounds like sad news :(
Does ISC plan to publish any library for working with AST ( Abstract Syntax Tree ) for Caché ObjectScript?
Export, edit and compile with vscode-cos extension
Class Rick.ChangeItem Extends %SerialObject ...
but
Property Changes As List Of DC.serItem;
It's also interesting how used ( insert, update, select ) DC.listItem in your app? via object or/and SQL ( dirty ;) access?
Be careful with session - see %CSP.Session:Unlock documentation
or should it all be kept in a classin any unclear situation - use a class :)
The first tip about the debugger is simple and brief: Use a debugger, always
![]()
There is some inaccuracy here. "you need to add" must be "you need to override".
And you're right, any edits will be overwritten with a product upgrade.
In addition, remember that there is a purge audit log background task - see Task Manager in SMP.
Do you have tests? :) (see above)or more speed
This is my case, thanks for clarifying, Daniel!For many simple statements and common operations, they will perform nearly the same
I'm not sure, but, as I recall (2013-2014), both classes generate the same code as a result and work with roughly the same performance ( except for access to properties data )
I did not save the test code, sorry
oops, see below
I'm not sure, but it seems that this is obsolete information, just check generated code ( Ctrl+V in Studio )The newer dynamic SQL classes (%SQL.Statement and %StatementResult) perform better than %ResultSet