home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch03 / types / typemod.bas < prev    next >
Encoding:
BASIC Source File  |  1996-03-01  |  2.3 KB  |  89 lines

  1. Attribute VB_Name = "TYPESModule"
  2. Type Customer
  3.     Company As String
  4.     Manager As String
  5.     Address As String
  6.     City As String
  7.     Country As String
  8.     CustomerSince As Date
  9.     Balance As Currency
  10. End Type
  11. Private Customers(10) As Customer
  12. Private cust As Customer
  13.  
  14. Public Sub InitData()
  15.  
  16.     cust.Company = "Bottom-Dollar Markets"
  17.     cust.Manager = "Elizabeth Lincoln"
  18.     cust.Address = "23 Tsawassen Blvd."
  19.     cust.City = "Tsawassen"
  20.     cust.Country = "Canada"
  21.     cust.CustomerSince = #10/20/1996#
  22.     cust.Balance = 33500
  23.     Customers(1) = cust
  24.  
  25.     cust.Company = "Consolidated Holdings"
  26.     cust.Manager = "Elizabeth Brown"
  27.     cust.Address = "Berkeley Gardens"
  28.     cust.City = "London"
  29.     cust.Country = "UK"
  30.     cust.CustomerSince = #6/12/1992#
  31.     cust.Balance = 45000
  32.     Customers(2) = cust
  33.  
  34.     cust.Company = "Hungry Coyote Import Store"
  35.     cust.Manager = "Yoshi Latimer"
  36.     cust.Address = "City Center Plaza"
  37.     cust.City = "Elgin"
  38.     cust.Country = "USA"
  39.     cust.CustomerSince = #1/1/1990#
  40.     cust.Balance = -12000
  41.     Customers(3) = cust
  42.  
  43.     cust.Company = "Piccolo und mehr"
  44.     cust.Manager = "Georg Pipps"
  45.     cust.Address = "Geislweg 14"
  46.     cust.City = "Salzburg"
  47.     cust.Country = "Austria"
  48.     cust.CustomerSince = #1/1/1993#
  49.     cust.Balance = 28400
  50.     Customers(4) = cust
  51.  
  52.     cust.Company = "Vins et alcools Chevalier"
  53.     cust.Manager = "Paul Henriot"
  54.     cust.Address = "59 rue de l'Abbaye"
  55.     cust.City = "Reims"
  56.     cust.Country = "France"
  57.     cust.CustomerSince = #1/20/1994#
  58.     cust.Balance = -43500
  59.     Customers(5) = cust
  60.  
  61.     cust.Company = "White Clover Markets"
  62.     cust.Manager = "Karl Jablonski"
  63.     cust.Address = "305 - 14th Ave. S."
  64.     cust.City = "Seattle"
  65.     cust.Country = "USA"
  66.     cust.CustomerSince = #5/18/1990#
  67.     cust.Balance = 33500
  68.     Customers(6) = cust
  69.  
  70.     cust.Company = "Maison Dewey"
  71.     cust.Manager = "Catherine Dewey"
  72.     cust.Address = "Rue Joseph-Bens 532"
  73.     cust.City = "Bruxelles"
  74.     cust.Country = "Belgium"
  75.     cust.CustomerSince = #10/10/1991#
  76.     cust.Balance = 15400
  77.     Customers(7) = cust
  78.  
  79. End Sub
  80.  
  81. Function CountCustomers() As Integer
  82.     CountCustomers = 7
  83. End Function
  84.  
  85. Function GetCustomer(idx As Integer) As Customer
  86.     GetCustomer = Customers(idx)
  87. End Function
  88.  
  89.