|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
This Simple 2-Line Program Generates An Error! Why?I created a new Windows Application project in VB 2003. Aside from the
Windows generated code, this is all I added to the form: Dim a as String a="foo" Believe it or not, the second line generates an error. VB underlines the "a" with the message "Declaration Expected." The same code compiles fine on someone else's computer. Can anyone help me understand this? --Eric "Eric Robinson" <eric @ pmcipa..{com}> schrieb: Make sure you added the code to a procedure. When adding the code to the >I created a new Windows Application project in VB 2003. Aside from the >Windows generated code, this is all I added to the form: > > Dim a as String > a="foo" > > Believe it or not, the second line generates an error. VB underlines the > "a" with the message "Declaration Expected." > > The same code compiles fine on someone else's computer. class directly you'll receive the above message. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Yargh. Naturally. Sorry.
Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:uyppDFmfFHA.2840@tk2msftngp13.phx.gbl... > "Eric Robinson" <eric @ pmcipa..{com}> schrieb: >>I created a new Windows Application project in VB 2003. Aside from the >>Windows generated code, this is all I added to the form: >> >> Dim a as String >> a="foo" >> >> Believe it or not, the second line generates an error. VB underlines the >> "a" with the message "Declaration Expected." >> >> The same code compiles fine on someone else's computer. > > Make sure you added the code to a procedure. When adding the code to the > class directly you'll receive the above message. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/>
Show quote
Hide quote
"Eric Robinson" <eric @ pmcipa..{com}> wrote in message news:qUexe.3954$Si3.3091@fe06.lga... And you put those two lines where? In the declarations section, in a sub or function, an event handler?> I created a new Windows Application project in VB 2003. Aside from the > Windows generated code, this is all I added to the form: > > Dim a as String > a="foo" > > Believe it or not, the second line generates an error. VB underlines the "a" > with the message "Declaration Expected." > > The same code compiles fine on someone else's computer. > > Can anyone help me understand this? > > --Eric > > |
|||||||||||||||||||||||