我要实现的是把接收到的数据一字不变的完全转成string。
例如收到303132,就转成'303132',而不是'012'三个字符组成的string。
写法还是有问题,代码如下:
AComm.Output:=mbuffer; //mbuffer是一个array of byte
sleep(350);
setLength(mget,AComm.InBufferCount);
mget:=AComm.Input;
str:=''; //str是一个string
for i:=1 to High(mget) do
str:=str+intToHex(mget[i-1],2);
result:=str;
上面这样就会出现Invalid argument错误,为什么???
若写成如下:
AComm.Output:=mbuffer; //mbuffer是一个array of byte,发送没问题
sleep(350);
str:=AComm.Input;
result:=str;
结果收到的就是由三个字符组成的string,即'012',而不是我想要的'303132'。
正确的写法应该是怎么样的???很急!!!
例如收到303132,就转成'303132',而不是'012'三个字符组成的string。
写法还是有问题,代码如下:
AComm.Output:=mbuffer; //mbuffer是一个array of byte
sleep(350);
setLength(mget,AComm.InBufferCount);
mget:=AComm.Input;
str:=''; //str是一个string
for i:=1 to High(mget) do
str:=str+intToHex(mget[i-1],2);
result:=str;
上面这样就会出现Invalid argument错误,为什么???
若写成如下:
AComm.Output:=mbuffer; //mbuffer是一个array of byte,发送没问题
sleep(350);
str:=AComm.Input;
result:=str;
结果收到的就是由三个字符组成的string,即'012',而不是我想要的'303132'。
正确的写法应该是怎么样的???很急!!!
解决方案 »
- 关闭系统,报地址错误不知道为何,如图:
- 全局变量,局部变量 private、protected、public
- delphi 如何完整调用beep函数 给个详细的调用包括声明之类的
- 求将listview中数据导成Excel的代码~~
- 长沙急招 Delphi 程序员(长沙市某通信集成公司)
- 日期输入问题
- QQ中在大厅里聊天的功能是如何实现的?ClientSocket怎样向多个选定的用户发送信息?
- ■■在广州从事软件开发或编程爱好者请进■■■
- Delphi程序员好找工作吗?
- 数据库有那些引擎?如何使用各种数据引擎?
- 如何控制窗体????菜鸟送分!
- 我要建立一个字段,里面既可以存放大量的文字,也可以存入图片,请问字段该用什么类型???
我觉得好象用byte数组接收会出现Invalid argument错误,用string接收就没有问题。但是用了string接收会把16进制数都转成字符的。到底应该怎么做啊???急死了!!!
看看书上写的都是用byte数组接收和发送的。请高手指点!!!
same node as the listener and information sent or registered by a database
dispatcher. If the IPS addresses identify connection requests from the same node,
the KEY value is equal to the service name of the database. If the addresses
identify a database dispatcher, the KEY value is equal to the database system
identifier (SID). If the service name is the same as the SID, only one IPC address is
needed.