I put the class at the end of a windows form, outside the form's class , and
I put the
Dim CurrentSale As New SalesRecord
CurrentSale.CustomerName = "Matthew"
simply inside the form's clode
as in:
Public Class test
Inherits System.Windows.Forms.Form
dim CurrentSale As New SalesRecord
CurrentSale.CustomerName = "Matthew"
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ed*************@TK2MSFTNGP11.phx.gbl...
"baret bonden" <ar****@networks-cc.com> schrieb: Trying to learn OOP. Pasted some MS example code
inside a form class(but of course made the test class
outside of the form class);
I get "declaration epected" pointing to"Currentsale" ; this is the same
error I get with my own test code....
Dim CurrentSale As New SalesRecord
CurrentSale.CustomerName = "Matthew"
Where did you place this code?
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>