sintax problem with Public Const MyIC As Integer = &H100

  • Thread starter Thread starter Mario Krsnic
  • Start date Start date
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
 
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
 
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
 
Back
Top