Jump to content

Why is there an end of statement & expression expected


WPerciful

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
Link to comment
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()

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...