字节不是Integer的成员 [英] Byte is not a member of Integer

查看:65
本文介绍了字节不是Integer的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

公共共享adc_value as word_byte

公共类字节_low_hi

公共low_byte As Byte

Public high_byte As Byte

结束班


pmsg(2)= CChar(adc_value.word16.high_byte)


我收到以下错误high_byte不是整数的成员怎么

我能解决这个问题

Public Shared adc_value As word_byte
Public Class byte_low_hi
Public low_byte As Byte
Public high_byte As Byte
End Class

pmsg(2) = CChar(adc_value.word16.high_byte)

I get the following error "high_byte is not a member of Integer" How
can i fix this

推荐答案

什么是word16?它是整数而不是byte_low_hi吗?


---

Patrice


" cmdolcet69" < co ************ @hotmail.comaécritdansle message de news:
11 ******** @ k79g2000hse.googlegroups。 com ...
What is word16 ? Is it an integer rather than a byte_low_hi ?

---
Patrice

"cmdolcet69" <co************@hotmail.coma écrit dans le message de news:
11**********************@k79g2000hse.googlegroups. com...

公共共享adc_value as word_byte

公共类byte_low_hi

公共low_byte作为Byte

Public high_byte As Byte

End Class


pmsg(2)= CChar(adc_value.word16.high_byte)


我收到以下错误high_byte不是Integer的成员

如何解决这个问题
Public Shared adc_value As word_byte
Public Class byte_low_hi
Public low_byte As Byte
Public high_byte As Byte
End Class

pmsg(2) = CChar(adc_value.word16.high_byte)

I get the following error "high_byte is not a member of Integer" How
can i fix this



9月10日上午10点11分,Patrice < http://www.chez.com/scribe/wrote:
On Sep 10, 10:11 am, "Patrice" <http://www.chez.com/scribe/wrote:

什么是word16?它是整数而不是byte_low_hi吗?


---

Patrice


" cmdolcet69" < colin_dolce ... @hotmail.comaécritdansle message de news:

1189433061.001020.262 ... @ k79g2000hse.googlegroups。 com ...
What is word16 ? Is it an integer rather than a byte_low_hi ?

---
Patrice

"cmdolcet69" <colin_dolce...@hotmail.coma écrit dans le message de news:
1189433061.001020.262...@k79g2000hse.googlegroups. com...

公共共享adc_value as word_byte

公共类byte_low_hi

Public low_byte As Byte

Public high_byte As Byte

End Class
Public Shared adc_value As word_byte
Public Class byte_low_hi
Public low_byte As Byte
Public high_byte As Byte
End Class


pmsg(2)= CChar(adc_value.word16 .high_byte)
pmsg(2) = CChar(adc_value.word16.high_byte)


我收到以下错误high_byte不是Integer的成员怎么

我能解决这个问题 - 隐藏引用的文字 -
I get the following error "high_byte is not a member of Integer" How
can i fix this- Hide quoted text -



- 显示引用的文字 -


- Show quoted text -



这些都是我的声明:


Public Class GlobalMembers

Public Array_AVG As ArrayList

Public com1 As MSCOMM


''全球联盟变量:

公共共享crc_value as word_byte''system crc value

公共共享adc_value as word_byte' 'adc值从

表中读取

公共共享location_value as word_byte''表地址

发送ADC值

公共共享pmsg As Byte()=新字节(24){}''crc缓冲区

公共共享tsize为整数


公共类byte_low_hi

Public low_byte As Byte

Public high_byte As Byte

End Class

公共结构word_byte

Public word16 As Integer

公共byte8 as byte_low_hi

结束结构

''代码常量

''#Const BMS = True''这表示二进制

消息起始字节,值0x2A

''#Const PASSWD = True''这代表工厂

密码,值11548d

''#Const POLY = True''CRC中使用的多项式

算法

Public Const BMS As Char =" *" c

Public Const PASSWD As Integer =& H2D1C

Public Const POLY As Integer =& H8005


These are all my declarations:

Public Class GlobalMembers
Public Array_AVG As ArrayList
Public com1 As MSCOMM

'' Global Union Variables:
Public Shared crc_value As word_byte '' system crc value
Public Shared adc_value As word_byte '' adc value read from
table
Public Shared location_value As word_byte '' address of table
to send ADC value
Public Shared pmsg As Byte() = New Byte(24) {} '' crc buffer
Public Shared tsize As Integer

Public Class byte_low_hi
Public low_byte As Byte
Public high_byte As Byte
End Class
Public Structure word_byte
Public word16 As Integer
Public byte8 As byte_low_hi
End Structure
''Code Constants
''#Const BMS = True '' this represents the binary
message start byte, value 0x2A
''#Const PASSWD = True '' this represents the factory
pass code, value 11548d
''#Const POLY = True '' the polynomial used in the CRC
algorithm
Public Const BMS As Char = "*"c
Public Const PASSWD As Integer = &H2D1C
Public Const POLY As Integer = &H8005


9月10日15:16,cmdolcet69< colin_dolce ... @ hotmail。 comwrote:
On 10 Sep, 15:16, cmdolcet69 <colin_dolce...@hotmail.comwrote:

9月10日上午10点11分,Patrice < http://www.chez.com/scribe/wrote:
On Sep 10, 10:11 am, "Patrice" <http://www.chez.com/scribe/wrote:

什么是word16?它是整数而不是byte_low_hi吗?
What is word16 ? Is it an integer rather than a byte_low_hi ?


---

Patrice
---
Patrice


" cmdolcet69" < colin_dolce ... @hotmail.comaécritdansle message de news:

1189433061.001020.262 ... @ k79g2000hse.googlegroups。 com ...
"cmdolcet69" <colin_dolce...@hotmail.coma écrit dans le message de news:
1189433061.001020.262...@k79g2000hse.googlegroups. com...


公共共享adc_value as word_byte

公共类byte_low_hi

Public low_byte As Byte

Public high_byte As Byte

End Class
Public Shared adc_value As word_byte
Public Class byte_low_hi
Public low_byte As Byte
Public high_byte As Byte
End Class


pmsg(2)= CChar(adc_value.word16.high_byte)
pmsg(2) = CChar(adc_value.word16.high_byte)


我收到以下错误high_byte不是Integer的成员怎么

我能解决这个问题 - 隐藏引用的文字 -
I get the following error "high_byte is not a member of Integer" How
can i fix this- Hide quoted text -


- 显示引用的文字 -
- Show quoted text -



这些都是我的声明:


Public Class GlobalMembers

Public Array_AVG As ArrayList

公共com1作为MSCOMM


''全球联盟变量:

公共共享crc_value as word_byte''system crc value

公共共享adc_value因为word_byte''adc值从

表中读取

公共共享location_value as word_byte''表的地址

要发送ADC值

公共共享pmsg As Byte()=新字节(24){}''crc缓冲区

公共共享tsize为整数


Public Class byte_low_hi

Public low_byte As Byte

Public high_byte As Byte

End Cl屁股


公共结构word_byte


These are all my declarations:

Public Class GlobalMembers
Public Array_AVG As ArrayList
Public com1 As MSCOMM

'' Global Union Variables:
Public Shared crc_value As word_byte '' system crc value
Public Shared adc_value As word_byte '' adc value read from
table
Public Shared location_value As word_byte '' address of table
to send ADC value
Public Shared pmsg As Byte() = New Byte(24) {} '' crc buffer
Public Shared tsize As Integer

Public Class byte_low_hi
Public low_byte As Byte
Public high_byte As Byte
End Class

Public Structure word_byte



公共字16作为整数< - 整数类型

Public word16 As Integer <-- type of Integer


公共byte8 as byte_low_hi

结束结构

''代码常量

''#Const BMS = True ''这代表二进制

消息起始字节,值0x2A

''#Const PASSWD = True''这代表工厂

通过代码,值11548d

''#Constst POLY = True''CRC中使用的多项式

算法


公共Const BMS As Char =" *" c

Public Const PASSWD As Integer =& H2D1C

Public Const POLY As Integer =& H8005
Public byte8 As byte_low_hi
End Structure
''Code Constants
''#Const BMS = True '' this represents the binary
message start byte, value 0x2A
''#Const PASSWD = True '' this represents the factory
pass code, value 11548d
''#Const POLY = True '' the polynomial used in the CRC
algorithm

Public Const BMS As Char = "*"c
Public Const PASSWD As Integer = &H2D1C
Public Const POLY As Integer = &H8005



嗯,你去吧:


word16是一个整数(4个字节)而不是一个字节。您需要

将其转换为正确的类型。

Well, there you go:

word16 is an Integer (4 bytes) rather than just a byte. You need to
cast it to the correct type.


这篇关于字节不是Integer的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆