English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Here's the program...it's not working......says Sub Main was not found in Welcome1.Module1

Module modFirstWelcome

Sub Main()
Console.WriteLine("Welcome to Visual Basic!")

End Sub

End Module

2007-02-28 18:48:33 · 3 answers · asked by bloodyhell1981 1 in Computers & Internet Programming & Design

Using Visual Studio .NET

2007-03-01 02:58:56 · update #1

3 answers

Your module isn't called Module1 but modFirstWelcom.

Declare the Sub as Public (write Public Sub Main() instead of just Sub Main()) and reference it as modFirstWelcome.Main or Welcome1.modFirstWelcome.Main()
(that if the name of your project is still Welcom1, else you'll have to substitute it too).

2007-02-28 19:00:09 · answer #1 · answered by Rumtscho 3 · 0 1

those command to which you referr are called Command Line Arguments. you ought to use command line arguments on your VB undertaking by skill of utilising the My.utility.CommandLineArgs merchandise. it rather is a determination of all the arguments which you handed on your command line. The arguments are parse utilising an area because of the fact the delimiter so "hi people" could be handed as 2 seperate arguments "hi and people" you apart from mght could desire to write code to confirm if arguments are present day and the thank you to technique those arguments if someone does not bypass adequate or too many or none in any respect. Arguments are dealt with as strings so 123 could desire to be switched over right into a numeric datatype in case you ought to use it *** a variety. here is an undemanding occasion of the thank you to bypass 2 user-friendly arguments to a pair of labels. you are able to attempt this by skill of imparting command line arguments on your application in Debug mode interior the direction of the undertaking homes . interior the undertaking homes click on the Debug tab and you will see a multi line textbox the place you are able to upload your command line arguments for sorting out your application. you basically could desire to apply this in the experience that your debugging your application with command line arguments or you are able to bypass the arguments as you oftentimes could by skill of typing after the exe extension Public type Form1 inner maximum Sub Form1_Load(ByVal sender As device.merchandise, _ ByVal e As device.EventArgs) _ Handles MyBase.Load If My.utility.CommandLineArgs.count variety > 0 Then 'arguments exist Me.lblX.textual content cloth = My.utility.CommandLineArgs(0) If My.utility.CommandLineArgs.count variety > a million Then Me.lblY.textual content cloth = My.utility.CommandLineArgs(a million) end If end If end Sub end type

2016-09-30 01:19:37 · answer #2 · answered by ? 4 · 0 0

Is this VB.net? If it is, then the main procedure has to be a public shared procedure.

2007-03-01 01:25:25 · answer #3 · answered by Pfo 7 · 0 0

fedest.com, questions and answers