Guidance
指路人
g.yi.org
software / rapidq / Examples / Graphics & Animation / barcode / barcode / Code128 / C128.INC

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     DECLARE FUNCTION code128(startcode AS INTEGER,tekstin AS STRING) AS STRING 'maak zwart/wit bitmap


     FUNCTION code128(startcode AS INTEGER,tekstin AS STRING) AS STRING 'maak zwart/wit bitmap
'
' BARCODE CODE 128
'
'
'--------------------------------------------------------------
' inizialize VAR`S
      DIM bcode(0 TO 106) AS STRING*11 ' ARRAY MET bitpatterns STRING`S


      DIM barlengte AS INTEGER
      DIM barchar AS INTEGER
      DIM weight AS INTEGER
      DIM CHK AS INTEGER
      DIM CHECKSUM AS INTEGER
      DIM BITMAP AS STRING
      DIM X AS INTEGER

'--------------------------------------------------------------

'
' TABEL KOMT VAN  http://www.barcodeisland.com/code128.phtml
'
'	                CODE 128 ENCODING TABLE
'      	           WHICH REPRESENTS IN CHARACTER SET
'                 ENCODING    VALUE  A    B      C
      BCode(0) = "11011001100" '00	SP	SP	00
      BCode(1) = "11001101100" '01	!	!	01
      BCode(2) = "11001100110" '02	"	"	02
      BCode(3) = "10010011000" '03	#	#	03
      BCode(4) = "10010001100" '04	$	$	04
      BCode(5) = "10001001100" '05	%	%	05
      BCode(6) = "10011001000" '06	&	&	06
      BCode(7) = "10011000100" '07	'	'	07
      BCode(8) = "10001100100" '08	(	(	08
      BCode(9) = "11001001000" '09	)	)	09
      BCode(10) = "11001000100" '10	*	*	10
      BCode(11) = "11000100100" '11	+	+	11
      BCode(12) = "10110011100" '12	,	,	12
      BCode(13) = "10011011100" '13	-	-	13
      BCode(14) = "10011001110" '14	.	.	14
      BCode(15) = "10111001100" '15	/	/	15
      BCode(16) = "10011101100" '16	0	0	16
      BCode(17) = "10011100110" '17	1	1	17
      BCode(18) = "11001110010" '18	2	2	18
      BCode(19) = "11001011100" '19	3	3	19
      BCode(20) = "11001001110" '20	4	4	20
      BCode(21) = "11011100100" '21	5	5	21
      BCode(22) = "11001110100" '22	6	6	22
      BCode(23) = "11101101110" '23	7	7	23
      BCode(24) = "11101001100" '24	8	8	24
      BCode(25) = "11100101100" '25	9	9	25
      BCode(26) = "11100100110" '26	:	:	26
      BCode(27) = "11101100100" '27	;	;	27
      BCode(28) = "11100110100" '28	<	<	28
      BCode(29) = "11100110010" '29	=	=	29
      BCode(30) = "11011011000" '30	>	>	30
      BCode(31) = "11011000110" '31	?	?	31
      BCode(32) = "11000110110" '32	@	@	32
      BCode(33) = "10100011000" '33	A	A	33
      BCode(34) = "10001011000" '34	B	B	34
      BCode(35) = "10001000110" '35	C	C	35
      BCode(36) = "10110001000" '36	D	D	36
      BCode(37) = "10001101000" '37	E	E	37
      BCode(38) = "10001100010" '38	F	F	38
      BCode(39) = "11010001000" '39	G	G	39
      BCode(40) = "11000101000" '40	H	H	40
      BCode(41) = "11000100010" '41	I	I	41
      BCode(42) = "10110111000" '42	J	J	42
      BCode(43) = "10110001110" '43	K	K	43
      BCode(44) = "10001101110" '44	L	L	44
      BCode(45) = "10111011000" '45	M	M	45
      BCode(46) = "10111000110" '46	N	N	46
      BCode(47) = "10001110110" '47	O	O	47
      BCode(48) = "11101110110" '48	P	P	48
      BCode(49) = "11010001110" '49	Q	Q	49
      BCode(50) = "11000101110" '50	R	R	50
      BCode(51) = "11011101000" '51	S	S	51
      BCode(52) = "11011100010" '52	T	T	52
      BCode(53) = "11011101110" '53	U	U	53
      BCode(54) = "11101011000" '54	V	V	54
      BCode(55) = "11101000110" '55	W	W	55
      BCode(56) = "11100010110" '56	X	X	56
      BCode(57) = "11101101000" '57	Y	Y	57
      BCode(58) = "11101100010" '58	Z	Z	58
      BCode(59) = "11100011010" '59	[	[	59
      BCode(60) = "11101111010" '60	\	\	60
      BCode(61) = "11001000010" '61	]	]	61
      BCode(62) = "11110001010" '62	SPACE	SPAE	62
      BCode(63) = "10100110000" '63	_	_	63
      BCode(64) = "10100001100" '64	NUL	`	64
      BCode(65) = "10010110000" '65	SOH	a	65
      BCode(66) = "10010000110" '66	STX	b	66
      BCode(67) = "10000101100" '67	ETX	c	67
      BCode(68) = "10000100110" '68	EOT	d	68
      BCode(69) = "10110010000" '69	ENQ	e	69
      BCode(70) = "10110000100" '70	ACK	f	70
      BCode(71) = "10011010000" '71	BEL	g	71
      BCode(72) = "10011000010" '72	BS	h	72
      BCode(73) = "10000110100" '73	HT	I	73
      BCode(74) = "10000110010" '74	LF	j	74
      BCode(75) = "11000010010" '75	VT	k	75
      BCode(76) = "11001010000" '76	FF	l	76
      BCode(77) = "11110111010" '77	CR	m	77
      BCode(78) = "11000010100" '78	SO	n	78
      BCode(79) = "10001111010" '79	SI	o	79
      BCode(80) = "10100111100" '80	DLE	p	80
      BCode(81) = "10010111100" '81	DC1	q	81
      BCode(82) = "10010011110" '82	DC2	r	82
      BCode(83) = "10111100100" '83	DC3	s	83
      BCode(84) = "10011110100" '84	DC4	t	84
      BCode(85) = "10011110010" '85	NAK	u	85
      BCode(86) = "11110100100" '86	SYN	v	86
      BCode(87) = "11110010100" '87	ETB	w	87
      BCode(88) = "11110010010" '88	CAN	x	88
      BCode(89) = "11011011110" '89	EM	y	89
      BCode(90) = "11011110110" '90	SUB	z	90
      BCode(91) = "11110110110" '91	ESC	{	91
      BCode(92) = "10101111000" '92	FS	|	92
      BCode(93) = "10100011110" '93	GS	}	93
      BCode(94) = "10001011110" '94	RS	~	94
      BCode(95) = "10111101000" '95	US	DEL	95
      BCode(96) = "10111100010" '96	FNC3	FNC3	96
      BCode(97) = "11110101000" '97	FNC2	FNC2	97
      BCode(98) = "11110100010" '98	SHIFT	SHIFT	98
      BCode(99) = "10111011110" '99 	Code C	Code C	99
      BCode(100) = "10111101110" '100	Code B	FNC4	      Code B
      BCode(101) = "11101011110" '101	FNC4	      Code A      Code A
      BCode(102) = "11110101110" '102	FNC1  	FNC1	      FNC1
      BCode(103) = "11010000100" '103	START A	START A	START A
      BCode(104) = "11010010000" '104	START B	START B	START B
      BCode(105) = "11010011100" '105	START C	START C	START C
      BCode(106) = "11000111010" '106	STOP        STOP        STOP
      'HET STOP KARAKTER IS 2 BIT`S LANGER DAN DE REST NAMELIJK "11", ZIE OOK MAKEBITMAP

'-----------------------------------------------------------------

' calculate checksum

      barlengte=LEN(tekstin)
      FOR x = 1 TO barlengte
       barchar=ASC(MID$(tekstin,x,1))-32
       weight=barchar*x
       CHK=CHK + weight
      NEXT x
      CHK=CHK + startcode

'       calculate the check valua
      CHECKSUM=CHK MOD 103

'-----------------------------------------------------------------
'     SAMENSTELLEN VAN BITMAP PATROON

      barlengte=LEN(tekstin)

      FOR x = 1 TO barlengte
       barchar=ASC(MID$(tekstin,x,1))-32
       BITMAP=BITMAP+BCODE(BARCHAR)
      NEXT x

'       code128= STARTCODE       +TEXT  +CHECKSUM       +STOP      +"11"
      code128= BCODE(STARTCODE)+BITMAP+BCODE(CHECKSUM)+BCODE(106)+"11"

     END FUNCTION
'----------------------------------------------------------------------------------


掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2023-3-25  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:58:34