DECLARE FUNCTION I25 (TEKST AS STRING) AS STRING
FUNCTION I25 (TEKST AS STRING) AS STRING
DIM bcode(0 TO 9) AS STRING*5
DIM COMBI AS STRING
DIM BITPAT AS STRING
DIM BITPAT2 AS STRING
DIM BARCODE AS STRING
DIM ZWART AS STRING
DIM WIT AS STRING
DIM BAR AS STRING
DIM CH1 AS STRING
DIM CH2 AS STRING
DIM BIT AS STRING
DIM TMP AS STRING
DIM LANG AS INTEGER
DIM Q AS INTEGER
BCode(0) = "NNWWN"
BCode(1) = "WNNNW"
BCode(2) = "NWNNW"
BCode(3) = "WWNNN"
BCode(4) = "NNWNW"
BCode(5) = "WNWNN"
BCode(6) = "NWWNN"
BCode(7) = "NNNWW"
BCode(8) = "WNNWN"
BCode(9) = "NWNWN"
LANG=LEN(TEKST)
FOR Q=1 TO LANG STEP 2
CH1=MID$(TEKST,Q,1)
CH2=MID$(TEKST,Q+1,1)
ZWART=BCODE(ASC(CH1)-48)
WIT=BCODE(ASC(CH2)-48)
COMBI=STRING$(10,32)
BITPAT=STRING$(20,32)
bar="1"
bitpat2=""
Y=1
FOR X =1 TO 10 STEP 2
BIT=MID$(ZWART,Y,1)
COMBI= REPLACE$(COMBI,BIT, X)
Y=Y+1
NEXT X
Y=1
FOR X =2 TO 10 STEP 2
BIT=MID$(WIT,Y,1)
COMBI= REPLACE$(COMBI,BIT, X)
Y=Y+1
NEXT X
Y=1
FOR X =1 TO 10
BIT=MID$(COMBI,X,1)
BITPAT= REPLACE$(BITPAT,BIT,Y )
Y=Y+2
NEXT X
FOR X =1 TO 20 STEP 2
IF MID$(bitpat,X,1)="W" THEN BITPAT2=BITPAT2+BAR+BAR
IF MID$(bitpat,X,1)="N" THEN BITPAT2=BITPAT2+bar
SELECT CASE bar
CASE "1"
bar="0"
CASE "0"
bar="1"
END SELECT
NEXT X
PAT=BITPAT2
TMP=BITPAT2
BARCODE=BARCODE+TMP
NEXT q
I25="1010"+BARCODE+"1101"
END FUNCTION
|