function StringToFile(mString: string; mFileName: TFileName): Boolean; var vFile: file of Char; I: Integer; begin {$I-} AssignFile(vFile, mFileName); Rewrite(vFile); for I := 1 to Length(mString) do Write(vFile, mString[I]); CloseFile(vFile); {$I+} Result := (IOResult = 0) and (mFileName <> ''); end; { StringToFile }StringToFile(#27'|w'#45#1, 'C:\temp.txt'); StringToFile('type c:\temp.txt > PRN', 'C:\temp.bat'); WinExec('C:\temp.bat');
var
vFile: file of Char;
I: Integer;
begin
{$I-}
AssignFile(vFile, mFileName);
Rewrite(vFile);
for I := 1 to Length(mString) do Write(vFile, mString[I]);
CloseFile(vFile);
{$I+}
Result := (IOResult = 0) and (mFileName <> '');
end; { StringToFile }StringToFile(#27'|w'#45#1, 'C:\temp.txt');
StringToFile('type c:\temp.txt > PRN', 'C:\temp.bat');
WinExec('C:\temp.bat');
n=0 FF走纸命令时钱箱无效
n=1 钱箱1打开
n=2 钱箱2打开
这是Basic命令。
好像是型设备发送字符串CHR$(27);"|w";CHR$(45);CHR$(n); 如果Pos机钱箱是打印口则向并口发送,并口操作的孔件在我那个上找找有的是.
打开钱箱1:CHR$(27);"|w";CHR$(45);CHR$(1);
打开钱箱1:CHR$(27);"|w";CHR$(45);CHR$(2);
var
F: TextFile;
begin
AssignFile(F, 'LPT1');
Rewrite(F);
Writeln(F, #27+'|w'+#45+#1);
CloseFile(F);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
F: TextFile;
begin
AssignFile(F, 'PRN');
Rewrite(F);
Writeln(F, #27+'|w'+#45+#1);
CloseFile(F);
end;