go to post Stuart Strickland · Feb 19, 2023 Hi Mark, When looping through numerics, unless you intervene, it will loop through every number in magnitude order until you reach the end. So, if you start at 8009 and 8010 exists then it will find it. And 8009 is not next to 800900001 by a long way. When looping through strings, it's going to go through them like a human would when going through a dictionary. All words with the same prefix are next to each other. So you can easily stop your loop immediately when you find a word that doesn't match. This code will probably do what you want, athough I haven't tested it: Noddy ;; Find all subscripts with numeric prefix using minimum $ORDER ;Find(Prefix=8009,MaxSubscriptlength=12) I Prefix=+Prefix { // Must be numeric S MatchLength=$l(Prefix) F I=MatchLength:1:MaxSubscriptLength { // try starting from every number beginning with // 8009, thru 80090, 800900, up to say 800900000000 // or whatever the maximum subscript length is S Start=Prefix_$E("000000000000",0,I-MatchLength) F { // see if we found one, even at the start of the loop I $D(^REXREF3(1,Start)) { // but it must have our prefix // this test can end the loop! Q:$E(Start,1,MatchLength)'=Prefix // but only looking for numerics in this loop // don't want to find again later Q:Start'=+Start // Now do whatever it is you want to do with it.. // <REMOVE MINE AND INSERT YOUR CODE HERE> W !,Start } S Start=$O(^REXREF3(1,Start)) Q:Start="" } } } // Now look for strings with that prefix // all strings starting with 8009 will immediately follow "8009 " // so start there, there won't be an numeric subscripts following a string S Start=Prefix S MatchLength=$l(Prefix) I Prefix=+Prefix S Start=Start_" " F { // see if we found one, even at the start of the loop I $D(^REXREF3(1,Start)) { // but it must have our prefix // this test can end the loop! Q:$E(Start,1,MatchLength)'=Prefix // Now do whatever it is you want to do with it.. // <REMOVE MINE AND INSERT YOUR CODE HERE> W !,Start } S Start=$O(^REXREF3(1,Start)) Q:Start="" } q
go to post Stuart Strickland · Sep 9, 2021 or include S X=$ZU(123,0,1,1) in your system startup routine so that the only date that ever shows up with a 2 digit year is 1st Jan 1841 Check out the old %DATE utility
go to post Stuart Strickland · Feb 24, 2020 I had similar problems with the digital signature classes provided with Caché solved by extending the classes and adding the missing properties. Once extended you could add and InclusiveNamespace property and populate it with anything you like. You may find that you have to extend the entire digital signature package or even copy the package to a new one so that you can add what you want.