Array of hex chars from a function

 Private Sub btnCrtFunc_Click(sender As System.Object, e As System.EventArgsHandles btnCrtFunc.Click
        Dim result As New System.Text.StringBuilder
        result.Append("Hexadecimal characters: ")
        result.Append(String.Join(",", HexadecimalCharacters()))
 
        ListBox1.Items.Clear()
 
        'Option I: Enumerate Hexadecimal Characters by line.
        For Each item As String In HexadecimalCharacters()
            With ListBox1
                .Items.Add(item)
            End With
        Next
 
        'Option II: List Hexadecimal Characters as a string.
        ListBox1.Items.Add(result.ToString)
 
    End Sub
 
    Public Function HexadecimalCharacters() As String()
        ' ----- Return the first 16 hex numbers as an array.
        Dim hexChars(255) As String
 
        For counter As Integer = 0 To UBound(hexChars)
            hexChars(counter) = Hex(counter)
        Next counter
        Return hexChars
    End Function

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: