VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form controlcenter 
   Caption         =   "Control Centre"
   ClientHeight    =   5295
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4860
   ControlBox      =   0   'False
   ForeColor       =   &H80000002&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   5295
   ScaleWidth      =   4860
   Visible         =   0   'False
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   4440
      Top             =   360
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      DialogTitle     =   "Parameter file"
   End
   Begin VB.TextBox Text4 
      Height          =   285
      Left            =   4440
      TabIndex        =   18
      Text            =   "Text4"
      Top             =   960
      Width           =   615
   End
   Begin TabDlg.SSTab SSTab1 
      Height          =   3615
      Left            =   0
      TabIndex        =   6
      Top             =   120
      Width           =   4395
      _ExtentX        =   7752
      _ExtentY        =   6376
      _Version        =   393216
      Tabs            =   5
      Tab             =   1
      TabsPerRow      =   5
      TabHeight       =   520
      WordWrap        =   0   'False
      TabCaption(0)   =   "Control"
      TabPicture(0)   =   "controlcenter.frx":0000
      Tab(0).ControlEnabled=   0   'False
      Tab(0).Control(0)=   "cmd_OutputData"
      Tab(0).Control(1)=   "AdodcMacro"
      Tab(0).Control(2)=   "CmdGlobalSelection"
      Tab(0).Control(3)=   "Frame2"
      Tab(0).Control(4)=   "Frame1"
      Tab(0).ControlCount=   5
      TabCaption(1)   =   "Options"
      TabPicture(1)   =   "controlcenter.frx":001C
      Tab(1).ControlEnabled=   -1  'True
      Tab(1).Control(0)=   "Label8"
      Tab(1).Control(0).Enabled=   0   'False
      Tab(1).Control(1)=   "Label2"
      Tab(1).Control(1).Enabled=   0   'False
      Tab(1).Control(2)=   "Label6"
      Tab(1).Control(2).Enabled=   0   'False
      Tab(1).Control(3)=   "Label9"
      Tab(1).Control(3).Enabled=   0   'False
      Tab(1).Control(4)=   "Label5"
      Tab(1).Control(4).Enabled=   0   'False
      Tab(1).Control(5)=   "chk2Savehist"
      Tab(1).Control(5).Enabled=   0   'False
      Tab(1).Control(6)=   "txtWeight"
      Tab(1).Control(6).Enabled=   0   'False
      Tab(1).Control(7)=   "chk2Saveincomehist"
      Tab(1).Control(7).Enabled=   0   'False
      Tab(1).Control(8)=   "chk2Saveoutfiles"
      Tab(1).Control(8).Enabled=   0   'False
      Tab(1).Control(9)=   "txt2MYparameterfilname"
      Tab(1).Control(9).Enabled=   0   'False
      Tab(1).Control(10)=   "cmd1Randomize"
      Tab(1).Control(10).Enabled=   0   'False
      Tab(1).Control(11)=   "txt2BASEparameterfilname"
      Tab(1).Control(11).Enabled=   0   'False
      Tab(1).Control(12)=   "chk2Price99"
      Tab(1).Control(12).Enabled=   0   'False
      Tab(1).Control(13)=   "chk2SaveAccessdb"
      Tab(1).Control(13).Enabled=   0   'False
      Tab(1).Control(14)=   "txtPercentofsample"
      Tab(1).Control(14).Enabled=   0   'False
      Tab(1).Control(15)=   "cmdBrowsepar1"
      Tab(1).Control(15).Enabled=   0   'False
      Tab(1).Control(16)=   "cmdBrowsepar2"
      Tab(1).Control(16).Enabled=   0   'False
      Tab(1).Control(17)=   "cmdSaveOptions"
      Tab(1).Control(17).Enabled=   0   'False
      Tab(1).Control(18)=   "txt2Runsystem"
      Tab(1).Control(18).Enabled=   0   'False
      Tab(1).Control(19)=   "chkRetire65"
      Tab(1).Control(19).Enabled=   0   'False
      Tab(1).Control(20)=   "txtRetire"
      Tab(1).Control(20).Enabled=   0   'False
      Tab(1).Control(21)=   "chkRandomize"
      Tab(1).Control(21).Enabled=   0   'False
      Tab(1).ControlCount=   22
      TabCaption(2)   =   "Step"
      TabPicture(2)   =   "controlcenter.frx":0038
      Tab(2).ControlEnabled=   0   'False
      Tab(2).Control(0)=   "chkDataexist(19)"
      Tab(2).Control(1)=   "chkDataexist(18)"
      Tab(2).Control(2)=   "chkDataexist(17)"
      Tab(2).Control(3)=   "chkDataexist(16)"
      Tab(2).Control(4)=   "chkDataexist(15)"
      Tab(2).Control(5)=   "chkDataexist(14)"
      Tab(2).Control(6)=   "chkDataexist(13)"
      Tab(2).Control(7)=   "chkDataexist(12)"
      Tab(2).Control(8)=   "chkDataexist(11)"
      Tab(2).Control(9)=   "chkDataexist(10)"
      Tab(2).Control(10)=   "chkDataexist(59)"
      Tab(2).Control(11)=   "chkDataexist(58)"
      Tab(2).Control(12)=   "chkDataexist(57)"
      Tab(2).Control(13)=   "chkDataexist(56)"
      Tab(2).Control(14)=   "chkDataexist(55)"
      Tab(2).Control(15)=   "chkDataexist(54)"
      Tab(2).Control(16)=   "chkDataexist(53)"
      Tab(2).Control(17)=   "chkDataexist(52)"
      Tab(2).Control(18)=   "chkDataexist(51)"
      Tab(2).Control(19)=   "chkDataexist(50)"
      Tab(2).Control(20)=   "chkDataexist(49)"
      Tab(2).Control(21)=   "chkDataexist(48)"
      Tab(2).Control(22)=   "chkDataexist(47)"
      Tab(2).Control(23)=   "chkDataexist(46)"
      Tab(2).Control(24)=   "chkDataexist(45)"
      Tab(2).Control(25)=   "chkDataexist(44)"
      Tab(2).Control(26)=   "chkDataexist(43)"
      Tab(2).Control(27)=   "chkDataexist(42)"
      Tab(2).Control(28)=   "chkDataexist(41)"
      Tab(2).Control(29)=   "chkDataexist(40)"
      Tab(2).Control(30)=   "chkDataexist(39)"
      Tab(2).Control(31)=   "chkDataexist(38)"
      Tab(2).Control(32)=   "chkDataexist(37)"
      Tab(2).Control(33)=   "chkDataexist(36)"
      Tab(2).Control(34)=   "chkDataexist(35)"
      Tab(2).Control(35)=   "chkDataexist(34)"
      Tab(2).Control(36)=   "chkDataexist(33)"
      Tab(2).Control(37)=   "chkDataexist(32)"
      Tab(2).Control(38)=   "chkDataexist(31)"
      Tab(2).Control(39)=   "chkDataexist(30)"
      Tab(2).Control(40)=   "chkDataexist(29)"
      Tab(2).Control(41)=   "chkDataexist(28)"
      Tab(2).Control(42)=   "chkDataexist(27)"
      Tab(2).Control(43)=   "chkDataexist(26)"
      Tab(2).Control(44)=   "chkDataexist(25)"
      Tab(2).Control(45)=   "chkDataexist(24)"
      Tab(2).Control(46)=   "chkDataexist(23)"
      Tab(2).Control(47)=   "chkDataexist(22)"
      Tab(2).Control(48)=   "chkDataexist(21)"
      Tab(2).Control(49)=   "chkDataexist(20)"
      Tab(2).Control(50)=   "txtGotoyear"
      Tab(2).Control(51)=   "chkDataexist(9)"
      Tab(2).Control(52)=   "chkDataexist(8)"
      Tab(2).Control(53)=   "chkDataexist(7)"
      Tab(2).Control(54)=   "chkDataexist(6)"
      Tab(2).Control(55)=   "chkDataexist(5)"
      Tab(2).Control(56)=   "chkDataexist(4)"
      Tab(2).Control(57)=   "chkDataexist(3)"
      Tab(2).Control(58)=   "chkDataexist(2)"
      Tab(2).Control(59)=   "chkDataexist(1)"
      Tab(2).Control(60)=   "chkDataexist(0)"
      Tab(2).Control(61)=   "cmd1Goto"
      Tab(2).ControlCount=   62
      TabCaption(3)   =   "Param"
      TabPicture(3)   =   "controlcenter.frx":0054
      Tab(3).ControlEnabled=   0   'False
      Tab(3).Control(0)=   "Adodc1"
      Tab(3).Control(1)=   "gridparm"
      Tab(3).ControlCount=   2
      TabCaption(4)   =   "Test!"
      TabPicture(4)   =   "controlcenter.frx":0070
      Tab(4).ControlEnabled=   0   'False
      Tab(4).Control(0)=   "cmd_writedata"
      Tab(4).Control(1)=   "cmd_contingency"
      Tab(4).Control(2)=   "cmdStatistics"
      Tab(4).Control(3)=   "cmdScript"
      Tab(4).Control(4)=   "cmdTest"
      Tab(4).ControlCount=   5
      Begin VB.CheckBox chkRandomize 
         Caption         =   "Check1"
         Height          =   255
         Left            =   3120
         TabIndex        =   111
         Top             =   1560
         Width           =   255
      End
      Begin VB.CommandButton cmd_OutputData 
         Caption         =   "Manage Output Data "
         Enabled         =   0   'False
         Height          =   495
         Left            =   -74760
         TabIndex        =   110
         Top             =   2400
         Width           =   1695
      End
      Begin VB.TextBox txtRetire 
         Height          =   285
         Left            =   1560
         TabIndex        =   109
         Text            =   "65"
         ToolTipText     =   "Pension age between 61 and 70"
         Top             =   1560
         Width           =   375
      End
      Begin VB.CommandButton cmd_writedata 
         Caption         =   "Manage Output Data"
         Height          =   495
         Left            =   -72600
         TabIndex        =   108
         Top             =   600
         Width           =   1095
      End
      Begin VB.CheckBox chkRetire65 
         Caption         =   "Retire all at age 65"
         Height          =   255
         Left            =   120
         TabIndex        =   107
         ToolTipText     =   "Exogenous pension age wanted"
         Top             =   1560
         Width           =   2175
      End
      Begin MSAdodcLib.Adodc AdodcMacro 
         Height          =   375
         Left            =   -72360
         Top             =   3000
         Width           =   1215
         Visible         =   0   'False
         _ExtentX        =   2143
         _ExtentY        =   661
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   8
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   ""
         OLEDBString     =   ""
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   ""
         Caption         =   "AdodcMacro"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin VB.CommandButton CmdGlobalSelection 
         Caption         =   "Population Selection"
         Enabled         =   0   'False
         Height          =   495
         Left            =   -74760
         TabIndex        =   106
         ToolTipText     =   "Select subsets of the model population for analysis"
         Top             =   1920
         Width           =   1695
      End
      Begin VB.CommandButton cmd_contingency 
         Caption         =   "contingency table"
         Height          =   375
         Left            =   -74760
         TabIndex        =   105
         Top             =   2400
         Width           =   1575
      End
      Begin VB.CommandButton cmdStatistics 
         Caption         =   "Statistics"
         Height          =   375
         Left            =   -74760
         TabIndex        =   104
         Top             =   1800
         Width           =   1575
      End
      Begin VB.CommandButton cmdScript 
         Caption         =   "Scripting"
         Height          =   330
         Left            =   -74760
         TabIndex        =   103
         ToolTipText     =   "Frequency tables"
         Top             =   1080
         Width           =   1695
      End
      Begin VB.TextBox txt2Runsystem 
         Height          =   285
         Left            =   3480
         TabIndex        =   102
         ToolTipText     =   "Path to parameter file"
         Top             =   1200
         Width           =   700
      End
      Begin VB.CommandButton cmdSaveOptions 
         Caption         =   "Save options"
         Height          =   375
         Left            =   120
         TabIndex        =   100
         Top             =   3120
         Width           =   1575
      End
      Begin VB.CommandButton cmdBrowsepar2 
         Caption         =   "Browse..."
         Height          =   255
         Left            =   3240
         TabIndex        =   99
         Top             =   2760
         Width           =   855
      End
      Begin VB.CommandButton cmdBrowsepar1 
         Caption         =   "Browse..."
         Height          =   255
         Left            =   3240
         TabIndex        =   98
         Top             =   2160
         Width           =   855
      End
      Begin VB.CommandButton cmdTest 
         Caption         =   "Test"
         Height          =   375
         Left            =   -74760
         TabIndex        =   97
         Top             =   600
         Width           =   1095
      End
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   330
         Left            =   -74880
         Top             =   3120
         Width           =   1215
         _ExtentX        =   2143
         _ExtentY        =   582
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   2
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   ""
         OLEDBString     =   ""
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   ""
         Caption         =   "Adodc1"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin MSDataGridLib.DataGrid gridparm 
         Bindings        =   "controlcenter.frx":008C
         Height          =   2655
         Left            =   -74880
         TabIndex        =   96
         Top             =   480
         Width           =   3975
         _ExtentX        =   7011
         _ExtentY        =   4683
         _Version        =   393216
         HeadLines       =   1
         RowHeight       =   15
         AllowAddNew     =   -1  'True
         AllowDelete     =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1053
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1053
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.TextBox txtPercentofsample 
         Height          =   285
         Left            =   3480
         TabIndex        =   94
         Text            =   "1"
         ToolTipText     =   "Scaling weight to population"
         Top             =   840
         Width           =   700
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   19
         Left            =   -71520
         TabIndex        =   92
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   18
         Left            =   -71880
         TabIndex        =   91
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   17
         Left            =   -72240
         TabIndex        =   90
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   16
         Left            =   -72600
         TabIndex        =   89
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   15
         Left            =   -72960
         TabIndex        =   88
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   14
         Left            =   -73320
         TabIndex        =   87
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   13
         Left            =   -73680
         TabIndex        =   86
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   12
         Left            =   -74040
         TabIndex        =   85
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   11
         Left            =   -74400
         TabIndex        =   84
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   10
         Left            =   -74760
         TabIndex        =   83
         Top             =   1320
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   59
         Left            =   -71520
         TabIndex        =   82
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   58
         Left            =   -71880
         TabIndex        =   81
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   57
         Left            =   -72240
         TabIndex        =   80
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   56
         Left            =   -72600
         TabIndex        =   79
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   55
         Left            =   -72960
         TabIndex        =   78
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   54
         Left            =   -73320
         TabIndex        =   77
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   53
         Left            =   -73680
         TabIndex        =   76
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   52
         Left            =   -74040
         TabIndex        =   75
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   51
         Left            =   -74400
         TabIndex        =   74
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   50
         Left            =   -74760
         TabIndex        =   73
         Top             =   2280
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   49
         Left            =   -71520
         TabIndex        =   72
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   48
         Left            =   -71880
         TabIndex        =   71
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   47
         Left            =   -72240
         TabIndex        =   70
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   46
         Left            =   -72600
         TabIndex        =   69
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   45
         Left            =   -72960
         TabIndex        =   68
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   44
         Left            =   -73320
         TabIndex        =   67
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   43
         Left            =   -73680
         TabIndex        =   66
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   42
         Left            =   -74040
         TabIndex        =   65
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   41
         Left            =   -74400
         TabIndex        =   64
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   40
         Left            =   -74760
         TabIndex        =   63
         Top             =   2040
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   39
         Left            =   -71520
         TabIndex        =   62
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   38
         Left            =   -71880
         TabIndex        =   61
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   37
         Left            =   -72240
         TabIndex        =   60
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   36
         Left            =   -72600
         TabIndex        =   59
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   35
         Left            =   -72960
         TabIndex        =   58
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   34
         Left            =   -73320
         TabIndex        =   57
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   33
         Left            =   -73680
         TabIndex        =   56
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   32
         Left            =   -74040
         TabIndex        =   55
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   31
         Left            =   -74400
         TabIndex        =   54
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   30
         Left            =   -74760
         TabIndex        =   53
         Top             =   1800
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   29
         Left            =   -71520
         TabIndex        =   52
         Top             =   1560
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   28
         Left            =   -71880
         TabIndex        =   51
         Top             =   1560
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   27
         Left            =   -72240
         TabIndex        =   50
         Top             =   1560
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   26
         Left            =   -72600
         TabIndex        =   49
         Top             =   1560
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   25
         Left            =   -72960
         TabIndex        =   48
         Top             =   1560
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   24
         Left            =   -73320
         TabIndex        =   47
         Top             =   1560
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   23
         Left            =   -73680
         TabIndex        =   46
         Top             =   1560
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   22
         Left            =   -74040
         TabIndex        =   45
         Top             =   1560
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   21
         Left            =   -74400
         TabIndex        =   44
         Top             =   1560
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   20
         Left            =   -74760
         TabIndex        =   43
         Top             =   1560
         Width           =   255
      End
      Begin VB.TextBox txtGotoyear 
         Height          =   285
         Left            =   -73740
         TabIndex        =   40
         Top             =   600
         Width           =   975
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   9
         Left            =   -71520
         TabIndex        =   39
         Top             =   1080
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   8
         Left            =   -71880
         TabIndex        =   38
         Top             =   1080
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   7
         Left            =   -72240
         TabIndex        =   37
         Top             =   1080
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   6
         Left            =   -72600
         TabIndex        =   36
         Top             =   1080
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   5
         Left            =   -72960
         TabIndex        =   35
         Top             =   1080
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   4
         Left            =   -73320
         TabIndex        =   34
         Top             =   1080
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   3
         Left            =   -73680
         TabIndex        =   33
         Top             =   1080
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   2
         Left            =   -74040
         TabIndex        =   32
         Top             =   1080
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   1
         Left            =   -74400
         TabIndex        =   31
         Top             =   1080
         Width           =   255
      End
      Begin VB.CheckBox chkDataexist 
         Enabled         =   0   'False
         Height          =   255
         Index           =   0
         Left            =   -74760
         TabIndex        =   30
         Top             =   1080
         Width           =   255
      End
      Begin VB.CommandButton cmd1Goto 
         Caption         =   "Go to year"
         Height          =   255
         Left            =   -74880
         TabIndex        =   29
         Top             =   600
         Width           =   1035
      End
      Begin VB.CheckBox chk2SaveAccessdb 
         Caption         =   "Save Access db"
         Height          =   255
         Left            =   120
         TabIndex        =   28
         ToolTipText     =   "Save individual data to a MS-Acess db. Note: Creatted files are HUGE and the process is SLOW."
         Top             =   600
         Width           =   2295
      End
      Begin VB.CheckBox chk2Price99 
         Caption         =   "Display in 1999 price level"
         Height          =   255
         Left            =   120
         TabIndex        =   27
         ToolTipText     =   "When selected, statistics will be calculated in 1999 years prices"
         Top             =   1320
         Width           =   2295
      End
      Begin VB.TextBox txt2BASEparameterfilname 
         Height          =   285
         Left            =   120
         TabIndex        =   25
         Text            =   "base_parameters.xls"
         ToolTipText     =   "Path to parameter file"
         Top             =   2760
         Width           =   3075
      End
      Begin VB.CommandButton cmd1Randomize 
         Caption         =   "Randomize"
         Height          =   255
         Left            =   3360
         TabIndex        =   24
         ToolTipText     =   "Generate a new random number seed"
         Top             =   1560
         Width           =   915
      End
      Begin VB.TextBox txt2MYparameterfilname 
         Height          =   285
         Left            =   120
         TabIndex        =   22
         Text            =   "my_parameters.xls"
         ToolTipText     =   "Path to parameter file"
         Top             =   2160
         Width           =   3075
      End
      Begin VB.CheckBox chk2Saveoutfiles 
         Caption         =   "Save output files"
         Height          =   255
         Left            =   120
         TabIndex        =   21
         ToolTipText     =   "Save binary files each year. Makes it possibly to step back and forth"
         Top             =   360
         Width           =   1635
      End
      Begin VB.CheckBox chk2Saveincomehist 
         Caption         =   "Save income history"
         Height          =   255
         Left            =   120
         TabIndex        =   20
         ToolTipText     =   "Saves each years income for individuals. Could be used for pension computations."
         Top             =   1080
         Width           =   2295
      End
      Begin VB.Frame Frame2 
         Caption         =   "Run"
         Height          =   1215
         Left            =   -74820
         TabIndex        =   19
         Top             =   480
         Width           =   1935
         Begin VB.CommandButton cmd1run 
            Caption         =   "Run"
            Height          =   375
            Left            =   120
            TabIndex        =   42
            Top             =   240
            Width           =   1695
         End
         Begin VB.ComboBox comb1Yearstorun 
            Height          =   315
            ItemData        =   "controlcenter.frx":00A1
            Left            =   120
            List            =   "controlcenter.frx":00C9
            TabIndex        =   0
            Text            =   "Init"
            Top             =   660
            Width           =   1695
         End
      End
      Begin VB.TextBox txtWeight 
         Height          =   285
         Left            =   3480
         TabIndex        =   16
         Text            =   "1"
         ToolTipText     =   "Scaling weight to population"
         Top             =   480
         Width           =   700
      End
      Begin VB.CheckBox chk2Savehist 
         Caption         =   "Save event history"
         Height          =   255
         Left            =   120
         TabIndex        =   13
         ToolTipText     =   "Saves event history in a database ( birth ,death, etc)"
         Top             =   840
         Width           =   1695
      End
      Begin VB.Frame Frame1 
         Caption         =   "Statistics"
         Height          =   2295
         Left            =   -72780
         TabIndex        =   12
         Top             =   480
         Width           =   1935
         Begin VB.CommandButton cmdMicrodata 
            Caption         =   "View individuals"
            Enabled         =   0   'False
            Height          =   330
            Left            =   120
            TabIndex        =   93
            ToolTipText     =   "Frequency tables"
            Top             =   1890
            Width           =   1695
         End
         Begin VB.CommandButton cmdKernel 
            Caption         =   "Distribution"
            Enabled         =   0   'False
            Height          =   330
            Left            =   120
            TabIndex        =   4
            ToolTipText     =   "Kernel diagram"
            Top             =   1230
            Width           =   1695
         End
         Begin VB.CommandButton cmdDemo 
            Caption         =   "Demographics"
            Enabled         =   0   'False
            Height          =   330
            Left            =   120
            TabIndex        =   1
            ToolTipText     =   "Demographic statistics"
            Top             =   240
            Width           =   1695
         End
         Begin VB.CommandButton cmdDemohist 
            Caption         =   "Population histogram"
            Enabled         =   0   'False
            Height          =   330
            Left            =   120
            TabIndex        =   2
            Top             =   570
            Width           =   1695
         End
         Begin VB.CommandButton cmdFreq 
            Caption         =   "Frequency"
            Enabled         =   0   'False
            Height          =   330
            Left            =   120
            TabIndex        =   5
            ToolTipText     =   "Frequency tables"
            Top             =   1560
            Width           =   1695
         End
         Begin VB.CommandButton cmdUnivar 
            Caption         =   "Univariate statistics"
            Enabled         =   0   'False
            Height          =   330
            Left            =   120
            TabIndex        =   3
            ToolTipText     =   "Mean, sum, min, max etc."
            Top             =   900
            Width           =   1695
         End
      End
      Begin VB.Label Label5 
         Caption         =   "Run system"
         Height          =   195
         Left            =   2520
         TabIndex        =   101
         Top             =   1200
         Width           =   975
      End
      Begin VB.Label Label9 
         Caption         =   "Sampel size %"
         Height          =   255
         Left            =   2400
         TabIndex        =   95
         Top             =   840
         Width           =   1035
      End
      Begin VB.Label Label6 
         Caption         =   "Base parameter Excel file (demographics etc):"
         Height          =   195
         Left            =   120
         TabIndex        =   26
         Top             =   2520
         Width           =   3315
      End
      Begin VB.Label Label2 
         Caption         =   "My parameter Excel file (inflation, rents etc):"
         Height          =   195
         Left            =   120
         TabIndex        =   23
         Top             =   1920
         Width           =   3555
      End
      Begin VB.Label Label8 
         Caption         =   "Weight (100%)"
         Height          =   255
         Left            =   2400
         TabIndex        =   17
         Top             =   510
         Width           =   1035
      End
   End
   Begin VB.Label Label1 
      Caption         =   "Time:"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   360
      TabIndex        =   41
      Top             =   4800
      Width           =   435
   End
   Begin VB.Image imgCalc 
      Height          =   300
      Left            =   1800
      Picture         =   "controlcenter.frx":0145
      Stretch         =   -1  'True
      Top             =   4800
      Width           =   300
      Visible         =   0   'False
   End
   Begin VB.Label Label7 
      Caption         =   "Year:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   120
      TabIndex        =   15
      Top             =   3840
      Width           =   495
   End
   Begin VB.Label lblYear 
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   600
      TabIndex        =   14
      Top             =   3840
      Width           =   495
   End
   Begin VB.Label Label4 
      Caption         =   "Individuals:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   1180
      TabIndex        =   11
      Top             =   3840
      Width           =   1000
   End
   Begin VB.Label Label3 
      Caption         =   "Households:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2780
      TabIndex        =   10
      Top             =   3840
      Width           =   1050
   End
   Begin VB.Label antalindivider 
      Height          =   255
      Left            =   2180
      TabIndex        =   9
      Top             =   3840
      Width           =   600
   End
   Begin VB.Label antalhushåll 
      Height          =   255
      Left            =   3860
      TabIndex        =   8
      Top             =   3840
      Width           =   600
   End
   Begin VB.Label label_tid 
      Caption         =   "0"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   960
      TabIndex        =   7
      Top             =   4800
      Width           =   495
   End
End
Attribute VB_Name = "controlcenter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function Beep Lib "kernel32" _
  (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long



Private Sub cmd_OutputData_Click()
  frm_outputdata.Show
End Sub

Private Sub cmd_writedata_Click() If init_done = 0 Then MsgBox "SESIM must be initiated!" Exit Sub Else frm_outputdata.Show End If End Sub
Private Sub cmdTest_Click() Call test_fetch End Sub
Private Sub Form_Click() ' The call below causes crashes TP 011023 ' report_ed.Show End Sub
Private Sub Form_Load() '! Load Control Centre form 'Path to runtime parameters (not currently used) 'Data1.DatabaseName = sesimpath & "\parameterdata\sesimrun.mdb" 'Data1.Refresh Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sesimpath & "\parameterdata\sesimrun.mdb" & ";Persist Security Info=False" Adodc1.RecordSource = "parm_scale" Adodc1.Refresh With Me .Height = 4500 .Width = 4545 End With controlcenter.lblYear = base_year + model_time Me.Show ' Menu items MDIForm1.menu_loadwindowsstate.enabled = True MDIForm1.menu_savewindowsstate.enabled = True Call get_options cmd1run.SetFocus SelIsOpen = False 'No selection window open yet End Sub
'******************************** '*** TAB 1 '********************************
Public Sub cmd1run_Click() '! Run button is pressed Screen.MousePointer = vbHourglass If init_done = 0 Then Call Initsesim If cmd1run.Caption = "Stop" Then cmd1run.Caption = "Will stop. Wait..." cmd1run.Refresh cmd1run.Tag = 1 Exit Sub End If If cmd1run.Caption <> "Run" Then Exit Sub cmd1run.Caption = "Stop" ' imgCalc.Visible = True ' imgCalc.Refresh ' How many years to run? ' Fetch from combo box Dim årtxt As String Dim blank_pos As String Dim antal_år As Long årtxt = comb1Yearstorun.text If årtxt = "Init" Then antal_år = 0 comb1Yearstorun.text = "1 year" Else blank_pos = InStr(1, årtxt, " ", 1) antal_år = val(Left$(årtxt, blank_pos - 1)) End If Dim i As Long Dim t0 As Date, t1 As Date For i = 1 To antal_år t0 = Time() cmd1run.Tag = 0 status "----------" Call forward_one_year ' Update count antalindivider.Caption = m_icount antalhushåll.Caption = m_hcount 'Update viewers Call update_viewers ' Write output data (selection viewer has to be updated first) Call Write_Output_Data t1 = Time() status "Elapsed time: " & CStr(Minute(t1 - t0) * 60 + Second(t1 - t0)) & " seconds" DoEvents If cmd1run.Tag = 1 Then Exit For If m_icount < 1 Or m_hcount < 1 Then Exit For Next ' Beep 300, 300 cmd1run.Caption = "Run" ' imgCalc.Visible = False ' imgCalc.Refresh Screen.MousePointer = vbDefault End Sub
'********************************
Public Sub cmdDemo_Click() '! Demographic table Dim dem cmdDemo.enabled = False Set dem = monitor_demographics monitor_demographics.Show coll_view.add dem, "mdem" dem.Tag = "mdem" End Sub
'********************************
Public Sub cmdDemohist_Click() '! Population histogram Dim demhist cmdDemohist.enabled = False Set demhist = monitor_demohist demhist.Show coll_view.add demhist, "mdemhist" End Sub
'********************************
Public Sub cmdUnivar_Click() '! Univariate statistics Dim new_uni As New monitor_univariate Static antal_uni As Integer new_uni.Show antal_uni = antal_uni + 1 new_uni.Tag = "uni" & CStr(antal_uni) coll_view.add new_uni, "uni" & CStr(antal_uni) End Sub
'********************************
Public Sub cmdKernel_Click() '! Kernel diagram Dim new_ker As New monitor_kernel Static antal_ker As Integer new_ker.Show antal_ker = antal_ker + 1 new_ker.Tag = "ker" & CStr(antal_ker) coll_view.add new_ker, "ker" & CStr(antal_ker) End Sub
'********************************
Public Sub cmdFreq_Click() '! Frequency tables Dim new_freq As New monitor_freq Static antal_freq As Integer new_freq.Show antal_freq = antal_freq + 1 new_freq.Tag = "freq" & CStr(antal_freq) coll_view.add new_freq, "freq" & CStr(antal_freq) End Sub
Private Sub cmdScript_Click() '! Scripting Dim new_script As New report_ed Static antal_script As Integer new_script.Show antal_script = antal_script + 1 new_script.Tag = "script" & CStr(antal_script) coll_view.add new_script, "script" & CStr(antal_script) End Sub
'***************************************************** '*** Form for multiple global selections '*** NOTE: frmGlobalSelection is NOT added to coll_view '*** collection. '*****************************************************
Public Sub CmdGlobalSelection_Click() SelIsOpen = True frmGlobalSelection.Show End Sub
'******************************** '*** TAB 2 Options '******************************** ' Save event history
Private Sub chk2Savehist_Click() If chk2Savehist.value = 1 Then lifehist = True Else lifehist = False End If End Sub
' Save income history
Private Sub chk2Saveincomehist_Click() If chk2Saveincomehist = 1 Then inchist.enabled = True Else inchist.enabled = False End If End Sub
' Random numbers
Private Sub cmd1Randomize_Click() Randomize ' Flag. 0=same random seed. 1=different seed. random = 1 Printdok ("Randomized: New random number seed generated") End Sub
Private Sub Form_Resize() ' With Me ' .Height = 5300 ' .Width = 4545 ' End With End Sub
'******************************************************* '*** TAB 3 Step fort and back (if binary files is saved) '*******************************************************
Private Sub chkDataexist_Click(index As Integer) If chkDataexist(index).value = 1 Then txtGotoyear.text = base_year + index cmd1Goto_Click chkDataexist(index).value = 0 End If End Sub
Public Sub cmd1Goto_Click() If Not IsNumeric(txtGotoyear.text) Then status "Not a valid year" Exit Sub End If If binary_files_exist(CInt(txtGotoyear.text - base_year)) = False Then status "Not a valid year" Exit Sub End If If CInt(txtGotoyear.text) = base_year + model_time Then Exit Sub model_time = CInt(txtGotoyear.text - base_year) status "Change to time" & CStr(model_time) Call read_data(model_time) antalindivider.Caption = m_icount antalhushåll.Caption = m_hcount 'Uppdatera ev viewers Call update_viewers status "Done" End Sub
'******************************** '*** TAB 4 - Runtime parameters '******************************** ''******************************** ''*** TAB 5 - Experimental viewers ''********************************
Public Sub cmdStatistics_Click() '! New statistics Dim new_stat As New monitor_stat Static antal_stat As Integer new_stat.Show antal_stat = antal_stat + 1 new_stat.Tag = "stat" & CStr(antal_stat) coll_view.add new_stat, "stat" & CStr(antal_stat) End Sub
'Private Sub cmd3Lifeevents_Click() ' Dim new_db As New monitor_db ' Dim file As String ' file = sesimpath & "\microdata\event_history.mdb" ' If Dir(file) = "" Then ' MsgBox "Can't find file:" & vbCrLf & file ' Exit Sub ' End If ' new_db.Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & file & ";Persist Security Info=False" ' 'new_db.dbfilename = file ' new_db.Adodc2.RecordSource = "hist" ' 'new_db.dbtable = "hist" ' new_db.Show 'End Sub 'Private Sub cmdviewinchist_Click() ' Dim new_db As New monitor_db ' Dim file As String ' file = sesimpath & "\microdata\income_history.mdb" ' If Dir(file) = "" Then ' MsgBox "Can't find file:" & vbCrLf & file ' Exit Sub ' End If ' new_db.dbfilename = file ' new_db.dbtable = "inchist" ' new_db.Show 'End Sub 'Private Sub cmdShowMSmicrodata_Click() ' Dim new_db As New monitor_db ' Dim file As String ' file = sesimpath & "\microdata\microdata.mdb" ' If Dir(file) = "" Then ' MsgBox "Can't find file:" & vbCrLf & file ' Exit Sub ' End If ' new_db.dbfilename = file ' new_db.dbtable = "individuals" ' new_db.Show 'End Sub ''Private Sub cmd3Micro_Click()
Public Sub cmdMicrodata_Click() Dim new_mic As New monitor_microdata Static antal_mic As Integer new_mic.Show antal_mic = antal_mic + 1 new_mic.Tag = "mic" & CStr(antal_mic) coll_view.add new_mic, "mic" & CStr(antal_mic) End Sub
'***************************************************** '*** Contingency table viewer '*****************************************************
Private Sub cmd_contingency_Click() If init_done = 0 Then MsgBox "SESIM has to be initialized!" Else Static n_of_contingency Dim obj_contingency As New form_contingency n_of_contingency = n_of_contingency + 1 obj_contingency.Show obj_contingency.Tag = "contingency" & CStr(n_of_contingency) coll_view.add obj_contingency, "contingency" & CStr(n_of_contingency) End If End Sub
'******************************** '*** General '********************************
Private Sub SSTab1_Click(PreviousTab As Integer) gridparm.Columns(0).Width = 1200 gridparm.Columns(1).Width = 600 gridparm.Columns(2).Width = 400 gridparm.Columns(3).Width = 400 gridparm.Columns(4).Width = 600 End Sub
' Reread parameters
Private Sub gridParm_AfterUpdate() Call read_scaleparm(0) End Sub
'******************************************************** ' Sub update_viewers sends a random number to object Text1 ' defined in all viewers. Every viewer updates itself ' when the contents of Text1 changes. '********************************************************
Public Sub update_viewers() Dim v_s controlcenter.label_tid.Caption = model_time controlcenter.lblYear = base_year + model_time ' If a selection exists then update the selection ' vector before updating the viewers If SelIsOpen Then frmGlobalSelection.Text1 = CStr(Rnd) For Each v_s In coll_view v_s.Text1.text = CStr(Rnd) DoEvents Next Else ' If no selection exists it implies that all individuals and ' households are selected Dim i As Long For i = 1 To m_icount select_i(i) = 1 i_selected(i) = 1 If i <= m_hcount Then select_h(i) = 1 h_selected(i) = 1 End If Next i For Each v_s In coll_view v_s.Text1.text = CStr(Rnd) DoEvents Next End If End Sub
Private Sub cmdBrowsepar1_Click() Dim txtFile As String txtFile = get_par_file() If txtFile <> "" Then txt2MYparameterfilname.text = txtFile End Sub
Private Sub cmdBrowsepar2_Click() Dim txtFile As String txtFile = get_par_file() If txtFile <> "" Then txt2BASEparameterfilname.text = txtFile End Sub
Private Function get_par_file() Dim dirname As String ' Save name of current directory dirname = CurDir() CommonDialog1.CancelError = True On Error GoTo ErrHandler CommonDialog1.Filter = "Excel Files (*.xls)|*.xls|All Files(*.*)|*.*" ' Specify default filter CommonDialog1.FilterIndex = 1 ' Display the Open dialog box CommonDialog1.ShowOpen ' Display name of selected file 'MsgBox CommonDialog1.FileName get_par_file = CommonDialog1.filename ' Restore current directory ChDrive (Left(dirname, 1)) ChDir (dirname) Exit Function ErrHandler: 'User pressed the Cancel button Exit Function End Function
Private Sub cmdSaveOptions_Click() Dim fnum As Integer fnum = FreeFile Open sesimpath & "\parameterdata\sesim.ini" For Output As fnum Print #fnum, "chk2Saveoutfiles=" & chk2Saveoutfiles.value Print #fnum, "chk2SaveAccessdb=" & chk2SaveAccessdb.value Print #fnum, "chk2Savehist=" & chk2Savehist.value Print #fnum, "chk2Saveincomehist=" & chk2Saveincomehist.value Print #fnum, "chk2Price99=" & chk2Price99.value Print #fnum, "txtWeight=" & txtWeight.text Print #fnum, "txtPercentofsample=" & txtPercentofsample.text Print #fnum, "txt2Runsystem=" & txt2Runsystem.text Print #fnum, "txt2MYparameterfilname=" & txt2MYparameterfilname.text Print #fnum, "txt2BASEparameterfilname=" & txt2BASEparameterfilname.text Print #fnum, "chkRetire65=" & chkRetire65.value Print #fnum, "txtRetire=" & txtRetire.text Print #fnum, "chkRandomize=" & chkRandomize.value Close fnum status "Options saved" get_options End Sub
Public Sub get_options() Dim fnum As Integer Dim txtLine As String Dim txtSplit If Dir(sesimpath & "\parameterdata\sesim.ini") <> "" Then fnum = FreeFile Open sesimpath & "\parameterdata\sesim.ini" For Input As fnum Do While Not EOF(fnum) Line Input #fnum, txtLine txtSplit = Split(txtLine, "=") If txtSplit(0) = "chk2Saveoutfiles" Then chk2Saveoutfiles.value = txtSplit(1) If txtSplit(0) = "chk2SaveAccessdb" Then chk2SaveAccessdb.value = txtSplit(1) If txtSplit(0) = "chk2Savehist" Then chk2Savehist.value = txtSplit(1) If txtSplit(0) = "chk2Saveincomehist" Then chk2Saveincomehist.value = txtSplit(1) If txtSplit(0) = "chk2Price99" Then chk2Price99.value = txtSplit(1) If txtSplit(0) = "txtWeight" Then txtWeight.text = txtSplit(1) If txtSplit(0) = "txtPercentofsample" Then txtPercentofsample.text = txtSplit(1) If txtSplit(0) = "txt2Runsystem" Then txt2Runsystem.text = txtSplit(1) If txtSplit(0) = "txt2MYparameterfilname" Then txt2MYparameterfilname.text = txtSplit(1) If txtSplit(0) = "txt2BASEparameterfilname" Then txt2BASEparameterfilname.text = txtSplit(1) If txtSplit(0) = "chkRetire65" Then chkRetire65.value = txtSplit(1) If txtSplit(0) = "txtRetire65" Then txtRetire.text = txtSplit(1) If txtSplit(0) = "chkRandomize" Then chkRandomize.value = txtSplit(1) Loop Close fnum Else chk2Saveoutfiles = 0 chk2SaveAccessdb.value = 0 chk2Savehist.value = 0 chk2Saveincomehist.value = 0 chk2Price99.value = 0 txtWeight.text = 85 txtPercentofsample.text = 1 txt2Runsystem.text = "2" txt2MYparameterfilname.text = "source\default_parameters_2.xls" txt2BASEparameterfilname.text = "source\default_parameters_1.xls" chkRetire65 = 0 chkRandomize = 0 Call cmdSaveOptions_Click End If End Sub
Private Sub txtRetire_Validate(KeepFocus As Boolean) If Not IsNumeric(txtRetire.text) Or IsEmpty(txtRetire.text) Then KeepFocus = True MsgBox "Only pension between 61 and 70 years allowed" txtRetire.text = 65 Else If CInt(txtRetire.text) < 61 Or CInt(txtRetire.text) > 70 Then KeepFocus = True MsgBox "Only pension between 61 and 70 years allowed" txtRetire.text = 65 End If End If End Sub
Private Sub txtRetire_lostfocus() If Not IsNumeric(txtRetire.text) Or IsEmpty(txtRetire.text) Then MsgBox "Only pension between 61 and 70 years allowed" txtRetire.text = 65 Else If CInt(txtRetire.text) < 61 Or CInt(txtRetire.text) > 70 Then MsgBox "Only pension between 61 and 70 years allowed" txtRetire.text = 65 End If End If End Sub
Private Sub txtWeight_Change() On Error GoTo fel m_weight = txtPercentofsample.text fel: m_weight = 0 End Sub