go to post Ray Hitchins · Sep 30, 2016 You can use conditional compilation to differentiate between live and dev as below (PRP is our live). So $$$debug(x) either shows the value in x on the screen in test or does nothing in live. Slight disadvantage is that what you test is not EXACTLY identical to what you run in live - but that's going to be the case anyway if you are "adding differences afterwards". #if $NAMESPACE'="PRP" ; ############### test environment includes debug code #Define debug(%var) Write @(%var) #Define CSPdebug(%prog,%var) S MACROT2=$P($ZTIMESTAMP,",",2),^CSPLOG(%prog,+$H,MACROT2,"%var")=$D(%var)_"`"_$G(%var) #Define CSPdebugfull(%prog,%var) S MACROT2=$P($ZTIMESTAMP,",",2),^CSPLOG(%prog,+$H,MACROT2,"%var")=$D(%var)_"`"_$G(%var) I $D(%var)>1 S MACROT1="%var" F S MACROT1=$Q(@MACROT1) Q:MACROT1="" S ^CSPLOG(%prog,+$H,MACROT2,MACROT1)="`"_@MACROT1 #Define CSPdump(%prog) S MACROT2=$P($ZTIMESTAMP,",",2),MACROT3="" F S MACROT3=$O(@MACROT3) Q:MACROT3="" S ^CSPLOG(%prog,+$H,MACROT2,MACROT3)=$D(@MACROT3)_"`"_$G(@MACROT3) I $D(@MACROT3)>1 S MACROT1=MACROT3 F S MACROT1=$Q(@MACROT1) Q:MACROT1="" S ^CSPLOG(%prog,+$H,MACROT2,MACROT1)="`"_@MACROT1 ; ############### end test environment includes debug code #else ; ############### live environment no debug code #Define debug(%var) #Define CSPdebug(%prog,%var) #Define CSPdebugfull(%prog,%var) #Define CSPdump(%prog) #endif
go to post Ray Hitchins · Sep 26, 2016 The reference was to "localhost" which might or might not work.
go to post Ray Hitchins · Aug 25, 2016 $Query may help, but more likely to be S FF = ""For { S FF=$O(^Users(FF)) Q:FF="" I '$D(^Users(FF,"SETTINGS","isAllowed"))#2 { W "No settings for user "_FF } elseif ^Users(FF,"SETTINGS","isAllowed") { W "User ",FF," is allowed",! } ELSE { W "User ",FF," is not allowed",!}(That assumes the 1/0 value determines whether the user is / is not allowed rather than the existence of the node)
go to post Ray Hitchins · Aug 17, 2016 One difficulty when converting old "dotted" code to use the new curly brackets is that New applies to the current dot level - same as if the dot level was a routine - but not the scope of the curly brackets containing the New.