Connecting Tech Pros Worldwide Help | Site Map

Simplest program ever - and does not work!

Angel Salamanca
Guest
 
Posts: n/a
#1: Nov 20 '05
Hello all,

Just downloaded the .NET SDK and, to test it works, I
write this "Hello world" code:

Option explicit

Imports System

' A "Hello World!" program in Visual Basic.

Module Hello
Sub Main()
Microsoft.VisualBasic.Interaction.MsgBox("Hello, world!")
End Sub
End Module

It compiles fine and works. Now I replace the MsgBox
sentence with just

MsgBox("La vamos a liar")

and the compiler does not like it. It tells me 'Name
MsgBox is not declared'. So is not the import statement
working?

Given this symptom, what could be the problem?

Regards

Tom Shelton
Guest
 
Posts: n/a
#2: Nov 20 '05

re: Simplest program ever - and does not work!


On 2003-11-23, Angel Salamanca <angel.salamanca.f@telefonica.net> wrote:[color=blue]
> Hello all,
>
> Just downloaded the .NET SDK and, to test it works, I
> write this "Hello world" code:
>
> Option explicit
>
> Imports System
>
> ' A "Hello World!" program in Visual Basic.
>
> Module Hello
> Sub Main()
> Microsoft.VisualBasic.Interaction.MsgBox("Hello, world!")
> End Sub
> End Module
>
> It compiles fine and works. Now I replace the MsgBox
> sentence with just
>
> MsgBox("La vamos a liar")
>
> and the compiler does not like it. It tells me 'Name
> MsgBox is not declared'. So is not the import statement
> working?
>
> Given this symptom, what could be the problem?
>
> Regards
>[/color]

Add:

Imports Microsoft.VisualBasic

--
Tom Shelton
MVP [Visual Basic]
Tom Shelton
Guest
 
Posts: n/a
#3: Nov 20 '05

re: Simplest program ever - and does not work!


On 2003-11-23, Angel Salamanca <angel.salamanca.f@telefonica.net> wrote:[color=blue]
> Hello all,
>
> Just downloaded the .NET SDK and, to test it works, I
> write this "Hello world" code:
>
> Option explicit
>
> Imports System
>
> ' A "Hello World!" program in Visual Basic.
>
> Module Hello
> Sub Main()
> Microsoft.VisualBasic.Interaction.MsgBox("Hello, world!")
> End Sub
> End Module
>
> It compiles fine and works. Now I replace the MsgBox
> sentence with just
>
> MsgBox("La vamos a liar")
>
> and the compiler does not like it. It tells me 'Name
> MsgBox is not declared'. So is not the import statement
> working?
>
> Given this symptom, what could be the problem?
>
> Regards
>[/color]

Add:

Imports Microsoft.VisualBasic

--
Tom Shelton
MVP [Visual Basic]
Sahil Malik
Guest
 
Posts: n/a
#4: Nov 20 '05

re: Simplest program ever - and does not work!


Type
Imports Microsoft.visualbasic.interaction

at the top of ur program.


"Angel Salamanca" <angel.salamanca.f@telefonica.net> wrote in message
news:056401c3b198$63eeb700$a101280a@phx.gbl...[color=blue]
> Hello all,
>
> Just downloaded the .NET SDK and, to test it works, I
> write this "Hello world" code:
>
> Option explicit
>
> Imports System
>
> ' A "Hello World!" program in Visual Basic.
>
> Module Hello
> Sub Main()
> Microsoft.VisualBasic.Interaction.MsgBox("Hello, world!")
> End Sub
> End Module
>
> It compiles fine and works. Now I replace the MsgBox
> sentence with just
>
> MsgBox("La vamos a liar")
>
> and the compiler does not like it. It tells me 'Name
> MsgBox is not declared'. So is not the import statement
> working?
>
> Given this symptom, what could be the problem?
>
> Regards
>[/color]


Sahil Malik
Guest
 
Posts: n/a
#5: Nov 20 '05

re: Simplest program ever - and does not work!


Type
Imports Microsoft.visualbasic.interaction

at the top of ur program.


"Angel Salamanca" <angel.salamanca.f@telefonica.net> wrote in message
news:056401c3b198$63eeb700$a101280a@phx.gbl...[color=blue]
> Hello all,
>
> Just downloaded the .NET SDK and, to test it works, I
> write this "Hello world" code:
>
> Option explicit
>
> Imports System
>
> ' A "Hello World!" program in Visual Basic.
>
> Module Hello
> Sub Main()
> Microsoft.VisualBasic.Interaction.MsgBox("Hello, world!")
> End Sub
> End Module
>
> It compiles fine and works. Now I replace the MsgBox
> sentence with just
>
> MsgBox("La vamos a liar")
>
> and the compiler does not like it. It tells me 'Name
> MsgBox is not declared'. So is not the import statement
> working?
>
> Given this symptom, what could be the problem?
>
> Regards
>[/color]


Angel Salamanca
Guest
 
Posts: n/a
#6: Nov 20 '05

re: Simplest program ever - and does not work!


Problem solved, many thanks to both responders.[color=blue]
>-----Original Message-----
>Type
>Imports Microsoft.visualbasic.interaction
>
>at the top of ur program.
>
>
>"Angel Salamanca" <angel.salamanca.f@telefonica.net>[/color]
wrote in message[color=blue]
>news:056401c3b198$63eeb700$a101280a@phx.gbl...[color=green]
>> Hello all,
>>
>> Just downloaded the .NET SDK and, to test it works, I
>> write this "Hello world" code:
>>
>> Option explicit
>>
>> Imports System
>>
>> ' A "Hello World!" program in Visual Basic.
>>
>> Module Hello
>> Sub Main()
>> Microsoft.VisualBasic.Interaction.MsgBox("Hello,[/color][/color]
world!")[color=blue][color=green]
>> End Sub
>> End Module
>>
>> It compiles fine and works. Now I replace the MsgBox
>> sentence with just
>>
>> MsgBox("La vamos a liar")
>>
>> and the compiler does not like it. It tells me 'Name
>> MsgBox is not declared'. So is not the import statement
>> working?
>>
>> Given this symptom, what could be the problem?
>>
>> Regards
>>[/color]
>
>
>.
>[/color]
Angel Salamanca
Guest
 
Posts: n/a
#7: Nov 20 '05

re: Simplest program ever - and does not work!


Problem solved, many thanks to both responders.[color=blue]
>-----Original Message-----
>Type
>Imports Microsoft.visualbasic.interaction
>
>at the top of ur program.
>
>
>"Angel Salamanca" <angel.salamanca.f@telefonica.net>[/color]
wrote in message[color=blue]
>news:056401c3b198$63eeb700$a101280a@phx.gbl...[color=green]
>> Hello all,
>>
>> Just downloaded the .NET SDK and, to test it works, I
>> write this "Hello world" code:
>>
>> Option explicit
>>
>> Imports System
>>
>> ' A "Hello World!" program in Visual Basic.
>>
>> Module Hello
>> Sub Main()
>> Microsoft.VisualBasic.Interaction.MsgBox("Hello,[/color][/color]
world!")[color=blue][color=green]
>> End Sub
>> End Module
>>
>> It compiles fine and works. Now I replace the MsgBox
>> sentence with just
>>
>> MsgBox("La vamos a liar")
>>
>> and the compiler does not like it. It tells me 'Name
>> MsgBox is not declared'. So is not the import statement
>> working?
>>
>> Given this symptom, what could be the problem?
>>
>> Regards
>>[/color]
>
>
>.
>[/color]
Cor
Guest
 
Posts: n/a
#8: Nov 20 '05

re: Simplest program ever - and does not work!


Hi Angel,

Most of the visitors here are using Visual.Studio Net,
I am not sure if you are using that.

But you can try[color=blue]
>
> Option explicit
>
> Imports System[/color]
Imports Microsoft.Visual.Interaction[color=blue]
>
> Module Hello
> Sub Main()[/color]
MsgBox("La vamos a liar")[color=blue]
> End Sub
> End Module[/color]

Will maybe work, but I am not sure of that, because I never did compile
withouth Visual.Studio.Net (when you are using it, this will as far as I can
see now give no problem).

I hope this helpst,

Cor


Cor
Guest
 
Posts: n/a
#9: Nov 20 '05

re: Simplest program ever - and does not work!


Hi Angel,

Most of the visitors here are using Visual.Studio Net,
I am not sure if you are using that.

But you can try[color=blue]
>
> Option explicit
>
> Imports System[/color]
Imports Microsoft.Visual.Interaction[color=blue]
>
> Module Hello
> Sub Main()[/color]
MsgBox("La vamos a liar")[color=blue]
> End Sub
> End Module[/color]

Will maybe work, but I am not sure of that, because I never did compile
withouth Visual.Studio.Net (when you are using it, this will as far as I can
see now give no problem).

I hope this helpst,

Cor


Armin Zingler
Guest
 
Posts: n/a
#10: Nov 20 '05

re: Simplest program ever - and does not work!


"Angel Salamanca" <angel.salamanca.f@telefonica.net> schrieb[color=blue]
> Hello all,
>
> Just downloaded the .NET SDK and, to test it works, I
> write this "Hello world" code:
>
> Option explicit
>
> Imports System
>
> ' A "Hello World!" program in Visual Basic.
>
> Module Hello
> Sub Main()
> Microsoft.VisualBasic.Interaction.MsgBox("Hello, world!")
> End Sub
> End Module
>
> It compiles fine and works. Now I replace the MsgBox
> sentence with just
>
> MsgBox("La vamos a liar")
>
> and the compiler does not like it. It tells me 'Name
> MsgBox is not declared'. So is not the import statement
> working?
>
> Given this symptom, what could be the problem?[/color]

You do not import Microsoft.VisualBasic.Interaction, you only import System.
Msgbox is not a member of Sytem.


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Armin Zingler
Guest
 
Posts: n/a
#11: Nov 20 '05

re: Simplest program ever - and does not work!


"Angel Salamanca" <angel.salamanca.f@telefonica.net> schrieb[color=blue]
> Hello all,
>
> Just downloaded the .NET SDK and, to test it works, I
> write this "Hello world" code:
>
> Option explicit
>
> Imports System
>
> ' A "Hello World!" program in Visual Basic.
>
> Module Hello
> Sub Main()
> Microsoft.VisualBasic.Interaction.MsgBox("Hello, world!")
> End Sub
> End Module
>
> It compiles fine and works. Now I replace the MsgBox
> sentence with just
>
> MsgBox("La vamos a liar")
>
> and the compiler does not like it. It tells me 'Name
> MsgBox is not declared'. So is not the import statement
> working?
>
> Given this symptom, what could be the problem?[/color]

You do not import Microsoft.VisualBasic.Interaction, you only import System.
Msgbox is not a member of Sytem.


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#12: Nov 20 '05

re: Simplest program ever - and does not work!


* "Angel Salamanca" <angel.salamanca.f@telefonica.net> scripsit:[color=blue]
> Just downloaded the .NET SDK and, to test it works, I
> write this "Hello world" code:
>
> Option explicit
>
> Imports System
>
> ' A "Hello World!" program in Visual Basic.
>
> Module Hello
> Sub Main()
> Microsoft.VisualBasic.Interaction.MsgBox("Hello, world!")
> End Sub
> End Module
>
> It compiles fine and works. Now I replace the MsgBox
> sentence with just
>
> MsgBox("La vamos a liar")
>
> and the compiler does not like it. It tells me 'Name
> MsgBox is not declared'. So is not the import statement
> working?[/color]

Alternatively you can specify the imports when calling "vbc.exe"
("/imports:..."). Just type "vbc.exe" and see its command line
parameters.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Closed Thread