Rprinter is textfile type; Scontent is tstringlist type. // Create a print connection and print data Assignfile (rprinter, 'lpt1'); // sets the printer Rewrite (rprinter); // prepare to write the file Writeln (rprinter, CHR ($ B) + CHR (27) + 'K' + CHR (40); // pour the paper backwards! ... For I: = 0 to scontent. Count-1 do Writeln (rprinter, scontent. Strings [I]); Writeln (rprinter, CHR ($ B) + CHR (27) + 'J' + CHR (140); // Forward Feed Closefile (rprinter); // close the printer and stop printing Scontent. Free; // release the string list Assignfile (rprinter, 'lpt1'); // sets the printer Rewrite (rprinter); // prepare to write the file Writeln (rprinter, CHR (27) + 'P' + 'M' + (the next two look like parameters) T1 T2); // Open the cash box Closefile (rprinter); // close the printer and stop printing Cash Box Control Command (this command can enable two cash boxes at the same time, the actual operation only needs to enable one) 1. The pK mode drives the cash box command ESC | r F9 M N1 N2 M = 0 represents a cash box n represents the pulse width n1 = 40--50 M = 1 represents two cash box n2 = 120--150 Programming in QBASIC Lprint CHR $ (27); "|"; "R"; CHR $ (249); CHR $ (0); CHR $ (50); CHR $ (150) 2. Pos mode drives cash box commands Esc r p m N1 N2 M = 0 represents a cash box n represents the pulse width n1 = 40--50 M = 1 represents two cash box n2 = 120--150 Programming lprint CHR in QBASIC $ (27); CHR $ (112); CHR $ (0); CHR $ (50); CHR $ (200) 3. bs300k can open two cash boxes at the same time. When receiving 2 or 4, the cash box 1 is opened, and when receiving 4 or 5, the money box 2 is opened. 4. Set the automatic cash box feature in Windows Lprint CHR $ (27); "| W"; CHR $ (45); CHR $ (N ); N = 0 FF when taking the paper command, the cash box is invalid. N = 1 cash box 1 open N = 2 Cash Box 2 open |