[VB.NET] Byte problem :[

Results 1 to 9 of 9
  1. #1
    Grand Master Nuklear is offline
    Grand MasterRank
    May 2006 Join Date
    EarthLocation
    3,586Posts

    [VB.NET] Byte problem :[

    What is a byte exactly? When I make a function that requires a byte.

    I put in any number between 0 - 255, but it errors that it cannot be converted to 1 dimensional array. <_<


  2. #2
    Grand Master username1 is offline
    Grand MasterRank
    Jul 2004 Join Date
    5,867Posts

    sage

    http://en.wikipedia.org/wiki/Byte

    (Yet another proof that VB is not a real programming language and all those that use it are hopeless n00bs...)

  3. #3
    Grand Master Nuklear is offline
    Grand MasterRank
    May 2006 Join Date
    EarthLocation
    3,586Posts
    I know it isn't a real programming language, but it gets the task done. ;]

  4. #4
    Elite Member konnichiwa is offline
    Member +Rank
    Feb 2003 Join Date
    -Location
    202Posts
    your method is probably after a byte array.

    in c# its:

    byte[] byteArray = new byte [] { 0xFF };

  5. #5
    Infraction Banned mucow is offline
    MemberRank
    Oct 2004 Join Date
    41Posts
    Quote Originally Posted by username1 View Post
    Byte - Wikipedia, the free encyclopedia

    (Yet another proof that VB is not a real programming language and all those that use it are hopeless n00bs...)
    Agreed.

  6. #6
    Member damian is offline
    MemberRank
    May 2003 Join Date
    44Posts
    Quote Originally Posted by mucow View Post
    Agreed.
    Also Agreed.

  7. #7
    Grand Master username1 is offline
    Grand MasterRank
    Jul 2004 Join Date
    5,867Posts
    Quote Originally Posted by damian View Post
    Also Agreed.
    QFT.

  8. #8
    Elite Member YukiNeko is offline
    Member +Rank
    Mar 2006 Join Date
    NetherlandsLocation
    148Posts
    Quote Originally Posted by Nuklear View Post
    What is a byte exactly? When I make a function that requires a byte.

    I put in any number between 0 - 255, but it errors that it cannot be converted to 1 dimensional array. <_<
    Visual Basic.NET is supposed to be simple, but your question doesn't make much sense. I wrote a tiny program that demonstrates how to set a byte, how to read it and how to change it.

    Code:
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            'start my sub
            mySub()
    
        End Sub
    
        Private Sub mySub()
            'declare variable as byte and set value 20
            Dim myByte As Byte = 20
    
            'display result from my function in a messagebox
            MsgBox(myFunction(myByte).ToString)
    
            'change byte variable to value 80
            myByte = 80
    
            'again display result from my function in a messagebox
            MsgBox(myFunction(myByte).ToString)
        End Sub
    
        Private Function myFunction(ByVal anyByte As Byte) As Boolean
            If anyByte > 60 Then
                Return True
            Else
                Return False
            End If
        End Function
    
    End Class

  9. #9
    Grand Master username1 is offline
    Grand MasterRank
    Jul 2004 Join Date
    5,867Posts

    sage

    Quote Originally Posted by YukiNeko View Post
    but your question doesn't make much sense.
    Because he obviously has no knowledge whatsoever of the functioning of a computer, and attempts to proceed will fail until he gains said knowledge.

    sage for bumping old thread



Advertisement