cQZEDIT ; Cstudio Hooks ;%ZEDIT; [ 05/30/01 4:42 PM ] %ZEDIT ; Cstudio Hooks ;%ZEDIT; [ 30/05/2001 - 15:59:07 - 58589,57547 ] ; by MF for internal use only Q ; Save this routine as %ZEDIT into the %SYS namespace ; ; Put the lines between '-- Start .reg file --' and '-- End .reg file --' without the ';;' ; into a file called xx.reg and doubleclick it to update the registry. ; Be aware that the configuration 'Cache' may be different in your particular case. ; The author is asuming that you know what you're doing and is not responsible in any way ; for any damage resulting from you doing this. ; This regfile was made under Windows 98. It may well be that it must read REGEDIT5 on W2K ; -- Start .reg file -- ;;REGEDIT4 ;; ;;[HKEY_CURRENT_USER\Software\InterSystems\Cache\Configurations\Cache\Cache Studio\Hooks] ;;"HooksEnabled"=dword:00000001 ;;"PostRead"="PostRead^%ZEDIT" ;;"PreRead"="PreRead^%ZEDIT" ;;"PreSave"="PreSave^%ZEDIT" ;;"PostSave"="PostSave^%ZEDIT" ; -- End .reg file -- ; PreRead(routine,readonly,namespac,msg) N CRLF S CRLF=$C(13,10) ;s msg="PreRead^"_$T(+0)_CRLF_"readonly="_readonly_CRLF_"routine="_routine_CRLF ;s msg=msg_"namespace="_namespace_CRLF ; if the system is not an internal (DAM-...) system, issue a warning. i $e($zu(110),1,4)'="DAM-" s msg="WARNING"_CRLF_CRLF_"This is a LIVE system "_CRLF_CRLF_$zu(110)_CRLF_CRLF q 1 ; PostRead(global,routine,namespac,language,msg) N CRLF S CRLF=$C(13,10) ;s msg="PostRead^"_$T(+0)_CRLF_"global="_global_CRLF_"routine="_routine_CRLF ;s msg=msg_"namespace="_namespace_CRLF_"language="_language_CRLF q 1 ; PreSave(global,routine,namespac,timestam,language,msg) N CRLF S CRLF=$C(13,10) ;s msg="PreSave^"_$T(+0)_CRLF_"global="_global_CRLF_"routine="_routine_CRLF ;s msg=msg_"namespace="_namespace_CRLF_"timestamp="_timestamp_CRLF_"language="_language_CRLF ;s msg=msg_@global@(1)_CRLF ; if first line label NOT equal to routine name : NO save i $p($p(@global@(1)," "),"(")'=$P(routine,".") d q 0 . s msg=CRLF_CRLF_"First Line Label not equal to routine-name"_CRLF . s msg=msg_CRLF_"Routine NOT saved"_CRLF_CRLF ; if the system is not an internal (DAM-...) system, issue a warning. i $e($zu(110),1,4)'="DAM-" s msg="WARNING"_CRLF_CRLF_"Routine saved on a LIVE system "_CRLF_CRLF_$zu(110)_CRLF_CRLF ; add or change our personalized timestamp on the first line of the routine i @global@(1)'["[ " s @global@(1)=@global@(1)_" [ " s @global@(1)=$P(@global@(1),"[ ")_"[ "_$ZD($H,4)_" - "_$ZT($P($H,",",2),1)_" - "_$H_" ]" ;s msg=msg_@global@(1)_CRLF q 1 ; PostSave(routine,namespac,msg) N CRLF S CRLF=$C(13,10) ;s msg="PostSave^"_$T(+0)_CRLF_"routine="_routine_CRLF_"namespace="_namespace_CRLF q 1 ; ZZ ; 24.08.01 - 9 u 19 * Cache-r3.1.8