ID=任意數字(如:12345678)
ZSHNUM=001110101001100001110110010101000011001000010000
BHD = ''
DO WHILE ID / 2 <> 0
BMOD = IIF(MOD(ID,2) = 0,'0','1')
BHD = BMOD + BHD
ID = INT(ID / 2)
ENDDO
If len('&bhd')<48
BHD=replicate('0',48-len('&bhd'))+BHD
ENDIF
NBHD = ''
DO WHILE ZCH / 2 <> 0
BMOD = IIF(MOD(ZCH,2) = 0,'0','1')
NBHD = BMOD + NBHD
ZCH = INT(ZCH / 2)
ENDDO
If len('&nbhd')<48
NBHD=replicate('0',48-len('&nbhd'))+NBHD
ENDIF
YHNUM = ''
FOR BI = 1 TO 20
IF SUBSTR(BHD,BI,1) = SUBSTR(NBHD,BI,1)
YHNUM = YHNUM + '0'
ELSE
YHNUM = YHNUM + '1'
ENDIF
ENDFOR
FOR BI = 21 TO 48
IF SUBSTR(BHD,BI,1) = SUBSTR(NBHD,BI,1)
YHNUM = YHNUM + '1'
ELSE
YHNUM = YHNUM + '0'
ENDIF
ENDFOR
IF YHNUM == ZSHNUM
OK!
ELSE
Error!