sintax problem with Public Const MyIC As Integer = &H100

M

Mario Krsnic

Hello everybody,
I found this in a sample. VS highlights "&" in "&amp" and says "Expression
expected".
Public Const MyIC As Integer = &H100
How to fix it?
Thanks!
Mario
 
A

Auric__

Mario Krsnic said:
Hello everybody,
I found this in a sample. VS highlights "&" in "&amp" and says "Expression
expected".
Public Const MyIC As Integer = &H100
How to fix it?

"&" is just "&" butchered into HTML. "&H" tells VB that the number is in
hexadecial (base 16). The correct line should read:
Public Const MyIC As Integer = &H100
 
O

Onur Güzel

Hello everybody,
I found this in a sample. VS highlights "&" in "&amp" and says "Expression
expected".
Public Const MyIC As Integer = &H100
How to fix it?
Thanks!
Mario

&amp stands for "ampersand". Probably you have taken the code from a
HTML website and performed a copy-paste that's why you're seeing it.
You simply declare it:

Public Const MyIC As Integer = &H100

Onur Güzel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top