Hey guys, quick questions!

1- How can I check the size of a variable? Size in bytes, not length. (;
2- What data can be stored into byte variables? And what the maxium size of the variable?
3- How do I store data inside a byte variable?

Thats all for now. Thanks!

Recommended Answers

If you need to get the byte count for a String, see if this helps.

Dim sTemp As String = "GetByteCount"
        MsgBox(System.Text.Encoding.UTF8.GetByteCount(sTemp))

Note: There are other types of Encoding other than UTF8.

Jump to Post

More than likely using a For/Next loop inside another.
If you still have questions regarding this new issue, start a new thread.

Jump to Post

All 5 Replies

If you need to get the byte count for a String, see if this helps.

Dim sTemp As String = "GetByteCount"
        MsgBox(System.Text.Encoding.UTF8.GetByteCount(sTemp))

Note: There are other types of Encoding other than UTF8.

I'll try it now.

I have one more question, is not exactly the same subject, but its is very near to it. I want to let the user how many variables he will need, and I also need that he controls the variables sizes (in length now). But all variables will have the same size.

This can be done using an array, right?

More than likely using a For/Next loop inside another.
If you still have questions regarding this new issue, start a new thread.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.