Last active
December 21, 2025 07:17
-
-
Save mit41301/5d8d7ade06909e0d51210eb094b1941b to your computer and use it in GitHub Desktop.
Interleaved 2 OF 5 code generator using QB. The code generates the encoding pattern on the fly. No database used. Works on WINDOWS 11 with QB64.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DIM P$(0 TO 9), G%(&H3FF) | |
| FOR I = 1 TO 12 | |
| I = I + (I MOD 2 + I \ 2 MOD 2 + I \ 4 MOD 2 + I \ 8 MOD 2) \ 3 | |
| N = I | |
| P = P XOR P | |
| Y = (1 + Y) MOD 10 | |
| DO | |
| P$(Y) = P$(Y) + RIGHT$(STR$(N MOD 2), 1) | |
| P = P XOR N MOD 2 | |
| N = N \ 2 | |
| LOOP UNTIL LEN(P$(Y)) = 4 | |
| P$(Y) = P$(Y) + RIGHT$(STR$(P), 1) | |
| NEXT I | |
| INPUT " Enter the No: "; U$ | |
| U$ = RIGHT$(CHR$(&H30) + U$, LEN(U$) + LEN(U$) MOD 2) | |
| FOR K = 1 TO LEN(U$) STEP 2 | |
| OP$ = OP$ + P$(VAL(MID$(U$, K, 1))) | |
| EP$ = EP$ + P$(VAL(MID$(U$, K + 1, 1))) | |
| NEXT K | |
| FOR L = 1 TO LEN(OP$) | |
| FP$ = FP$ + MID$(OP$, L, 1) + MID$(EP$, L, 1) | |
| NEXT L | |
| SCREEN 2 | |
| PRINT U$ | |
| GET (0, 0)-(8 * LEN(U$), 14), G% | |
| PUT (0, 0), G% | |
| PAINT (0, 0) | |
| Z = 320 - INT(((LEN(U$) * 9) + 9) / 2) | |
| FOR I = 1 TO 7 + LEN(FP$) | |
| FOR J = 0 TO VAL(MID$("0000" + FP$ + "100", I, 1)) * 2 | |
| LINE (Z, 5)-(Z, 25), NOT I MOD 2 EQV 1 | |
| Z = Z + 1 | |
| NEXT J | |
| NEXT I | |
| PUT (320 - (LEN(U$) * 4), 30), G% | |
| SLEEP | |
| END |
Author
mit41301
commented
Dec 21, 2025


Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment