找不到子主

时间:2019-11-07 16:00:14

标签: vb.net visual-studio function compiler-errors main

初学者!尝试编译时出现错误,未找到Sub Main。我需要一个函数,并试图调用一个函数并执行命令。我试图根据自己的选择在程序中设置一个字段。当我已经无法将其添加到某事时,不确定如何添加一个子总管。我很困惑又很新...

Public Sub Main() Call Function() ForFixtures() Dim SegNum 
     As Integer Dim 
     LocID As Integer Dim NewName As Double Dim Name As String SegNum = 
     JDA.Intactix.Automation.SpaceSegmentFields.Number LocID = 
     JDA.Intactix.Automation.SpaceFixtureFields.LocationID Name = 
     JDA.Intactix.Automation.FloorFixtureFields.Name NewName = 
     JDA.Intactix.Automation.SpaceSegmentFields.Name & 
     JDA.Intactix.Automation.SpaceFixtureFields.LocationID If Name = 1 Then 
     SetFixtureField(FixtureField, Name, NewName) End Sub –

已编辑的代码,已添加:     codiTenda(10)

但仍然说未找到

1 个答案:

答案 0 :(得分:1)

右键单击项目并选择属性

enter image description here

点击下拉菜单“启动对象”

enter image description here

如果没有Sub Main,请将此代码添加到Module1

Sub Main()
    CallFunctionForFixtures()
End Sub

然后在下拉列表中再次选择