source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XPDRSUM.m@ 1397

Last change on this file since 1397 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 925 bytes
Line 
1XPDRSUM ;SFISC/RWF - Routine checksum utilities ; 13 Oct 95 11:21
2 ;;8.0;KERNEL;**10**;Jul 10, 1995
3 Q
4SUMA(GLO) ;This tag builds the old RSUM value
5 ;Call with a reference to a global that has the routine
6 N Y,%,%1,%2,%3 S Y=0
7 F %=1,3:1 S %1=$G(@GLO@(%,0)),%3=$F(%1," ") Q:'%3 S %3=$S($E(%1,%3)'=";":$L(%1),$E(%1,%3+1)=";":$L(%1),1:%3-2) F %2=1:1:%3 S Y=$A(%1,%2)*%2+Y
8 Q Y
9SUMB(GLO) ;This tag builds the new RSUM value
10 ;Call with a reference to a global that has the routine
11 N Y,%,%1,%2,%3 S Y=0
12 F %=1,3:1 S %1=$G(@GLO@(%,0)),%3=$F(%1," ") Q:'%3 S %3=$S($E(%1,%3)'=";":$L(%1),$E(%1,%3+1)=";":$L(%1),1:%3-2) F %2=1:1:%3 S Y=$A(%1,%2)*(%2+%)+Y
13 Q Y
14SUMC(GLO) ;This tag builds the new checksum for global
15 ;Call with a reference to a global
16 N Y,%,%1,%2,%3,%4,%5
17 S Y=0,%=$NA(@GLO),%1=$E(%,1,$L(%)-1),%2=$L(%1)
18 F %5=1:1 S GLO=$Q(@GLO) Q:GLO=""!($E(GLO,1,%2)'=%1) S %3=@GLO F %4=1:1:$L(%3) S Y=$A(%3,%4)*(%4+%5)+Y
19 Q Y
Note: See TracBrowser for help on using the repository browser.