cpPrn = SET("PRINTER", 2) set printer to Name (cpPrn) set print on SET PRINTER FONT "Arial", 10, "N" clear dlls localAddDotsToSpace = 0 localAddDotsToBar = 0 declare LONG GetDeviceCaps in gdi32.dll LONG, LONG declare SHORT DeleteDC in gdi32.dll LONG declare LONG CreateDC in gdi32.dll STRING, STRING, STRING declare INTEGER StartDoc in gdi32.dll LONG, STRING declare INTEGER StartPage in gdi32.dll LONG declare INTEGER EndPage in gdi32.dll LONG declare INTEGER EndDoc in gdi32.dll LONG declare LONG GetBarCodeSize in BCLW32.DLL as GetBarCodeSize LONG winDC, LONG hbc, STRING bcData, STRING hrData declare INTEGER DrawBarCodeToHDC in BCLW32.DLL as DrawBarCodeToHDC LONG WinDc, INTEGER nXdpi, INTEGER nYdpi, INTEGER nAlign, LONG hBC, STRING @cRepCaseNo, STRING @cRepCaseNo declare INTEGER DeleteBarCode in BCLW32.DLL as DeleteBarCode LONG hBC hPrn = CreateDC("WINSPOOL",cpPrn,[]) xDpi = GetDeviceCaps(hPrn,88) yDpi = GetDeviceCaps(hPrn,90) ctDoc = Long2Str(20) + REPLICATE(CHR(0), 16) =StartDoc(hPrn, @ctDoc) =StartPage(hPrn) USE CLIENT SEEK "GD0001" * print out the client no. and name ? CLIENT->cusno ? CLIENT->cusname ... * print out the bar code error=DrawBarCodeToHDC(hPrn,2000,ypos, alignment,hBC,cbarcode,cbarcode) =EndPage(hPrn) =EndDoc(hPrn) set print off DeleteBarCode(hBC) lPrn=DeleteDC(hPrn) clear dlls FUNCTION Long2Str PARAMETERS m.longval PRIVATE i, m.retstr m.retstr = "" FOR i = 24 TO 0 STEP -8 m.retstr = CHR(INT(m.longval/(2^i))) + m.retstr m.longval = MOD(m.longval, (2^i)) NEXT RETURN m.retstr