dim idatacount2,adatacount2,cdatacount2,ldatacount2,datacount2,datalength2
as integer
dim i as integer
dim sendbytes(2000) as byte
dim dataout as string
dim oddcheckby as byte
dim senddata(300) as double
-------------------------------
dataout=""
i=1
while i<=cint(idatacount2)
dataout=dataout&format(senddata(i),"000000")
i=i+1
wend
while i<=cint(adatacount2)+cint(idatacount2)
dataout=dataout&format(senddata(i),"00000.000")
i=i+1
wendwhile i<=cint(adatacount2)+cint(idatacount2)+cint(cdatacount2)
dataout=dataout&format((senddata(i) Mod 2),"0")
i=i+1
wendwhile i<=cint(adatacount2)+cint(idatacount2)+cint(cdatacount2)+cint(ldatacount)
dataout=dataout&format(senddata(i),"00000000000")
i=i+1
wend
for i=1 to datalength2
sendbytes(17+i)=Asc(Mid$(dataout,i,1))
next i
oddcheckbyte=&HFF
for i=0 to 17+datalength2
oddcheckbyte=oddcheckbyte Xor sendbytes(i)
next i
------------------------------
i=0
while para<=cint(idatacount2) datastring=""
for j=1 to 6
datastring=datastring +Chr$(recdata(17+i*6+j)
next j
recdata(para)=cint(datastring)
para=para+1
i=i+1
wend
i=0
while para<=cint(idatacount2+adatacount) datastring=""
for j=1 to 9
datastring=datastring +Chr$(recdata(17+i*6+j)
next j
recdata(para)=cdbl(datastring)
para=para+1
i=i+1
wend i=1
while para<=cint(idatacount2)
recdata(para)=Val(Chr$(recdata(17+i*6+j))
para=para+1
i=i+1
wend
i=0
while para<=cint(idatacount2+adatacount) datastring=""
for j=1 to 11
datastring=datastring +Chr$(recdata(17+i*6+j)
next j
recdata(para)=clng(datastring)
para=para+1
i=i+1
wend
dataviewer.text=""
for i=1 to 20
dataviewer.txt=dataviewer.txt+format(cstr(recdata(i),"@@@@@@@@@@@"+vbCrlf
next i
as integer
dim i as integer
dim sendbytes(2000) as byte
dim dataout as string
dim oddcheckby as byte
dim senddata(300) as double
-------------------------------
dataout=""
i=1
while i<=cint(idatacount2)
dataout=dataout&format(senddata(i),"000000")
i=i+1
wend
while i<=cint(adatacount2)+cint(idatacount2)
dataout=dataout&format(senddata(i),"00000.000")
i=i+1
wendwhile i<=cint(adatacount2)+cint(idatacount2)+cint(cdatacount2)
dataout=dataout&format((senddata(i) Mod 2),"0")
i=i+1
wendwhile i<=cint(adatacount2)+cint(idatacount2)+cint(cdatacount2)+cint(ldatacount)
dataout=dataout&format(senddata(i),"00000000000")
i=i+1
wend
for i=1 to datalength2
sendbytes(17+i)=Asc(Mid$(dataout,i,1))
next i
oddcheckbyte=&HFF
for i=0 to 17+datalength2
oddcheckbyte=oddcheckbyte Xor sendbytes(i)
next i
------------------------------
i=0
while para<=cint(idatacount2) datastring=""
for j=1 to 6
datastring=datastring +Chr$(recdata(17+i*6+j)
next j
recdata(para)=cint(datastring)
para=para+1
i=i+1
wend
i=0
while para<=cint(idatacount2+adatacount) datastring=""
for j=1 to 9
datastring=datastring +Chr$(recdata(17+i*6+j)
next j
recdata(para)=cdbl(datastring)
para=para+1
i=i+1
wend i=1
while para<=cint(idatacount2)
recdata(para)=Val(Chr$(recdata(17+i*6+j))
para=para+1
i=i+1
wend
i=0
while para<=cint(idatacount2+adatacount) datastring=""
for j=1 to 11
datastring=datastring +Chr$(recdata(17+i*6+j)
next j
recdata(para)=clng(datastring)
para=para+1
i=i+1
wend
dataviewer.text=""
for i=1 to 20
dataviewer.txt=dataviewer.txt+format(cstr(recdata(i),"@@@@@@@@@@@"+vbCrlf
next i
dataout=dataout&format(senddata(i),"000000")
dataout=dataout&format(senddata(i),"00000.000")
dataout=dataout&format((senddata(i) Mod 2),"0")
sendbytes(17+i)=Asc(Mid$(dataout,i,1))
oddcheckbyte=oddcheckbyte Xor sendbytes(i)
datastring=datastring +Chr$(recdata(17+i*6+j)
recdata(para)=Val(Chr$(recdata(17+i*6+j))
dataviewer.txt=dataviewer.txt+format(cstr(recdata(i),"@@@@@@@@@@@"+vbCrlf
一共8条,把这8句翻译成vc的就可以了!!!求助呀~!~!等待.........
难道100分少吗吗///???
dataout=dataout&format(senddata(i),"00000.000")
dataout=dataout&format((senddata(i) Mod 2),"0")
sendbytes(17+i)=Asc(Mid$(dataout,i,1))
oddcheckbyte=oddcheckbyte Xor sendbytes(i)
datastring=datastring +Chr$(recdata(17+i*6+j))
recdata(para)=Val(Chr$(recdata(17+i*6+j))
dataviewer.txt=dataviewer.txt+format(cstr(recdata(i),"@@@@@@@@@@@"+vbCrlf)
------------
变量的定义如下:
dim idatacount2,adatacount2,cdatacount2,ldatacount2,datacount2,datalength2
as integer
dim i as integer
dim sendbytes(2000) as byte
dim dataout as string
dim oddcheckby as byte
dim senddata(300) as double
dim revdata(20) as double
-------------
(chr$ mid$ 加个$有什么用?Val(Chr$()),Asc(Mid$())怎么转?)
dataout=dataout&format(senddata(i),"000000")
dataout=dataout&format(senddata(i),"00000.000")
dataout=dataout&format((senddata(i) Mod 2),"0")
sendbytes(17+i)=Asc(Mid$(dataout,i,1))
oddcheckbyte=oddcheckbyte Xor sendbytes(i)
datastring=datastring +Chr$(recdata(17+i*6+j))
recdata(para)=Val(Chr$(recdata(17+i*6+j))
dataviewer.txt=dataviewer.txt+format(cstr(recdata(i),"@@@@@@@@@@@"+vbCrlf)
------------
变量的定义如下:
dim idatacount2,adatacount2,cdatacount2,ldatacount2,datacount2,datalength2
as integer
dim i as integer
dim sendbytes(2000) as byte
dim dataout as string
dim oddcheckby as byte
dim senddata(300) as double
dim revdata(20) as double
------
帮给转一下,!!!各位大侠1!!!!等........
//CString dataout;
//CString strTemp;
//strTemp.Format("%05i", senddata[i]);
//datatout = dataout + strTemp;dataout=dataout&format(senddata(i),"00000.000")
//CString strTemp2;
//strTemp2.Format("%00000010.3f", (float)(senddata[i]));
//datatout = dataout + strTemp2;dataout=dataout&format((senddata(i) Mod 2),"0")
//CString strTemp3;
//strTemp3.Format("%01i", (senddata[i])/2); //求商用(senddata[i])/2,求余数用(senddata[i])%2
剩下的有空再看看。