S
sarny
Unregistered / Unconfirmed
GUEST, unregistred user!
var<br>pchar1:array[0..16]of char;<br>str,str1,s,pass:string;<br>wdstr:widestring;<br>i,j,h:integer;<br>//sendby32:array[0..31]of byte; //读取的二进制代码<br>f1,f2:file of byte;<br>flag1,flag:integer; //汉字的ASCII码<br>//weiyi:integer; //在汉字库中的偏移位<br>//qu,wei:integer; //按拼音的区,位码<br>//c:char;<br>temp:byte;<br>temp1:array[0..31]of byte;<br>begin<br>str1:=edit1.Text;<br>wdstr:=str1;<br>strplcopy(pchar1,str1,16);<br>pass:='HZK16';<br>assignfile(f1,pass);<br>reset(f1);<br>pass:='four.res';<br>assignfile(f2,pass);<br>rewrite(f2);<br>for i:=0 to 7 do<br>begin<br>s:=wdstr[i+1];<br>if length(s)>1 then //判断要读取的字母是汉字或英文<br>Begin<br>flag:=ord(pchar1[2*i])-$a0; //把ascii全设为正数<br>flag1:=ord(pchar1[2*i+1])-$a0;<br>flag1:=(flag*100+flag1);<br>end ;<br><br>这样用ord函数求得的区位码经显示过不对产生的是另处一个汉字‘中’字变成了‘邴’字,<br>求那位老大能帮我!