I'm afraid I'm not understanding your question. I think you're asking for 4GL code to create and print bar codes. What kind of hardware is creating the barcodes? Bar code printers, laser printers?
Communicating with these devices involves sending escape characters to laser printers, and sending formats and other data to bar code printers.
Generally, Informix 4GL won't do this without help. This means writing callable "C" functions. These functions tend to be specific to the hardware you are using.
The following sample 4GL code prints a barcode for 6 characters at a time; combining the required escape sequences. I have tested this with ordinary dot-matrix printer and it works fine. For Barcode alignment (printing location on paper, barcode width etc.) you may tune the parameters like ^R,^B etc.
For example:
"^R20;0"
"^R76;0"
"^R130;0"
"^B18;1;1;1"
"^B14;0.01;1;1
etc ...
main
define string varchar(50), x char(6), i smallint
start report bcode to "bc"
let string="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
let i=1
while(1)
let x = string[i,i+6]
output to report bcode(x)
let i=i+6
if i>=36 then
exit while
end if
end while
finish report bcode
end main
report bcode(a)
define a char(6)
format
on every row
print ascii(27),
"[<4h", ascii(13),
"^R20;0", ascii(13),
"^B14;1;1;1", ascii(13),
a, ascii(13),
ascii(27),
"[<4l", ascii(13)
end report
ESC[<4h - Enter the barcode/block character
^R - ^R(xrel);(yrel) Relative cursor move
^B - ^B(type);(height);(size);(option)
(type)=style of barcode
1= Code 39
2= Code 39 with check digit added
6= Two of Five with 2:1 Ratio
... etc.
123456 - sample barcode
ESC[<4l - Exit the barcode/block character
^R is not <Ctrl+R> It is ^ + R
^B is not <Ctrl+B> It is ^ + B
This piece of code has been tested under Informix 4GL 7.30.UC1 on HP-UX 10.2 using Mannesmann Tally model MT 645/661.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.