Dim sendatalen As Long, gdata(20) As Byte, sdata(20) As Byte, gdata1(10) As Byte, device(11) As Byte
Dim Command(10) As Byte
Dim tempno As Long, tkh As String, txfje As Double
Dim tempcom As String, tempname As String, templeibi As String, tempstno As String
Dim intmoney As Long
tempno = Trim(Text1.Text)
tempcom = Trim(Text2.Text)
tkh = Trim(Text5.Text)
commandLen = 4
longg = 9
Command(0) = tempno
Command(1) = 111
Command(2) = 9
Command(3) = 0
Command(4) = 0
device(0) = Asc("C")
device(1) = Asc("O")
device(2) = Asc("M")
device(3) = Asc(tempcom)
ret = getdata(commandLen, Command(0), longg, gdata(0), device(0))
Dim Command(10) As Byte
Dim tempno As Long, tkh As String, txfje As Double
Dim tempcom As String, tempname As String, templeibi As String, tempstno As String
Dim intmoney As Long
tempno = Trim(Text1.Text)
tempcom = Trim(Text2.Text)
tkh = Trim(Text5.Text)
commandLen = 4
longg = 9
Command(0) = tempno
Command(1) = 111
Command(2) = 9
Command(3) = 0
Command(4) = 0
device(0) = Asc("C")
device(1) = Asc("O")
device(2) = Asc("M")
device(3) = Asc(tempcom)
ret = getdata(commandLen, Command(0), longg, gdata(0), device(0))
var
SendDataLen: Longint;
gData: array[0..20] of byte;
sData: array[0..20] of byte;
gData1: array[0..20] of byte;
device: array[0..11] of byte;
Command: array[0..10] of byte;
tempno: Longint;
tkh: string;
txfje: Double;
tempCom: string;
tempname: string;
templeibi: string;
tempstno: string;
intmoney: Longint;
begin
tempno := trim(Text1.Text);
tempcom := Trim(Text2.Text);
tkh := Trim(Text5.Text); commandLen := 4;
longg := 9;
Command[0] := byte(tempno);
Command[1] := 111;
Command[2] := 9;
Command[3] := 0;
Command[4] := 0;
device[0] := ord('C');
device[1] := ord('O');
device(2] := ord('M');
device[3] := ord(tempcom[0]);
Result = getdata(commandLen, Command[0], longg, gdata[0], device[0]);
end;
sendataleng:longint;
gdata,sdata:array[0..20] of byte;
gdata:array[0..10 of Byte;
device:arrat[0..11] of Byte;
command[0..10] of byte;
tempno: Longint;
tkh: String;
txfje: Double;
tempcom : String;
begin
tempno: = Trim(Text1.Text);
tempcom: = Trim(Text2.Text);
tkh: = Trim(Text5.Text);
commandLen := 4;
longg: = 9;
Command(0): = tempno;
Command(1): = 111;
Command(2): = 9;
Command(3): = 0;
Command(4): = 0;
device(0) := ord('C');
device(1): = ord('O'):
device(2): = ord('M');
device(3) := ord(tempcom[0]);
ret: = getdata(commandLen, Command[0], longg, gdata[0], device[0])
end;说明:trim 函数是去掉输入控件中前后的空格
ASC是求ASC吗,如果这里给出的ORD不对的话,去查找一下 tempname: String;
templeibi: String;
tempstno : String;
intmoney : Longint
gdata,sdata:array[0..20] of byte;
应该为gdata,sdata:array[0..19] of byte;其他数组也一样,如果不注意上面这些问题,你和MS的语言做连调的话,会出现你查了N久都不知道错误在哪里。具体代码我就不再说了。