VB.NET-DECLARATION STATEMENT

VB.NET-DECLARATION STATEMENT

cturlington
Collaborator Collaborator
738 Views
3 Replies
Message 1 of 4

VB.NET-DECLARATION STATEMENT

cturlington
Collaborator
Collaborator

Hello,

 

I am using Civil 3D 2016.

 

I am in the early stages of learning VB.NET and ACAD API.

 

I have a statement that I believe is legitimate but I am getting an error: "Declaration expected" with the blue squiggly underline.  However, just above the statement, I have the Dim statement that I believe should declare the variable.  A screen shots of the statement is attached for reference.  What am I likely missing in this statement that is causing the error?

0 Likes
Accepted solutions (1)
739 Views
3 Replies
Replies (3)
Message 2 of 4

augusto.goncalves
Alumni
Alumni
actually you should use:

public class ClassNameHere
<commandmethod("methodName")>
public sub methodName()
' your code here
end sub
end class
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 3 of 4

cturlington
Collaborator
Collaborator

Thanks Agusto,

 

That worked very well but I still got an "End of statement expected" at the end of the Public Class ValuesExample() with blue squiggly under the () at end of ValuesExample().  I have an End Class statement at the very end, following End Sub, as you indicated.  The error I am getting, I would think, suggests I forgot the End Class statement, but it is actually in place.  If I remove the () at end of Public Class, the error does not show  and all looks great.  Is that because I am not returning a value result ?

0 Likes
Message 4 of 4

augusto.goncalves
Alumni
Alumni
Accepted solution
there is no () on class declaration

public class ValuesExample
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes