Simplest program ever - and does not work! | | |
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 | | | | 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] | | | | 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] | | | | 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] | | | | 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] | | | | 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] | | | | 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] | | | | 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 | | | | 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 | | | | 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 | | | | 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 | | | | 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> |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,327 network members.
|