Byte is not a member of Integer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cmdolcet69

    #1

    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

  • Patrice

    #2
    Re: Byte is not a member of Integer

    What is word16 ? Is it an integer rather than a byte_low_hi ?

    ---
    Patrice

    "cmdolcet69 " <colin_dolcetti @hotmail.coma écrit dans le message de news:
    1189433061.0010 20.262280@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
    >

    Comment

    • cmdolcet69

      #3
      Re: Byte is not a member of Integer

      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

      Comment

      • Phillip Taylor

        #4
        Re: Byte is not a member of Integer

        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.

        Comment

        • cmdolcet69

          #5
          Re: Byte is not a member of Integer

          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?

          Comment

          • Armin Zingler

            #6
            Re: Byte is not a member of Integer

            "cmdolcet69 " <colin_dolcetti @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

            Comment

            • cmdolcet69

              #7
              Re: Byte is not a member of Integer

              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!_ _...__END_MASK_ i?a63jfAD$z__@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?

              Comment

              • =?Utf-8?B?S2VycnkgTW9vcm1hbg==?=

                #8
                Re: Byte is not a member of Integer

                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?
                >
                >

                Comment

                • cmdolcet69

                  #9
                  Re: Byte is not a member of Integer

                  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.

                  Comment

                  • Patrice

                    #10
                    Re: Byte is not a member of Integer

                    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 " <colin_dolcetti @hotmail.coma écrit dans le message de news:
                    1189433799.1324 89.90180@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


                    Comment

                    • Armin Zingler

                      #11
                      Re: Byte is not a member of Integer

                      "cmdolcet69 " <colin_dolcetti @hotmail.comsch rieb
                      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?
                      I'm afraid, due to a lack of time, currently probably not.


                      Armin

                      Comment

                      • Phillip Taylor

                        #12
                        Re: Byte is not a member of Integer

                        On Sep 10, 7:30 pm, "Armin Zingler" <az.nos...@free net.dewrote:
                        "cmdolcet69 " <colin_dolce... @hotmail.comsch rieb
                        >
                        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?
                        >
                        I'm afraid, due to a lack of time, currently probably not.
                        >
                        Armin
                        Just do this then if your running out of time:

                        msg(2) = CChar(Convert.T oByte(adc_value .word16))

                        Comment

                        Working...