Jump to content
WPerciful

Why is there an end of statement & expression expected

Recommended Posts

I've been using this code for years, and on the new SDK it now throws an end of statement expected and expression expected error. I'm not sure why this is now an issue whereas it hasn't been or how to resolve it.

 

   <CommandMethod("test")>
Public Sub test()
   Dim ps New Autodesk.AutoCAD.Windows.PaletteSet = Nothing
   ps = As New Autodesk.AutoCAD.Windows.PaletteSet("_")
   Dim dp As dtp = New dtp
   ps.Add("_", dp)
   ps.Visible = True
End Sub

Edited by WPerciful

Share this post


Link to post
Share on other sites

The only thing that pops out at me is the lack of an underscore.

 

   <CommandMethod("test")> [color="red"]_[/color]
Public Sub test()

Share this post


Link to post
Share on other sites

I'm not a VB.NET-er so just some blind shots here about what's inside the test() sub

 

Public Sub test()
   Dim ps As Autodesk.AutoCAD.Windows.PaletteSet
   ps = New Autodesk.AutoCAD.Windows.PaletteSet("_")
   Dim dp As dtp = New dtp
   ps.Add("_", dp)
   ps.Visible = True
End Sub

 

and should what above ever work, may be some more contracted form would, too

 

Public Sub test()
   With New Autodesk.AutoCAD.Windows.PaletteSet("_")
       .Add("_", New dtp)
       .Visible = True
   End With
End Sub

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×