go to post Julius Kavay · Aug 5, 2023 Nice, and where are those 4 byte floating point data? Do you have some information about that record?
go to post Julius Kavay · Aug 5, 2023 also, you could try the $SCONVERT(s,format,endian,position) function (Format: F4)
go to post Julius Kavay · Aug 5, 2023 Instead of ZW RECORD (which only gives an ASCII rubbish) please give some examples as hex-dump (ZZDUMP RECORD or something similar). A few values together with hex-dump.
go to post Julius Kavay · Aug 4, 2023 Merely you have to "open" the article to get those tags into top position. If you just browse (see the screenshot) over the articles: (a) you have to scroll down and (b) a tag name could have but must not have the same meaning as an acronym. In my opinion, an acronym should always be explained after the first usage - either you write it out or you insert a link or whatever...
go to post Julius Kavay · Aug 4, 2023 By the way, you can also "shorten" a given node and start over... // from the above example, // name = ^A("TEST1","TEST2", ... "TEST10") // now we take that global with the first two subscripts set name = $name(@name,2) // and add new subscripts set name = $name(@name@(3333,4444)) set @name = "new data" Try it and then ZWRITE ^A to see the effect
go to post Julius Kavay · Aug 4, 2023 set name = $name(^A) for i=1:1:10 { set name = $name(@name@("TEST"_i)) } set @name=""
go to post Julius Kavay · Aug 4, 2023 Excuse me, but it's a bad habit to introduce something with an acronym without saying what that acronym stands for. The site: https://acronyms.thefreedictionary.com/CCR lists 241 possible meanings for CCR. Which one is yours?
go to post Julius Kavay · Aug 4, 2023 I assume, we are talking about ObjectScript? Then you got in the main method a <SYNTAX> error because "calling" is not a command keyword. So what are you really doing? We don't need the whole main method, the line with the call would be enough. By the way, a method name like "this_method" is not a valid name except if you place it in (double)quotes. Something, which is formal correct, looks like this: Method "this_MainMethod"() { do ..SecondMethod() } Method SecondMethod() { // ... }
go to post Julius Kavay · Aug 3, 2023 I just saw now, I published the next to last version instead of the last... sorry. I end up 53 bytes. This "s_0" was a work-around for not to use $g(z) by getting at least one loop for case, someone calls the method with an empty string ClassMethod IsValid(s) { f{s c=$a(s,$i(i))+1 ret:$i(z,c=42-(c=41))>0!'c 'z} }
go to post Julius Kavay · Aug 3, 2023 After I put all the solutions in a pot, salting them with some own ideas then filtering, I got a really nice solution with 55 bytes. Works for all the examples given by @Eduard Lebedyuk. The best idea-donors where, among others, @Stuart.Strickland and @Lorenzo Scalese, thank you. ClassMethod IsValid(s) { f{s c=$a(s_0,$i(i))+1 ret:$i(z,c=42-(c=41))>0!'c 'z} }
go to post Julius Kavay · Aug 3, 2023 Two more bytes and the problem is solved: Property refDate As %Date [InitialExpression = {$piece($horolog,",",1)}]; //.............................................^......................^
go to post Julius Kavay · Aug 3, 2023 If my aging brain me do not misleads, you could save two more bytes g:"()"'[$c(c) // instead of this (13 bytes) g:c=41-c+40 // use this (11 bytes)
go to post Julius Kavay · Aug 3, 2023 I hope, this change does not affect the way I use (some of the) mnemonics - am I right? Class My.Mnemonics Extends %RegisteredObject { /// Set-/Reset mnemonic routine ClassMethod SetMnemonics(rou={$zname}) [ ProcedureBlock = 0 ] { set old=##class(%Device).GetMnemonicRoutine() use $i::"^"_rou quit old MA(x) write "This is MA "_x quit MB() write "This is MB" quit } } // for example: set old=##class(My.Mnemonics).SetMnemonics() write /ma(123) do ##class(MyMnemonics).SetMnemonics(old)
go to post Julius Kavay · Jul 28, 2023 OK, one can short down those 20 bytes into 17 and we end up with 64 bytes. ClassMethod IsValid(x) { 1 s z=x,x=$replace($tr(x,$tr(x,"()")),"()","") g 1:x'=z q x="" } Again, speed wasn't asked
go to post Julius Kavay · Jul 28, 2023 OK, I start with 47 chars... unfortunately, I have to add 20 chars more for that (stupid) extra requirement of ignoring characters like {, [, <, etc. therefore end up with 67 chars ClassMethod IsHalfValid(x) { 1 s z=x,x=$replace(x,"()","") g 1:x'=z q x="" } ClassMethod IsFullValid(x) { 1 s z=x,x=$replace($zstrip(x,"*e",,"()"),"()","") g 1:x'=z q x="" } Speed was'n asked...
go to post Julius Kavay · Jul 27, 2023 In the mean time the answer is already given by Mr Maslennikov and others, but to shorten your runtime, you could also try a "variablenless" loop, maybe this gives you some seconds more... The emphasis is on "maybe". // if you have null-subscripts enabled if $d(^YYY(""))!1 for i=0:1 {quit:$order(@$zr)=""} write i // if null-subscripts are not enabled if $d(^YYY(-9E18))!1 for i=0:1 {quit:$order(@$zr)=""} write i // of course, you can do that on any arbitrary level too if $d(^YYY(1,2,3,""))!1 for i=0:1 {...} write i // the value of -9E19 ist just for explanation, use a value suitable for your needs May I ask for the background, why do you need that node count?