I am using vb6 to do my project. When i define an initialize a variable i get the compile time error as "Expected:End of statement". The code is :

Dim i as integer=1

Recommended Answers

All 2 Replies

You're gonna have to show a bit more of your code. Particularly the lines above that.

Hi,

For VB6, Post your query In "Visual basic 4/5/6" Group...
In VB6, You cannot declare and assign Value in same statement...

Change your code to:

Dim i as integer
i =1

If its a Contant..

Const i As Integer =1

Regards
Veena

Be a part of the DaniWeb community

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