473,608 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Byte is not a member of 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_by te)

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

Sep 10 '07 #1
11 2222
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************* *********@k79g2 00...legr oups.com...
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_by te)

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

Sep 10 '07 #2
On Sep 10, 10:11 am, "Patrice" <http://www.chez.com/scribe/wrote:
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.0010 20.262...@k79g2 000hse.googlegr oups.com...
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_by te)
I get the following error "high_byte is not a member of Integer" How
can i fix this- Hide quoted text -

- Show quoted text -

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

Sep 10 '07 #3
On 10 Sep, 15:16, cmdolcet69 <colin_dolce... @hotmail.comwro te:
On Sep 10, 10:11 am, "Patrice" <http://www.chez.com/scribe/wrote:
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.0010 20.262...@k79g2 000hse.googlegr oups.com...
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_by te)
I get the following error "high_byte is not a member of Integer" How
can i fix this- Hide quoted text -
- Show quoted text -

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 <-- type of 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
Well, there you go:

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

Sep 10 '07 #4
On Sep 10, 11:14 am, Phillip Taylor <Phillip.Ross.T ay...@gmail.com >
wrote:
On 10 Sep, 15:16, cmdolcet69 <colin_dolce... @hotmail.comwro te:
On Sep 10, 10:11 am, "Patrice" <http://www.chez.com/scribe/wrote:
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.0010 20.262...@k79g2 000hse.googlegr oups.com...
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_by te)
I get the following error "high_byte is not a member of Integer" How
can i fix this- Hide quoted text -
- Show quoted text -
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 <-- type of 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

Well, there you go:

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

- Show quoted text -
How do i cast it to the correct type?

Sep 10 '07 #5
"cmdolcet69 " <co************ @hotmail.comsch rieb
On Sep 10, 10:11 am, "Patrice" <http://www.chez.com/scribe/wrote:
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.0010 20.262...@k79g2 000hse.googlegr oups.com...
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_by te)
I get the following error "high_byte is not a member of Integer"
How can i fix this
It depends on what you want to do. You are trying to access a member that
does not exist. As the message says, "high_byte is not a member of Integer",
so you can not access it. Anyway it's confusing because word16 pretends to
be a 16-Bit integer, but it is declared as a 32 bit integer (Integer is
synonym for Int32), so either I would rename it to word32 or declare it as
Int16 (synonym for Short).

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

Armin

Sep 10 '07 #6
On Sep 10, 11:47 am, "Armin Zingler" <az.nos...@free net.dewrote:
"cmdolcet69 " <colin_dolce... @hotmail.comsch rieb
On Sep 10, 10:11 am, "Patrice" <http://www.chez.com/scribe/wrote:


What is word16 ? Is it an integer rather than a byte_low_hi ?
---
Patrice
"cmdolcet69 " <colin_dolce... @hotmail.coma écrit dans le message
denews: 1189433061.0010 20.262__BEGIN_M ASK_n#9g02mG7!_ _...__********* *************@k 79g2000hse.goog legroups.com...
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_by te)
I get the following error "high_byte is not a member of Integer"
How can i fix this

It depends on what you want to do. You are trying to access a member that
does not exist. As the message says, "high_byte is not a member of Integer",
so you can not access it. Anyway it's confusing because word16 pretends to
be a 16-Bit integer, but it is declared as a 32 bit integer (Integer is
synonym for Int32), so either I would rename it to word32 or declare it as
Int16 (synonym for Short).


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

Armin- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -
If i were to include all the code and give you a little bakground as
to what i wnat to do would you be able to help?

Sep 10 '07 #7
cmdolcet69,

It looks like you need to take a programming course and/or a Visual Basic
course.

Kerry Moorman
"cmdolcet69 " wrote:
>
How do i cast it to the correct type?

Sep 10 '07 #8
On Sep 10, 12:06 pm, Kerry Moorman
<KerryMoor...@d iscussions.micr osoft.comwrote:
cmdolcet69,

It looks like you need to take a programming course and/or a Visual Basic
course.

Kerry Moorman

"cmdolcet69 " wrote:
How do i cast it to the correct type?- Hide quoted text -

- Show quoted text -
Im a little confused with the data type structure, This would be the
first time i have ever implemented into a micro. My other skills are
strong.

Sep 10 '07 #9
So word16 is an integer. high_byte is a member of byte_low_hi. So
word16.high_byt e is something that doesn't exists.

I'm not sure how you would like to approach this :
- you could declare word16 as an integer (or short for a 16 bit value ???)
and extract the parts as needed
- you could declare word16 as a byte_low_hi and compute the corresponding 16
bit value as needed
- you could perhaps even declare a union (that is two structure that shares
the same underlying memroy area to access this a 16 bit value or as two
bytes depending on your needs; not remember to have tried this with .NET)

Another option would be to explain what you are trying to do in case somone
would suggest another simpler approach.

--
Patrice

"cmdolcet69 " <co************ @hotmail.coma écrit dans le message de news:
11************* ********@g4g200 0h...legrou ps.com...
On Sep 10, 10:11 am, "Patrice" <http://www.chez.com/scribe/wrote:
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.0010 20.262...@k79g2 000hse.googlegr oups.com...
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_by te)
I get the following error "high_byte is not a member of Integer" How
can i fix this- Hide quoted text -

- Show quoted text -

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
Sep 10 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
17409
by: Zulik | last post by:
Hello, I might have a bad day today but I have a byte buffer holding binary numbers. Now, I want to convert this to byte buffer with hex numbers. Is there any elegant way of doing that? Some method like: byte bin2hex(byte) {} BRs, Zulik
1
6310
by: | last post by:
When I execute the following (with an OleDBDataAdapter), wanting to add a row to a visual foxpro table: myrow= datasetTarget.Tables(0).NewRow 'fill all columns here like.. row(i)= myvalue ' then datasetTarget.Tables(0).Rows.Add(myrow) dataAdapterTarget.Update(datasetTarget.Tables(0)) '*
43
4776
by: Bill Cunningham | last post by:
I've been reading the C standard online and I'm puzzled as to what multibyte chars are. Wide chars I believe would be characters for languages such as cantonese or Japanese. I know the ASCII character set specifies that each character such as 'b' or 'B' is an 8 bit character. So what's a multibyte character? Also how would you use the function parameter main (char argc, char **argv) if that's correct? Bill
4
17680
by: Shashi | last post by:
Can somebody explain how the byte alignment for structures work, taking the following example and considering: byte of 1 Byte word of 2 Bytes dword of 4 Bytes typedef struct { byte a; word b;
5
9805
by: Robin Tucker | last post by:
I need to marshal an IntPtr (which I've got from GlobalLock of an HGLOBAL) into a byte array. I know the size of the array required and I've got a pointer to the blob, but I can't see how to copy the memory across. Using Marshal.PtrStructure doesn't work - it says my byte() array is not blittable! (byte is a blittable type however). Cannot use Marshal.Copy, because that works the other way around (for mashalling to COM, not from it). ...
9
12680
by: Charles Law | last post by:
Suppose I have a structure Private Structure MyStruct Dim el1 As Byte Dim el2 As Int16 Dim el3 As Byte End Structure I want to convert this into a byte array where
6
2762
by: Dennis | last post by:
I was trying to determine the fastest way to build a byte array from components where the size of the individual components varied depending on the user's input. I tried three classes I built: (1) using redim arrays to add to a normal byte array (2) using an ArrayList and finally (3) using a memorystream. These three classes are listed below the test sub called "TestBuildByteArray". It was interesting that using the memorystream was...
24
2753
by: Frederick Gotham | last post by:
There is a thread currently active on this newsgroup entitled: "how to calculate the difference between 2 addresses ?" The thread deals with calculating the distance, in bytes, between two memory addresses. Obviously, this can only be done if the addresses refer to elements or members of the same object (or base objects, etc.). John Carson and I proposed two separate methods.
77
4237
by: borophyll | last post by:
As I read it, C99 states that a byte is an: "addressable unit of data storage large enough to hold any member of the basic character set of the execution environment" (3.6) and that a byte must be at least 8 bits: "The values given below shall be replaced by constant expressions suitable for use in #if
0
8057
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8470
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6010
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3959
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1580
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1327
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.