/*---------------------------------------------------------------------------*/
/*------------------------> I N C L U D E S <--------------------------------*/
/*---------------------------------------------------------------------------*/
// Original runtime library was Multi-threaded DLL (/MD)
#include "StdAfx.h"
#include "sappimpdata.h"
#include "SAPP1.h"
#include "SAPP1Dlg.h"
#include <sstream>

#include "Dlg_BuiltForm.h"
#include "Dlg_JobDetails.h"
#include "Dlg_Ventilation.h"
#include "Dlg_MainHeating.h"
#include "Dlg_MainHeatingDetails.h"
#include "Dlg_SecHeating.h"
#include "Dlg_WaterHeating.h"
#include "Dlg_Renewables.h"
#include "Dlg_Renewables1.h"
#include "Dlg_ThermalBridging.h"
#include "Dlg_Results.h"
#include "Dlg_Windows.h"
#include "Dlg_AreaAndUvalues.h"
#include "Dlg_AddToEstate.h"
#include "Dlg_Estate.h"

#include <vector>
#include <string>
#include <iostream>
#include <math.h>
#include <string.h>

#include "colorstatic.h"
#include "readonlyedit.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

using namespace std; 

OpenProjectInfo tempEntry;

CToolTipCtrl *m_ToolTipSDHW;
CToolTipCtrl *m_ToolTipPV;
CToolTipCtrl *m_ToolTipWT;
CToolTipCtrl *m_ToolTipuCHP;
CToolTipCtrl *m_ToolTipuHydro;
CToolTipCtrl *m_ToolTipPCM;
CToolTipCtrl *m_ToolTipMVHR;
CToolTipCtrl *m_ToolTipFGHRS;
CToolTipCtrl *m_ToolTipWWHRS;
CToolTipCtrl *m_ToolTipFGHRS1;
CToolTipCtrl *m_ToolTipWWHRS2;

bool save_file_called_first_time = true;
bool if_open_estate_from_main_dialog = false;
bool is_edit_dwelling_clicked = false;
bool is_add_dwelling_clicked = false;
bool is_delete_dwelling_clicked = false;

bool do_not_populate_vector_while_changing_tabs = false;

bool is_estate_case_updated = false;
bool is_estate_num_of_dwellings_updated = false;

int itemSelectedToEdit   = 0;
int itemSelectedToDelete = 0;

CString numOfDwellingsRead;
CString caseOfDwellingRead;

typedef struct 
{
	CString fileName;
}estateFileNameVector;

vector <estateFileNameVector> estateFileNameVector1;

//--------------------------------------------------------
// Create a structure that holds all variables for SAPP
// inputs and results as members 
//--------------------------------------------------------
struct SAPPvariables
{
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	CString JobDetRefNum;
	CString assessorName;
	CString JobDetComments;
	CString propertyFlatNameorNum;
	CString propertyLetter;
	CString propertyHouseNum;
	CString propertyStreet;
	CString propertyLocality;
	CString propertyDistrict;
	CString propertyTown;
	CString propertyCounty;
	CString propertyPostCode;
	CString clientFlatNameorNum;
	CString clientLetter;
	CString clientHouseorBlockNum;
	CString clientStreet;
	CString clientLocality;
	CString clientDistrict;
	CString clientTown;
	CString clientCounty;
	CString clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	CString locationString;

	CString dwellingType;
	CString builtForm;
	CString Detachment;
	CString FlatPosition;
	CString dwellingTerrain;

	CString storey1Level;
	CString storey2Level;
	CString storey3Level;
	CString storey4Level;
	CString storey5Level;
	CString storey6Level;
	int dwellingShelteredSides;
	CString yearPropertBuilt; 

	CString storey1;
	CString storey2;
	CString storey3;
	CString storey4;
	CString storey5;
	CString storey6;

	CString storey1Basement;
	CString storey2Basement;
	CString storey3Basement;
	CString storey4Basement;
	CString storey5Basement;
	CString storey6Basement;

	double storey1Area;
	double storey2Area;
	double storey3Area;
	double storey4Area;
	double storey5Area;
	double storey6Area;

	double storey1Height;
	double storey2Height;
	double storey3Height;
	double storey4Height;
	double storey5Height;
	double storey6Height;

	double multipleLinearRegCoeff;
	double multipleLinearRegCoeff1;
	double multipleLinearRegCoeff2;
	
	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	CString winOvershading;
	CString	winGlazing;

	double totalGlzArea;
	double winNArea;
	double winNEArea;
	double winEArea;
	double winSEArea;
	double winSArea;
	double winSWArea;
	double winWArea;
	double winNWArea;
	double rooflightsArea;

	double winNSolTrans;
	double winNESolTrans;
	double winESolTrans;
	double winSESolTrans;
	double winSSolTrans;
	double winSWSolTrans;
	double winWSolTrans;
	double winNWSolTrans;
	double rooflightsSolTrans;

	double winNFrameFactor;
	double winNEFrameFactor;
	double winEFrameFactor;
	double winSEFrameFactor;
	double winSFrameFactor;
	double winSWFrameFactor;
	double winWFrameFactor;
	double winNWFrameFactor;
	double rooflightsFrameFactor;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	double grossAreaWall1;
	double groosAreaRoof1;
	double netAreaDoors;
	double netAreaWindows;
	double netAreaRoofLights;
	double netAreaGF;
	double netAreaExFloor;
	double netAreaWallType1;
	double netAreaWallType2;
	double netAreaRoofType1;
	double netAreaRoofType2;
	double netAreaPartyWall;
	double netAreaPartyFloor;
	double netAreaPartyCeiling;
	double netAreaInternalWall;
	double netAreaInternalFloor;
	double netAreaInternalCeiling;

	double UvalueDoors;
	double UvalueWindows;
	double UvalueRooflights;
	double UvalueGF;
	double UvalueExposedFloor;
	double UvalueWallType1;
	double UvalueWallType2;
	double UvalueRoofTYpe1;
	double UvalueRoofType2;
	double UvaluePartyWall;

	double kValueGF;
	double kValueExpFloor;
	double kValueWallType1;
	double kValueWallType2;
	double kValueRoofType1;
	double kValueRoofType2;
	double kValuePartyWall;
	double kValuePartyFloor;
	double kValuePartyCeiling;
	double kValueIntWall;
	double kValueIntFloor;
	double kValueIntCeiling;

	double thermalMassParameter;
	double livingRoomFraction;

	double extAreaSum;
	double exposureValue;
	double extInsulationValue;
	double extUvalueXareaSum;
	double hem_extInsulationValue;

	double hem_extAreaSum;
	double hem_extUvalueXareaSum;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	double ThermBGFPerimeter;
	double ThermBFloorWithingDwellinPerimeter;
	double ThermBFloorBetweenDwellinPerimeter;
	double ThermBBalconyWithingDwellingLength;
	double ThermBBalconyBetweenDwellingLength;
	double ThermBEavesAtCeiling;
	double ThermBEavesAtRafter;
	double ThermBGableAtCeiling;
	double ThermBGableAtRafter;
	double ThermBLengthNormalCorners;
	double ThermBLengthInvertedCorners;
	double ThermBPartWallBetweenDwelling;
	double yValueEntry;

	CString ThermBMetalBoxLintelUserDef;
	CString ThermBOtherLintelUserDef;
	CString ThermBSillUserDef;
	CString ThermBJambUserDef;
	CString ThermBGFPerimeterUserDef;
	CString ThermBFloorWithinDwellingUserDef;
	CString ThermBFloorBwDwellingUserDef;
	CString ThermBBalcWithinDwellingLengthUserDef;
	CString ThermBBalcBwDwellingLengthUserDef;
	CString ThermBEavesInsAtCeilingUserDef;
	CString ThermBEavesInsAtRafterUserDef;
	CString ThermBGableInsAtCeilingUserDef;
	CString ThermBGableInsAtRafetUserDef;
	CString ThermBLengthOfNormalCornersUserDef;
	CString ThermBLengthOfInvertedCornersUserDef;
	CString ThermBPartWallBetweenDwellingUserDef;

	double ThermBMetalBoxLintelSiValue;
	double ThermBOtherLintelsSiValue;
	double ThermBSillSiValue;
	double ThermBJambSiValue;
	double ThermBGFPerimeterSiValue;
	double ThermBFloorWithinDwellingSiValue;
	double ThermBFloorBetweenDwellingSiValue;
	double ThermBBalconyWithinDwellingSiValue;
	double ThermBBalconyBwDwellingSiValue;
	double ThermBEavesInsAtCelingSiValue;
	double ThermBEavesInsAtRafterSiValue;
	double ThermBGableInsAtCeilingSiValue;
	double ThermBGableInsAtRafterSiValue;
	double ThermBLengthOfNormalCornersSiValue;
	double ThermBLengthOfInvertedCornersSiValue;
	double ThermBPartBwDwellingLengthSiValue;

	double ThermBMetalBoxLintelResult;
	double ThermBOtherLintelsResult;
	double ThermBSillResult;
	double ThermBJambResult;
	double ThermBGFPerimeterResult;
	double ThermBFloorWithinDwellingPerimeterResult;
	double ThermBFloorBetweenDwellingPerimeterResult;
	double ThermBBalcWithDwellingLengthResult;
	double ThermBBalconyBwDwellingLengthResult;
	double ThermBEavesInsCeilingResult;
	double ThermBEavesInsRafterResult;
	double ThermBGableInsCeilingResult;
	double ThermBGableInsRafterResult;
	double ThermBLengthNormalCornersResult;
	double ThermBLengthInvertedCornersResult;
	double ThermBPartyWallBwDwellingResult;

	double thermBridgeYvalue_grossArea ;
	double hem_yValueEntry;

	CString versionText;
	CString titleBarText;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	CString mechVentType;
	CString pressureTestYN ;
	double structInf;
	double floorInf;
	CString draughtLobby;
	int perWindowDraughtStripped;

	CString designAirPermeability;
	CString pressureTestScotland;
	CString accreditedDetailsScotland;
	CString seekExemptionForLT3Dwellings;

	double designAirPermRate;
	double asBuiltAirPermRate;

	CString airPermMeasuredInDwelling;
	CString asBuiltRef;
	CString asBuiltTestDate;

	double MVHRThermalEff;
	CString mechVentValuesFrom;
	CString numsWetRooms;
	CString ductInsulation;

	int numsOpenFirePlaces ;
	int numsOpenFlues ;
	int numsFluelessGasFires;

	int numsExtractFans;
	int numsPassiveVents;
	CString isACPresent;
	double ACEnergyUse;
	double measuredQ50;
	int numOfStoreys;

	double dewllingVolume;
	double infiltration_rate ;
	double infiltration_rate18;
	double shelterFactor;
	double infiltrationRateWithshelterFactor;
	double infliltrationOpenings;
	double additionalInfiltration;
	double windowInfiltration;
	int numOfShelteredSides;
	double totalWindSpeed;
	double totalWindFactor;
	double effInfiltrationRate;

	double achThrougSystem;
	double valueIfExhaustAirHP;
	double valueIfBalancedHR;

	double effectiveACH;
	double effectiveACH_MVHR;
	double achMVHR1;
	double achMVHR2;

	double spaceHeatingDemandMVHR1;
	double spaceHeatingDemandMVHR2;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	double primaryFuelUsed;
    double secFuelUsed;
	CString mainFuel;
	CString electricityTarrif;
	CString mainHtType;
	CString mainHtEffFrom;
	CString boilerType;
	CString isFanFluePresent;
	CString mainHtControls;
	CString mainHtEmitter;
	CString isIterlockPresent;
	CString isPumpInHeatedSpace;
	CString mainHtSystem;
	CString primaryFuelUsedString;
	CString secFuelUsedString;

	CString boilerRef;
	CString boilerModel;
	CString isSecBoilerFuelPresent;
	CString mainHtCompensator;
	CString mainHtManufacturerDesc;
	CString mainHtTestMethod;

	double mainHtEff;

	double mainHtEffNominal; //@min 20140303

	double mainHtEffAdj;
	double mainHtTempAdj;
	double mainHtFractionSupplied ;

	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	CString oilPumpInHeatedSpace;
	CString oilBoilerInstalled;

	CString isThereCHP;
	CString CHPfuel;

	double CPSUoperatingTemp;

	double heatEmmFromCase;
	double heatTransferredToWater ;
	CString smokeControlledArea;

	double fractOfHtFromCHP;
	double elecEffOfCHP;
	double heatingEffOfCHP;

	CString secComBoilerFuel;
	CString secComBoilerSystem;
	double secComBoilerEff;
	double secComBoilerFractOfHtFromBoiler2;
	CString secComBoilerManufactDesc;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	CString isThereSecHeating;
	CString secHtEffFrom;
	CString secHtFuel;

	CString secHtOpenFlueChimney;
	CString secHtUnconnectedGasPoint;
	CString secHtSystem;
	CString secHtManufactDesc;
	CString secHtTestMethod;
	double secHtEff;
	double secHtFraction;

	double spaceHeatingEffAdj;
	double waterHeatingEffAdj;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	int btnWaterHtFromMainState;
	CString WHtype;
	CString WHtCylinderWithinDwelling ;
	CString WHtFuel;
	CString WHtWaterSepTimed;

	CString WHtCylManufactLossFactor;
	CString WHtCylInsType;

	CString WHtCylThermostat;
	CString WHtCylInHeatedSpace;
	CString WHtCylPrimaryPipeworkInsulated;
	CString WHtCylPumpedPrimarySystem;

	CString WHtTSnCPSUinSingleUnit;
	CString WHtTSnCPSUPrimaryPipeworkLT1_5m;
	CString WHtTSnCPSUstoreInAirCupbrd;

	CString WHtCombiKeepHotYN;
	CString DHWfromCommunityScheme;
	CString DHWComSchemeSystem;
	CString WHtHeatPumpUsesImmer;

	CString WHtUsesSummerImmer;

	double WHtCylDeclaredFactor;
	double WHtCylVolume;
	double WHtCylInsThickness;

	double WHtEff;
	double WHtEffAdj;

	CString WHtCombiKeepHotUsesElec;
	double WHtCombiPowerRating;

	CString DHWComSchemeProvidedFrom;
	double DHWComSchemeCHP2PowerRatio;

	double DHWComSchemeEff;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	CString isSHWPresent;
	CString isPVPresent;
	CString isWTPresent;
	CString uHydroyn;
	CString uCHPyn;
	CString MVHRyn;

	CString SHWCollectorType;
	CString SHWCollectorOrientation;
	CString SHWCollectorTilt;
	CString SHWOvershading;
	CString isSHWAreaGross;
	CString isSHWSolarStoreCombined;
	CString SHWSolarCircPump;
	double SHWApertureArea;
	double SHW_ZLCE;
	double SHW_HeatLossCoefficient;
	double SHW_dedicatedSolarStorageVolumeFactor;

	CString PVCollectorOrientation;
	CString PVCollectorTilt;
	CString PVOvershading;

	CString dwellingExposure;
	CString CHPFuel;

	double SHW_overshadingFactor;
	double SHW_annualSolarRadiation_pm2 ;
	double SHW_collectorPerformanceRatio;
	double SHW_solarEnergyAvailable;
	double SHW_apertureArea;

	double SHW_solarToLoadRatio;
	double SHW_collectorPerformanceFactor;
	double SHW_effectiveSolarVolume;
	double SHW_utilizationFactor;
	double N_OCC;
	double SHW_annualHotWaterUsage;
	double SHW_dailyHotWaterDemand_litres;
	double SHW_volumeRatio;
	double SHW_annualSolarInput;
	double  SHWDedSolStoreVol;

	CString isRENAdditionalElectGenerated;
	double  RENAddiationalElecGenerated ;
	double  REN_TFA;

	double  installedPVPeakPower;
	double PV_overshadingFactor;
	double PV_annualSolarRadiation_pm2 ;

	int    WTNumOf;
	double WTDiameter;
	double WTHeight;
	double WTs3;

	//---------------------------------------------------------
	// RENEWABLES 2
	//---------------------------------------------------------
	double uHydroAnnualAvgHead;
	double uHydroAnnualAvgFlow;
	double uHydroEff;
	double uHydroAnnualEnergy;

	double uCHPheatToPowerRatio;
	double uCHPElectricEff;
	double uCHPHeatingEff;
	double uCHPHeatingFraction;
	double uCHPAnnualElectricity;

	CString FGHRSpresent;
	CString FGHRSstore;
	double FGHRSstoreVolume;
	double FGHRSusefulFracHtRec_kf1;
	CString FGHRSfittedMain;
	CString FGHRSfittedSec;
	CString FGHRStype;
	CString determineFGHRStype;
	double FGHRStotFracHeatRec_kf2;
	double FGHRSauxelec;
	CString FGHRSpvPoweredHt;
	double FGHRSpvPkPower;
	CString FGHRSpvOrientation;
	CString FGHRSpvTilt;
	CString FGHRSpvOvershading;
	double FGHRScableLoss;

	CString WWHRSpresent;
	CString WWHRS1Make;
	CString WWHRS1Model;
	CString	WWHRS1ModelQualifier;
	int WWHRSnumOfRooms;
	int WWHRSnumMixerShowersWithBath1;
	int WWHRSnumMixerShowersWithoutBath1;

	CString WWHRS2Make;
	CString WWHRS2Model;
	CString	WWHRS2ModelQualifier;
	int WWHRSnumMixerShowersWithBath2;
	int WWHRSnumMixerShowersWithoutBath2;

	double lambda;

	//---------------------------------------------------------
	// Factor for LZCT
	//---------------------------------------------------------
	double B_PV;
	double B_WT;
	double B_uHydro;
	double B_uCHP;
	double annualEnergy_PV;
	double WTsupplyInput;
	double uHydrosupplyInput;
	double uCHPsupplyInput;

	double LZCT_elecDisplaced;
	double LZCT_elecSold;
	double totalElectricalSupply;

	//-------------------------------------------------------
	// LIGHTS GLOBAL VARIABLES
	//-------------------------------------------------------
	double fractionLEL;

	//---------------------------------------------
	// SUMMER OVER HEATING GLOBAL VARIABLES
	//---------------------------------------------
	CString isTMPUserDef;
	double TMPvalue;
	CString TMPIntPartConstruction;
	CString TMPPartyWallConstruction;
	CString isVentUserDefined;
	double airChangeRate;
	CString isCrossVentOnMostFloors;
	CString windowVentilation;
	CString areCurtainsClosedDuringDay;
	double fractCurtainsClosed;
	CString blindCurtainType;
	CString sourceUserDefValues;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	int chkInsulation;
	int chkAirtightness;
	int chkCapacity;
	int chkSolarIngress;
	int chkOccupancy;
	int chkControlledSpace;
	int chkSDHW;
	int chkPV;
	int chkWT;
	int chkuCHP;
	int chkuHydro;
	int chkPCM;
	int chkMVHR;
	int chkFGHRS;
	int chkWWHRS;

	CString hemHouseType;
	CString hemYearOfBuild;

	CString hemCoolingFuel;
	double hemCoolingEff;

	CString hemX_exposure;
	CString hemI_insulation;
	CString hemI_insulation1;
	CString hemI_insulation2;
	CString hemA_ach;
	CString hemC_capacity;
	CString hemS_solarGains;
	CString hemO_occupantDensity;
	CString hemL_livingAreaFraction;
	CString hemXIACSOL_string;
	CString hemXIACSOL_string1;
	CString hemXIACSOL_string2;
	double hemx_1;
	double hemx_2;
	double hemy_1;
	double hemy_2;
	double hemTFA;

	int hemI_insulationSliderPos;
	int hemA_achSliderPos;
	int hemC_capacitySliderPos;
	int hemS_solarGainsSliderPos;
	int hemO_OCCDensitySliderPos;
	int hemL_LAFracSliderPos;

	double iStat;
	double dwellingVoulme;
	double SFP;
	double auxillaryElectricity;

	double numOfOccupants;
	double TFA;
	double TFAfromHEM;
	double EB;
	double C1;
	double ZL;
	double gL;
	double GL_total;
	double C2;
	double lightElectricity;

	double Vd_avg;
	double DHW_energy;
	double distributionLoss;
	double winterOpTemp;
	double tempFactor;
	double storageLoss;
	double lossFactor;
	double tankVolume;
	double volumeFacor;
	double heatLossFactor;
	double srorageLoss;
	double primaryCircuitLoss;
	double F_u;
	double combiLoss;
	double solarDHWInput;

	double pvSupplyInput;

	double domesticHotWaterSupply;
	double spaceHeatingDemand;
	double totalRenElecSupply;
	double totalRenElecSupply_fuelCost;
	double totalRenElecSupply_Emm;
	double totalRenElecSupply_PrimEnergyFactor;

	int enterYValue;

	double mainSpaceHtSupply;
	double secSpaceHtSupply;
	double totalSpaceHtSupply;
	double totalSpaceCoolingSupply ;

	double totalEnergy;
	double totalCost;
	double totalEmissions;
	double totalPrimaryEnergy;

	double mainSpaceHtSupply_fuelCost;
	double secSpaceHtSupply_fuelCost;
	double domesticHotWaterSupply_fuelCost;
	double auxillaryElectricity_fuelCost;
	double lightElectricity_fuelCost;
	double totalSpaceCoolingSupply_fuelCost;
	double LZCTelecSold_fuelCost;
	double LZCTelecDisp_fuelCost;
	double primaryFuelUsed_fuelCost;
	double secFuelUsed_fuelCost;

	double mainSpaceHtSupply_Emm;
	double secSpaceHtSupply_Emm;
	double domesticHotWaterSupply_Emm;
	double auxillaryElectricity_Emm;
	double lightElectricity_Emm;
	double totalSpaceCoolingSupply_Emm;
	double LZCTelecSold_Emm;
	double LZCTelecDisp_Emm;
	double primaryFuelUsed_Emm;
	double secFuelUsed_Emm;


	double mainSpaceHtSupply_PrimEnergyFactor;
	double secSpaceHtSupply_PrimEnergyFactor;
	double domesticHotWaterSupply_PrimEnergyFactor;
	double auxillaryElectricity_PrimEnergyFactor;
	double lightElectricity_PrimEnergyFactor;
	double totalSpaceCoolingSupply_PrimEnergyFactor;
	double LZCTelecSold_PrimEnergyFactor;
	double LZCTelecDisp_PrimEnergyFactor;

	double totalSpaceHtSupply_Disp;
	double totalSpaceCoolingSupply_Disp;
	double domesticHotWaterSupply_Disp;
	double lightElectricity_Disp;
	double auxillaryElectricity_Disp;
	double totalElectricalSupply_Disp;
	double mainSpaceHtSupply_Disp;
	double secSpaceHtSupply_Disp;
	double primaryFuelUsed_Disp;
	double secFuelUsed_Disp;
	double LZCTelecSold_Disp;
	double LZCTelecDisp_Disp;
	//double primaryFuelUsed_Disp;
	//double secFuelUsed_Disp;

	//---------------------------------------------
	// GLOBAL VARIABLES FOR TC ID
	//---------------------------------------------
	// Create index number to read data from frdb.csv file
	CString X_exposure;
	CString I_insulation;
	CString I_insulation1;
	CString I_insulation2;
	CString A_ach;
	CString A_ach_MVHR1;
	CString A_ach_MVHR2;
	CString C_capacity;
	CString S_solarGains;
	CString O_occupantDensity;
	CString L_livingAreaFraction;
	CString XIACSOL_string;
	CString XIACSOL_string1;
	CString XIACSOL_string2;
	double x_1;
	double x_2;
	double y_1;
	double y_2;

	// String for user display
	CString XIACSOL_string_disp;
	CString XIACSOL_string_disp1;
	CString XIACSOL_string_disp2;

	//---------------------------------
	// Living room fraction limits
	double L_limit1;
	double L_limit2;
	double L_limit3;
	double L_limit4;
	double L_limit5;

	//---------------------------------
	// Living room fraction range
	double L_range1;
	double L_range2;
	double L_range3;
	double L_range4;
	double L_range5;

	//---------------------------------
	// Occupant density limits
	double O_limit1;
	double O_limit2;
	double O_limit3;
	double O_limit4;
	double O_limit5 ;

	//---------------------------------
	// Occupant density range
	double O_range1;
	double O_range2;
	double O_range3;
	double O_range4;
	double O_range5;

	//---------------------------------
	// Solar gains limits
	double S_limit1;
	double S_limit2;
	double S_limit3;

	//---------------------------------
	// Solar gains range
	double S_range1;
	double S_range2;
	double S_range3;

	//---------------------------------
	// Capacity limit
	double C_limit;

	//---------------------------------
	// Air change per hour limits
	double A_limit1;
	double A_limit2;
	double A_limit3;
	double A_limit4;
	double A_limit5;

	//---------------------------------
	// Air change per hour range
	double A_range1;
	double A_range2;
	double A_range3;
	double A_range4;
	double A_range5;

	//---------------------------------
	// Insulation limits
	double I_limit1;
	double I_limit2;
	double I_limit3;
	double I_limit4;
	double I_limit5;

	//---------------------------------
	// Insulation range 
	double I_range1;
	double I_range2;
	double I_range3;
	double I_range4;
	double I_range5;

	//---------------------------------
	// Exposure limits 
	double X_limit1;
	double X_limit2;
	double X_limit3;
	double X_limit4;
	double X_limit5;

	//---------------------------------
	// Exposure range 
	double X_range1;
	double X_range2;
	double X_range3;
	double X_range4;
	double X_range5;

	//---------------------------------
	// Misc variables used in ach calc
	int numOfChimneys_multip ;
	int	numOfFlues_multip  ;
	int	numOfFansPassVents_multip ;
	int	numOfFluelessGasFires_multip;
	double total_solarGains;

	int numOfChimneys_m3perh ;
	int	numOfFlues_m3perh ;
	int	numOfFansPassVents_m3perh;
	int	numOfFluelessGasFires_m3perh ;
};

//--------------------------------------------------------
// Create three members of SAPPvariables structure for
// base, improvement1, improvement2, improvement3,
// improvement4 and improvement5
//--------------------------------------------------------
struct SAPPvariables SHCSfile;
struct SAPPvariables current;
struct SAPPvariables base;
struct SAPPvariables imp1;
struct SAPPvariables imp2;
struct SAPPvariables imp3;
struct SAPPvariables imp4;
struct SAPPvariables imp5;


//void PrettyPrintNumbers(double srcValue, char *destStr )
//{
//	// Convert the number into a string
//	// Copy this string char by char into another buffer starting from the last
//	// digit - BUT - after every third character, insert a comma
//	int i = 0; 
//	int size = 0;
//	string number;
//	ostringstream sstrm;
//
//	string number2;
//	number = "1000000";
//
//	sstrm << number ;
//
//    // sstrm now has now the number in string format. Convert this to a
//    // std::string now
//    string str = sstrm.str();
//
//    // Now we will use the 'insert' method of str     
//	size = str.size();
//	if(size>=4 && size<=6)
//	{
//		for ( i=size-3; i>0; i = i-3 )
//		{
//			str.insert(i, 1, ',');
//			number2 = str;
//		}
//	}
//	else if(size>=7 && size<=9)
//	{
//		for ( i=size-3; i>0; i = i-3 )
//		{
//			str.insert(i, 1, ',');
//			number2 = str;
//		}
//	}
//
//    /*for ( i=size-3; i>0; i = i-3 )
//    {
//        str.insert(i, 1, ',');
//		number2 = str;
//    }*/
//}

void SaveEstate()
{
	// 1. Save dialog should come up asking user of estate name
	// 2. Save file name, case and number of dwellings in a csv file

	CString estateFileNameAndLocation;

	// Open file save dialog
	//--------------------------------------------------------------------
	// Save dialog to save the project name
	// Warn user not to change the directory
	CFileDialog m_idFile( false, "estate", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, // false to save
		"Estate files (*.est)|*.est|", AfxGetMainWnd());
	m_idFile.m_ofn.lpstrInitialDir = "..\\estate"; // default directory os one step up the executable

	// If user choses to Save File..
	if (m_idFile.DoModal()==IDOK)
	{
		estateFileNameAndLocation     = m_idFile.GetPathName();
	}
	else
	{
		return;
	}

	unsigned int i = 0;	
	FILE *fptr;		

	fptr = fopen(estateFileNameAndLocation,"w");

	// Print titles for data
	fprintf(fptr,"%s\n",versionText);
	fprintf(fptr,"%s,%s,%s,%s,%s\n","File location", "File name", "File name no ext","case added to estate","number of dwellings");
    
	i = EstateDataValues.size();
	for( i=0; i < EstateDataValues.size(); i++)
	{
		fprintf(fptr,"%s,%s,%s,%s,%d\n",EstateDataValues[i].projectFileName,EstateDataValues[i].projectFileNameNoPath,EstateDataValues[i].projectFileNameNoExt, EstateDataValues[i].caseOfDwellings, EstateDataValues[i].numOfDwellings );      
	}
	fclose(fptr);
}


void CopyCurrentToBase()
{	
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	base.JobDetRefNum     = JobDetRefNum;
	base.assessorName     = assessorName;
	base.JobDetComments   = JobDetComments;
	base.propertyFlatNameorNum = propertyFlatNameorNum;
	base.propertyLetter   = propertyLetter;
	base.propertyHouseNum = propertyHouseNum;
	base.propertyStreet   = propertyStreet;
	base.propertyLocality = propertyLocality;
	base.propertyDistrict = propertyDistrict;
	base.propertyTown     = propertyTown;
	base.propertyCounty   = propertyCounty;
	base.propertyPostCode = propertyPostCode;
	base.clientFlatNameorNum = clientFlatNameorNum;
	base.clientLetter     = clientLetter;
	base.clientHouseorBlockNum = clientHouseorBlockNum;
	base.clientStreet     = clientStreet;
	base.clientLocality   = clientLocality;
	base.clientDistrict   = clientDistrict;
	base.clientTown       = clientTown;
	base.clientCounty     = clientCounty;
	base.clientPostCode   = clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	base.locationString = locationString;

	base.dwellingType = dwellingType;
	base.builtForm = builtForm;
	base.Detachment = Detachment;
	base.FlatPosition =FlatPosition;
	base.dwellingTerrain =dwellingTerrain;

	base.storey1Level = storey1Level;
	base.storey2Level = storey2Level;
	base.storey3Level = storey3Level;
	base.storey4Level = storey4Level;
	base.storey5Level = storey5Level;
	base.storey6Level = storey6Level;
	base.dwellingShelteredSides = dwellingShelteredSides;
	base.yearPropertBuilt =yearPropertBuilt; 

	base.storey1 = storey1;
	base.storey2 = storey2;
	base.storey3 = storey3;
	base.storey4 = storey4;
	base.storey5 = storey5;
	base.storey6 = storey6;

	base.storey1Basement = storey1Basement;
	base.storey2Basement = storey2Basement;
	base.storey3Basement = storey3Basement;
	base.storey4Basement = storey4Basement;
	base.storey5Basement = storey5Basement;
	base.storey6Basement = storey6Basement;

	base.storey1Area = storey1Area;
	base.storey2Area = storey2Area;
	base.storey3Area = storey3Area;
	base.storey4Area = storey4Area;
	base.storey5Area = storey5Area;
	base.storey6Area = storey6Area;

	base.storey1Height = storey1Height;
	base.storey2Height = storey2Height;
	base.storey3Height = storey3Height;
	base.storey4Height = storey4Height;
	base.storey5Height = storey5Height;
	base.storey6Height = storey6Height;

	base.TFAfromHEM = TFAfromHEM;

	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	base.winOvershading = winOvershading;
	base.winGlazing     = winGlazing;

	base.totalGlzArea = totalGlzArea;
	base.winNArea	= winNArea;
	base.winNEArea	= winNEArea;
	base.winEArea	= winEArea;
	base.winSEArea	= winSEArea;
	base.winSArea	= winSArea;
	base.winSWArea	= winSWArea;
	base.winWArea	= winWArea;
	base.winNWArea	= winNWArea;
	base.rooflightsArea = rooflightsArea;

	base.winNSolTrans	= winNSolTrans;
	base.winNESolTrans	= winNESolTrans;
	base.winESolTrans	= winESolTrans;
	base.winSESolTrans	= winSESolTrans;
	base.winSSolTrans	= winSSolTrans;
	base.winSWSolTrans	= winSWSolTrans;
	base.winWSolTrans	= winWSolTrans;
	base.winNWSolTrans	= winNWSolTrans;
	base.rooflightsSolTrans = rooflightsSolTrans;

	base.winNFrameFactor	= winNFrameFactor;
	base.winNEFrameFactor	= winNEFrameFactor;
	base.winEFrameFactor	= winEFrameFactor;
	base.winSEFrameFactor	= winSEFrameFactor;
	base.winSFrameFactor	= winSFrameFactor;
	base.winSWFrameFactor	= winSWFrameFactor;
	base.winWFrameFactor	= winWFrameFactor;
	base.winNWFrameFactor	= winNWFrameFactor;
	base.rooflightsFrameFactor = rooflightsFrameFactor;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	base.grossAreaWall1 = grossAreaWall1;
	base.groosAreaRoof1 = groosAreaRoof1;
	base.netAreaDoors = netAreaDoors;
	base.netAreaWindows = netAreaWindows;
	base.netAreaRoofLights = netAreaRoofLights;
	base.netAreaGF = netAreaGF;
	base.netAreaExFloor = netAreaExFloor;
	base.netAreaWallType1 = netAreaWallType1;
	base.netAreaWallType2 = netAreaWallType2;
	base.netAreaRoofType1 = netAreaRoofType1;
	base.netAreaRoofType2 = netAreaRoofType2;
	base.netAreaPartyWall = netAreaPartyWall;
	base.netAreaPartyFloor = netAreaPartyFloor;
	base.netAreaPartyCeiling = netAreaPartyCeiling;
	base.netAreaInternalWall = netAreaInternalWall;
	base.netAreaInternalFloor = netAreaInternalFloor;
	base.netAreaInternalCeiling = netAreaInternalCeiling;

	base.UvalueDoors = UvalueDoors;
	base.UvalueWindows =UvalueWindows;
	base.UvalueRooflights = UvalueRooflights;
	base.UvalueGF = UvalueGF;
	base.UvalueExposedFloor = UvalueExposedFloor;
	base.UvalueWallType1 = UvalueWallType1;
	base.UvalueWallType2 = UvalueWallType2;
	base.UvalueRoofTYpe1 = UvalueRoofTYpe1;
	base.UvalueRoofType2 = UvalueRoofType2;
	base.UvaluePartyWall = UvaluePartyWall;

	base.kValueGF = kValueGF;
	base.kValueExpFloor = kValueExpFloor;
	base.kValueWallType1 = kValueWallType1;
	base.kValueWallType2 = kValueWallType2;
	base.kValueRoofType1 = kValueRoofType1;
	base.kValueRoofType2 = kValueRoofType2;
	base.kValuePartyWall = kValuePartyWall;
	base.kValuePartyFloor = kValuePartyFloor;
	base.kValuePartyCeiling = kValuePartyCeiling;
	base.kValueIntWall = kValueIntWall;
	base.kValueIntFloor = kValueIntFloor;
	base.kValueIntCeiling = kValueIntCeiling;

	base.thermalMassParameter = thermalMassParameter;
	base.livingRoomFraction = livingRoomFraction;
	base.extAreaSum = extAreaSum;
	base.exposureValue = exposureValue;
	base.extInsulationValue = extInsulationValue;
	base.extUvalueXareaSum = extUvalueXareaSum;
	base.hem_extInsulationValue = hem_extInsulationValue;

	base.hem_extAreaSum = hem_extAreaSum;
	base.hem_extUvalueXareaSum = hem_extUvalueXareaSum;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	base.ThermBGFPerimeter = ThermBGFPerimeter;
	base.ThermBFloorWithingDwellinPerimeter = ThermBFloorWithingDwellinPerimeter;
	base.ThermBFloorBetweenDwellinPerimeter = ThermBFloorBetweenDwellinPerimeter;
	base.ThermBBalconyWithingDwellingLength = ThermBBalconyWithingDwellingLength;
	base.ThermBBalconyBetweenDwellingLength = ThermBBalconyBetweenDwellingLength;
	base.ThermBEavesAtCeiling = ThermBEavesAtCeiling;
	base.ThermBEavesAtRafter = ThermBEavesAtRafter;
	base.ThermBGableAtCeiling = ThermBGableAtCeiling;
	base.ThermBGableAtRafter = ThermBGableAtRafter;
	base.ThermBLengthNormalCorners = ThermBLengthNormalCorners;
	base.ThermBLengthInvertedCorners = ThermBLengthInvertedCorners;
	base.ThermBPartWallBetweenDwelling = ThermBPartWallBetweenDwelling;
	base.yValueEntry = yValueEntry;

	base.ThermBMetalBoxLintelUserDef = ThermBMetalBoxLintelUserDef;
	base.ThermBOtherLintelUserDef =ThermBOtherLintelUserDef;
	base.ThermBSillUserDef = ThermBSillUserDef;
	base.ThermBJambUserDef =ThermBJambUserDef;
	base.ThermBGFPerimeterUserDef = ThermBGFPerimeterUserDef;
	base.ThermBFloorWithinDwellingUserDef = ThermBFloorWithinDwellingUserDef;
	base.ThermBFloorBwDwellingUserDef =  ThermBFloorBwDwellingUserDef;
	base.ThermBBalcWithinDwellingLengthUserDef =ThermBBalcWithinDwellingLengthUserDef;
	base.ThermBBalcBwDwellingLengthUserDef = ThermBBalcBwDwellingLengthUserDef;
	base.ThermBEavesInsAtCeilingUserDef =ThermBEavesInsAtCeilingUserDef;
	base.ThermBEavesInsAtRafterUserDef = ThermBEavesInsAtRafterUserDef;
	base.ThermBGableInsAtCeilingUserDef = ThermBGableInsAtCeilingUserDef;
	base.ThermBGableInsAtRafetUserDef = ThermBGableInsAtRafetUserDef;
	base.ThermBLengthOfNormalCornersUserDef = ThermBLengthOfNormalCornersUserDef;
	base.ThermBLengthOfInvertedCornersUserDef =ThermBLengthOfInvertedCornersUserDef;
	base.ThermBPartWallBetweenDwellingUserDef = ThermBPartWallBetweenDwellingUserDef;

	base.ThermBMetalBoxLintelSiValue = ThermBMetalBoxLintelSiValue;
	base.ThermBOtherLintelsSiValue =ThermBOtherLintelsSiValue;
	base.ThermBSillSiValue = ThermBSillSiValue;
	base.ThermBJambSiValue = ThermBJambSiValue;
	base.ThermBGFPerimeterSiValue = ThermBGFPerimeterSiValue;
	base. ThermBFloorWithinDwellingSiValue =  ThermBFloorWithinDwellingSiValue;
	base.ThermBFloorBetweenDwellingSiValue  =ThermBFloorBetweenDwellingSiValue;
	base.ThermBBalconyWithinDwellingSiValue =ThermBBalconyWithinDwellingSiValue;
	base.ThermBBalconyBwDwellingSiValue =ThermBBalconyBwDwellingSiValue;
	base.ThermBEavesInsAtCelingSiValue =ThermBEavesInsAtCelingSiValue;
	base. ThermBEavesInsAtRafterSiValue =ThermBEavesInsAtRafterSiValue;
	base.ThermBGableInsAtCeilingSiValue =ThermBGableInsAtCeilingSiValue;
	base.ThermBGableInsAtRafterSiValue = ThermBGableInsAtRafterSiValue;
	base.ThermBLengthOfNormalCornersSiValue =ThermBLengthOfNormalCornersSiValue;
	base.ThermBLengthOfInvertedCornersSiValue =ThermBLengthOfInvertedCornersSiValue;
	base.ThermBPartBwDwellingLengthSiValue =ThermBPartBwDwellingLengthSiValue;

	base.ThermBMetalBoxLintelResult = ThermBMetalBoxLintelResult;
	base.ThermBOtherLintelsResult   = ThermBOtherLintelsResult;
	base.ThermBSillResult  =ThermBSillResult;
	base.ThermBJambResult =ThermBJambResult;
	base.ThermBGFPerimeterResult =ThermBGFPerimeterResult;
	base.ThermBFloorWithinDwellingPerimeterResult =ThermBFloorWithinDwellingPerimeterResult;
	base.ThermBFloorBetweenDwellingPerimeterResult  =ThermBFloorBetweenDwellingPerimeterResult;
	base.ThermBBalcWithDwellingLengthResult =ThermBBalcWithDwellingLengthResult;
	base.ThermBBalconyBwDwellingLengthResult = ThermBBalconyBwDwellingLengthResult;
	base.ThermBEavesInsCeilingResult  =ThermBEavesInsCeilingResult;
	base.ThermBEavesInsRafterResult = ThermBEavesInsRafterResult;
	base.ThermBGableInsCeilingResult = ThermBGableInsCeilingResult;
	base.ThermBGableInsRafterResult = ThermBGableInsRafterResult;
	base.ThermBLengthNormalCornersResult = ThermBLengthNormalCornersResult;
	base.ThermBLengthInvertedCornersResult = ThermBLengthInvertedCornersResult;
	base.ThermBPartyWallBwDwellingResult = ThermBPartyWallBwDwellingResult;

	base.thermBridgeYvalue_grossArea = thermBridgeYvalue_grossArea ;
	base.hem_yValueEntry = hem_yValueEntry;

	base.versionText = versionText;
	base.titleBarText = titleBarText;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	base.mechVentType = mechVentType;
	base.pressureTestYN = pressureTestYN ;
	base.structInf = structInf;
	base.floorInf =floorInf;
	base.draughtLobby = draughtLobby;
	base.perWindowDraughtStripped = perWindowDraughtStripped;
	base.designAirPermeability = designAirPermeability;
	base.pressureTestScotland= pressureTestScotland;
	base.accreditedDetailsScotland = accreditedDetailsScotland;
	base.seekExemptionForLT3Dwellings = seekExemptionForLT3Dwellings;

	base.designAirPermRate = designAirPermRate;
	base.asBuiltAirPermRate = asBuiltAirPermRate;

	base.airPermMeasuredInDwelling = airPermMeasuredInDwelling;
	base.asBuiltRef = asBuiltRef;
	base.asBuiltTestDate = asBuiltTestDate;

	base.MVHRThermalEff = MVHRThermalEff;
	base.mechVentValuesFrom = mechVentValuesFrom;
	base.numsWetRooms = numsWetRooms;
	base.ductInsulation = ductInsulation;
	base.numsOpenFirePlaces = numsOpenFirePlaces ;
	base.numsOpenFlues =numsOpenFlues ;
	base.numsFluelessGasFires = numsFluelessGasFires;

	base.numsExtractFans = numsExtractFans;
	base.numsPassiveVents = numsPassiveVents;
	base.isACPresent = isACPresent;
	base.ACEnergyUse = ACEnergyUse;
	base.measuredQ50 = measuredQ50;
	base.numOfStoreys = numOfStoreys;

	base.dewllingVolume = dewllingVolume;
	base.infiltration_rate  = infiltration_rate;
	base.infiltration_rate18 = infiltration_rate18;
	base.shelterFactor = shelterFactor;
	base.infiltrationRateWithshelterFactor = infiltrationRateWithshelterFactor;
	base.infliltrationOpenings = infliltrationOpenings;
	base.additionalInfiltration = additionalInfiltration;
	base.windowInfiltration = windowInfiltration;
	base.numOfShelteredSides = numOfShelteredSides;
	base.totalWindSpeed = totalWindSpeed;
	base.totalWindFactor = totalWindFactor;
	base.effInfiltrationRate = effInfiltrationRate;

	base.achThrougSystem = achThrougSystem;
	base.valueIfExhaustAirHP = valueIfExhaustAirHP;
	base.valueIfBalancedHR = valueIfBalancedHR;

	base.effectiveACH = effectiveACH;
	base.effectiveACH_MVHR = effectiveACH_MVHR;
	base.achMVHR1 = achMVHR1;
	base.achMVHR2 = achMVHR2;

	base.spaceHeatingDemandMVHR1 = spaceHeatingDemandMVHR1;
	base.spaceHeatingDemandMVHR2 = spaceHeatingDemandMVHR2;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	base.primaryFuelUsed = primaryFuelUsed;
    base.secFuelUsed     = secFuelUsed;
	base.primaryFuelUsedString = primaryFuelUsedString;
	base.secFuelUsedString     = secFuelUsedString;
	base.mainFuel = mainFuel;
	base.electricityTarrif = electricityTarrif;
	base.mainHtType =mainHtType;
	base.mainHtEffFrom = mainHtEffFrom;
	base.boilerType = boilerType;
	base.isFanFluePresent = isFanFluePresent;
	base.mainHtControls = mainHtControls;
	base.mainHtEmitter =mainHtEmitter;
	base.isIterlockPresent = isIterlockPresent;
	base.isPumpInHeatedSpace = isPumpInHeatedSpace;
	base.mainHtSystem = mainHtSystem;

	base.boilerRef =boilerRef;
	base.boilerModel = boilerModel;
	base.isSecBoilerFuelPresent= isSecBoilerFuelPresent;
	base.mainHtCompensator = mainHtCompensator;
	base.mainHtManufacturerDesc =mainHtManufacturerDesc;
	base.mainHtTestMethod = mainHtTestMethod;

	base.mainHtEff = mainHtEff;
	base.mainHtEffNominal = mainHtEffNominal; //@min

	base.mainHtEffAdj = mainHtEffAdj;
	base.mainHtTempAdj = mainHtTempAdj;
	base.mainHtFractionSupplied = mainHtFractionSupplied;

	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	base.oilPumpInHeatedSpace = oilPumpInHeatedSpace;
	base.oilBoilerInstalled   = oilBoilerInstalled;

	base.isThereCHP = isThereCHP;
	base.CHPfuel = CHPfuel;
	base.CPSUoperatingTemp = CPSUoperatingTemp;

	base.heatEmmFromCase = heatEmmFromCase;
	base.heatTransferredToWater = heatTransferredToWater;
	base.smokeControlledArea = smokeControlledArea;

	base.fractOfHtFromCHP = fractOfHtFromCHP;
	base.elecEffOfCHP = elecEffOfCHP;
	base.heatingEffOfCHP = heatingEffOfCHP;

	base.secComBoilerFuel = secComBoilerFuel;
	base.secComBoilerSystem = secComBoilerSystem;
	base.secComBoilerEff = secComBoilerEff;
	base.secComBoilerFractOfHtFromBoiler2 = secComBoilerFractOfHtFromBoiler2;
	base.secComBoilerManufactDesc = secComBoilerManufactDesc;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	base.isThereSecHeating = isThereSecHeating;
	base.secHtEffFrom = secHtEffFrom;
	base.secHtFuel = secHtFuel;

	base.secHtOpenFlueChimney = secHtOpenFlueChimney;
	base.secHtUnconnectedGasPoint = secHtUnconnectedGasPoint;
	base.secHtSystem = secHtSystem;
	base.secHtManufactDesc =secHtManufactDesc;
	base.secHtTestMethod = secHtTestMethod;
	base.secHtEff = secHtEff;
	base.secHtFraction = secHtFraction;

	base.spaceHeatingEffAdj = spaceHeatingEffAdj;
	base.waterHeatingEffAdj = waterHeatingEffAdj;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	base.btnWaterHtFromMainState = btnWaterHtFromMainState;
	base.WHtype = WHtype;
	base.WHtCylinderWithinDwelling = WHtCylinderWithinDwelling ;
	base.WHtFuel = WHtFuel;
	base.WHtWaterSepTimed = WHtWaterSepTimed;

	base.WHtCylManufactLossFactor = WHtCylManufactLossFactor;
	base.WHtCylInsType = WHtCylInsType;

	base.WHtCylThermostat = WHtCylThermostat;
	base.WHtCylInHeatedSpace = WHtCylInHeatedSpace;
	base.WHtCylPrimaryPipeworkInsulated = WHtCylPrimaryPipeworkInsulated;
	base.WHtCylPumpedPrimarySystem = WHtCylPumpedPrimarySystem;

	base.WHtTSnCPSUinSingleUnit = WHtTSnCPSUinSingleUnit;
	base.WHtTSnCPSUPrimaryPipeworkLT1_5m = WHtTSnCPSUPrimaryPipeworkLT1_5m;
	base.WHtTSnCPSUstoreInAirCupbrd = WHtTSnCPSUstoreInAirCupbrd;

	base.WHtCombiKeepHotYN = WHtCombiKeepHotYN;
	base.DHWfromCommunityScheme =DHWfromCommunityScheme;
	base.DHWComSchemeSystem = DHWComSchemeSystem;
	base.WHtHeatPumpUsesImmer = WHtHeatPumpUsesImmer;

	base.WHtUsesSummerImmer = WHtUsesSummerImmer;
	
	base.WHtCylDeclaredFactor =WHtCylDeclaredFactor;
	base.WHtCylVolume = WHtCylVolume;
	base.WHtCylInsThickness =  WHtCylInsThickness;

	base.WHtEff = WHtEff;
	base.WHtEffAdj = WHtEffAdj;

	base.WHtCombiKeepHotUsesElec = WHtCombiKeepHotUsesElec;
	base.WHtCombiPowerRating = WHtCombiPowerRating;

	base.DHWComSchemeProvidedFrom = DHWComSchemeProvidedFrom;
	base.DHWComSchemeCHP2PowerRatio = DHWComSchemeCHP2PowerRatio;
	base.DHWComSchemeEff = DHWComSchemeEff;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	base.isSHWPresent = isSHWPresent;
	base.isPVPresent  = isPVPresent;
	base.isWTPresent  = isWTPresent;
	base.uHydroyn = uHydroyn;
	base.uCHPyn = uCHPyn;
	base.MVHRyn = MVHRyn;

	base.SHWCollectorType = SHWCollectorType;
	base.SHWCollectorOrientation = SHWCollectorOrientation;
	base.SHWCollectorTilt = SHWCollectorTilt;
	base.SHWOvershading = SHWOvershading;
	base.isSHWAreaGross = isSHWAreaGross;
	base.isSHWSolarStoreCombined = isSHWSolarStoreCombined;
	base.SHWSolarCircPump = SHWSolarCircPump;
	base.SHWApertureArea = SHWApertureArea;
	base.SHW_ZLCE = SHW_ZLCE;
	base.SHW_HeatLossCoefficient =SHW_HeatLossCoefficient;
	base.SHW_dedicatedSolarStorageVolumeFactor =SHW_dedicatedSolarStorageVolumeFactor;

	base.PVCollectorOrientation = PVCollectorOrientation;
	base.PVCollectorTilt = PVCollectorTilt;
	base.PVOvershading = PVOvershading;
	base.dwellingExposure = dwellingExposure;
	base.CHPFuel = CHPFuel;

	base.SHW_overshadingFactor = SHW_overshadingFactor;
	base.SHW_annualSolarRadiation_pm2 = SHW_annualSolarRadiation_pm2 ;
	base.SHW_collectorPerformanceRatio = SHW_collectorPerformanceRatio;
	base.SHW_solarEnergyAvailable =SHW_solarEnergyAvailable;
	base.SHW_apertureArea =SHW_apertureArea;

	base.SHW_solarToLoadRatio = SHW_solarToLoadRatio;
	base.SHW_collectorPerformanceFactor =SHW_collectorPerformanceFactor;
	base.SHW_effectiveSolarVolume =SHW_effectiveSolarVolume;
	base.SHW_utilizationFactor = SHW_utilizationFactor;
	base.N_OCC = N_OCC;
	base.SHW_annualHotWaterUsage = SHW_annualHotWaterUsage;
	base.SHW_dailyHotWaterDemand_litres = SHW_dailyHotWaterDemand_litres;
	base.SHW_volumeRatio = SHW_volumeRatio;
	base.SHW_annualSolarInput = SHW_annualSolarInput;
	base.SHWDedSolStoreVol =SHWDedSolStoreVol;

	base.isRENAdditionalElectGenerated = isRENAdditionalElectGenerated;
	base.RENAddiationalElecGenerated = RENAddiationalElecGenerated ;
	base.REN_TFA = REN_TFA;

	base.installedPVPeakPower = installedPVPeakPower;
	base.PV_overshadingFactor = PV_overshadingFactor;
	base.PV_annualSolarRadiation_pm2 = PV_annualSolarRadiation_pm2 ;

	base.WTNumOf = WTNumOf;
	base.WTDiameter = WTDiameter;
	base.WTHeight =WTHeight;
	base.WTs3 = WTs3;

	//---------------------------------------------------------
	// RENEWABLES 2
	//---------------------------------------------------------
	base.uHydroAnnualAvgHead = uHydroAnnualAvgHead;
	base.uHydroAnnualAvgFlow = uHydroAnnualAvgFlow;
	base.uHydroEff = uHydroEff;
	base.uHydroAnnualEnergy = uHydroAnnualEnergy;

	base.uCHPheatToPowerRatio = uCHPheatToPowerRatio;
	base.uCHPElectricEff = uCHPElectricEff;
	base.uCHPHeatingEff = uCHPHeatingEff;
	base.uCHPHeatingFraction= uCHPHeatingFraction;
	base.uCHPAnnualElectricity = uCHPAnnualElectricity;
	base.MVHRThermalEff = MVHRThermalEff;
	base.lambda = lambda;

	base.FGHRSpresent               = FGHRSpresent;
	base.FGHRSstore               = FGHRSstore;
	base.FGHRSstoreVolume         = FGHRSstoreVolume;
	base.FGHRSusefulFracHtRec_kf1 = FGHRSusefulFracHtRec_kf1;
	base.FGHRSfittedMain          = FGHRSfittedMain;
	base.FGHRSfittedSec			  = FGHRSfittedSec;
	base.FGHRStype                = FGHRStype;
	base.determineFGHRStype       = determineFGHRStype;
	base.FGHRStotFracHeatRec_kf2  = FGHRStotFracHeatRec_kf2;
	base.FGHRSauxelec             = FGHRSauxelec;
	base.FGHRSpvPoweredHt         = FGHRSpvPoweredHt;
	base.FGHRSpvPkPower           = FGHRSpvPkPower;
	base.FGHRSpvOrientation     = FGHRSpvOrientation;
	base.FGHRSpvTilt              = FGHRSpvTilt;
	base.FGHRSpvOvershading       = FGHRSpvOvershading;
	base.FGHRScableLoss           = FGHRScableLoss;

	base.WWHRSpresent    = WWHRSpresent;
	base.WWHRSnumOfRooms = WWHRSnumOfRooms;
	base.WWHRS1Make      = WWHRS1Make;
	base.WWHRSnumMixerShowersWithBath1    = WWHRSnumMixerShowersWithBath1;
	base.WWHRSnumMixerShowersWithoutBath1 = WWHRSnumMixerShowersWithoutBath1;
	base.WWHRS1Model = WWHRS1Model;
	base.WWHRS1ModelQualifier = WWHRS1ModelQualifier;
	
	base.WWHRS2Make                       = WWHRS2Make;
	base.WWHRSnumMixerShowersWithBath2    = WWHRSnumMixerShowersWithBath2;
	base.WWHRSnumMixerShowersWithoutBath2 = WWHRSnumMixerShowersWithoutBath2;
	base.WWHRS2Model                      = WWHRS2Model;
	base.WWHRS2ModelQualifier             = WWHRS2ModelQualifier;

	//---------------------------------------------------------
	// Factor for LZCT
	//---------------------------------------------------------
	base.B_PV = B_PV;
	base.B_WT = B_WT;
	base.B_uHydro = B_uHydro;
	base.B_uCHP = B_uCHP;
	base.annualEnergy_PV = annualEnergy_PV;
	base.WTsupplyInput = WTsupplyInput;
	base.uHydrosupplyInput =uHydrosupplyInput;
	base.uCHPsupplyInput = uCHPsupplyInput;

	base.LZCT_elecDisplaced = LZCT_elecDisplaced;
	base.LZCT_elecSold =LZCT_elecSold;
	base.totalElectricalSupply = totalElectricalSupply;

	//-------------------------------------------------------
	// LIGHTS GLOBAL VARIABLES
	//-------------------------------------------------------
	base.fractionLEL =fractionLEL;

	//---------------------------------------------
	// SUMMER OVER HEATING GLOBAL VARIABLES
	//---------------------------------------------
	base.isTMPUserDef = isTMPUserDef;
	base.TMPvalue =  TMPvalue;
	base.TMPIntPartConstruction=TMPIntPartConstruction;
	base.TMPPartyWallConstruction=TMPPartyWallConstruction;
	base.isVentUserDefined=isVentUserDefined;
	base.airChangeRate=airChangeRate;
	base.isCrossVentOnMostFloors=isCrossVentOnMostFloors;
	base.windowVentilation=windowVentilation;
	base.areCurtainsClosedDuringDay=areCurtainsClosedDuringDay;
	base.fractCurtainsClosed=fractCurtainsClosed;
	base.blindCurtainType=blindCurtainType;
	base.sourceUserDefValues=sourceUserDefValues;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	base.chkInsulation  = chkInsulation;
	base.chkAirtightness = chkAirtightness;
	base.chkCapacity = chkCapacity;
	base.chkSolarIngress =chkSolarIngress;
	base.chkOccupancy = chkOccupancy;
	base.chkControlledSpace= chkControlledSpace;
	base.chkSDHW=chkSDHW;
	base.chkPV=chkPV;
	base.chkWT=chkWT;
	base.chkuCHP=chkuCHP;
	base.chkuHydro=chkuHydro;
	base.chkPCM=chkPCM;
	base.chkMVHR=chkMVHR;
	base.chkFGHRS = chkFGHRS;
	base.chkWWHRS = chkWWHRS;

	base.hemHouseType=hemHouseType;
	base.hemYearOfBuild=hemYearOfBuild;
	base.hemCoolingFuel=hemCoolingFuel;
	base.hemCoolingEff=hemCoolingEff;

	base.hemX_exposure=hemX_exposure;
	base.hemI_insulation=hemI_insulation;
	base.hemI_insulation1=hemI_insulation1;
	base.hemI_insulation2=hemI_insulation2;
	base.hemA_ach=hemA_ach;
	base.hemC_capacity=hemC_capacity;
	base.hemS_solarGains=hemS_solarGains;
	base.hemO_occupantDensity=hemO_occupantDensity;
	base.hemL_livingAreaFraction=hemL_livingAreaFraction;
	base.hemXIACSOL_string=hemXIACSOL_string;
	base.hemXIACSOL_string1=hemXIACSOL_string1;
	base.hemXIACSOL_string2=hemXIACSOL_string2;
	base.hemx_1 =hemx_1;
	base.hemx_2 =hemx_2;
	base.hemy_1 = hemy_1;
	base.hemy_2 =hemy_2;
	base.hemTFA =hemTFA;

	base.hemI_insulationSliderPos = hemI_insulationSliderPos;
	base.hemA_achSliderPos = hemA_achSliderPos;
	base.hemC_capacitySliderPos =hemC_capacitySliderPos;
	base.hemS_solarGainsSliderPos = hemS_solarGainsSliderPos;
	base.hemO_OCCDensitySliderPos=hemO_OCCDensitySliderPos;
	base.hemL_LAFracSliderPos=hemL_LAFracSliderPos;

	base.iStat=iStat;
	base.dwellingVoulme=dwellingVoulme;
	base.SFP=SFP;
	base.auxillaryElectricity=auxillaryElectricity;

	base.numOfOccupants=numOfOccupants;
	base.TFA=TFA;
	base.TFAfromHEM=TFAfromHEM;
	base.EB=EB;
	base.C1=C1;
	base.ZL=ZL;
	base.gL=gL;
	base.GL_total=GL_total;
	base.C2=C2;
	base.lightElectricity=lightElectricity;

	base.Vd_avg=Vd_avg;
	base.DHW_energy=DHW_energy;
	base.distributionLoss=distributionLoss;
	base.winterOpTemp=winterOpTemp;
	base.tempFactor=tempFactor;
	base.storageLoss=storageLoss;
	base.lossFactor=lossFactor;
	base.tankVolume=tankVolume;
	base.volumeFacor=volumeFacor;
	base.heatLossFactor=heatLossFactor;
	base.srorageLoss=srorageLoss;
	base.primaryCircuitLoss=primaryCircuitLoss;
	base.F_u=F_u;
	base.combiLoss=combiLoss;
	base.solarDHWInput=solarDHWInput;

	base.pvSupplyInput=pvSupplyInput;

	base.domesticHotWaterSupply=domesticHotWaterSupply;
	base.spaceHeatingDemand=spaceHeatingDemand;
	base.totalRenElecSupply=totalRenElecSupply;
	base.totalRenElecSupply_fuelCost = totalRenElecSupply_fuelCost;
	base.totalRenElecSupply_Emm=totalRenElecSupply_Emm;
	base.totalRenElecSupply_PrimEnergyFactor=totalRenElecSupply_PrimEnergyFactor;

	base.enterYValue=enterYValue;
	base.mainSpaceHtSupply=mainSpaceHtSupply;
	base.secSpaceHtSupply=secSpaceHtSupply;
	base.totalSpaceHtSupply=totalSpaceHtSupply;
	base.totalSpaceCoolingSupply=totalSpaceCoolingSupply;

	base.totalEnergy=totalEnergy;
	base.totalCost=totalCost;
	base.totalEmissions=totalEmissions;
	base.totalPrimaryEnergy=totalPrimaryEnergy;
	

	base.mainSpaceHtSupply_fuelCost=mainSpaceHtSupply_fuelCost;
	base.secSpaceHtSupply_fuelCost=secSpaceHtSupply_fuelCost;
	base.domesticHotWaterSupply_fuelCost=domesticHotWaterSupply_fuelCost;
	base.auxillaryElectricity_fuelCost=auxillaryElectricity_fuelCost;
	base.lightElectricity_fuelCost=lightElectricity_fuelCost;
	base.totalSpaceCoolingSupply_fuelCost=totalSpaceCoolingSupply_fuelCost;
	
	base.mainSpaceHtSupply_Emm=mainSpaceHtSupply_Emm;
	base.secSpaceHtSupply_Emm=secSpaceHtSupply_Emm;
	base.domesticHotWaterSupply_Emm=domesticHotWaterSupply_Emm;
	base.auxillaryElectricity_Emm=auxillaryElectricity_Emm;
	base.lightElectricity_Emm=lightElectricity_Emm;
	base.totalSpaceCoolingSupply_Emm=totalSpaceCoolingSupply_Emm;
	
	base.mainSpaceHtSupply_PrimEnergyFactor=mainSpaceHtSupply_PrimEnergyFactor;
	base.secSpaceHtSupply_PrimEnergyFactor=secSpaceHtSupply_PrimEnergyFactor;
	base.domesticHotWaterSupply_PrimEnergyFactor=domesticHotWaterSupply_PrimEnergyFactor;
	base.auxillaryElectricity_PrimEnergyFactor=auxillaryElectricity_PrimEnergyFactor;
	base.lightElectricity_PrimEnergyFactor=lightElectricity_PrimEnergyFactor;
	base.totalSpaceCoolingSupply_PrimEnergyFactor = totalSpaceCoolingSupply_PrimEnergyFactor;

	base.totalSpaceHtSupply_Disp		= totalSpaceHtSupply_Disp;
	base.totalSpaceCoolingSupply_Disp	=  totalSpaceCoolingSupply_Disp;
	base.domesticHotWaterSupply_Disp	= domesticHotWaterSupply_Disp;
	base.lightElectricity_Disp			= lightElectricity_Disp;
	base.auxillaryElectricity_Disp		= auxillaryElectricity_Disp;
	base.totalElectricalSupply_Disp		= totalElectricalSupply_Disp;
	base.mainSpaceHtSupply_Disp			= mainSpaceHtSupply_Disp;
	base.secSpaceHtSupply_Disp			= secSpaceHtSupply_Disp;
	base.LZCTelecSold_Disp				= LZCTelecSold_Disp;
	base.LZCTelecDisp_Disp				= LZCTelecDisp_Disp;
	
	base.primaryFuelUsed_Disp		= primaryFuelUsed_Disp;
	base.secFuelUsed_Disp			= secFuelUsed_Disp;
	base.primaryFuelUsed			= primaryFuelUsed;	
	base.secFuelUsed				= secFuelUsed;
	base.primaryFuelUsed_fuelCost   = primaryFuelUsed_fuelCost;	
	base.secFuelUsed_fuelCost       = secFuelUsed_fuelCost;
	base.primaryFuelUsed_Emm        = primaryFuelUsed_Emm;
	base.secFuelUsed_Emm            = secFuelUsed_Emm;
	
	//---------------------------------------------
	// GLOBAL VARIABLES FOR TC ID
	//---------------------------------------------
	// Create index number to read data from frdb.csv file
	base.X_exposure=X_exposure;
	base.I_insulation=I_insulation;
	base.I_insulation1=I_insulation1;
	base.I_insulation2=I_insulation2;
	base.A_ach=A_ach;
	base.A_ach_MVHR1=A_ach_MVHR1;
	base.A_ach_MVHR2=A_ach_MVHR2;
	base.C_capacity=C_capacity;
	base.S_solarGains = S_solarGains;
	base.O_occupantDensity=O_occupantDensity;
	base.L_livingAreaFraction =L_livingAreaFraction;
	base.XIACSOL_string  = XIACSOL_string;
	base.XIACSOL_string1 = XIACSOL_string1;
	base.XIACSOL_string2 = XIACSOL_string2;
	base.x_1 = x_1;
	base.x_2 = x_2;
	base.y_1 = y_1;
	base.y_2 = y_2;

	// String for user display
	base.XIACSOL_string_disp = XIACSOL_string_disp;
	base.XIACSOL_string_disp1 = XIACSOL_string_disp1;
	base.XIACSOL_string_disp2 = XIACSOL_string_disp2;

	//---------------------------------
	// Misc variables used in ach calc
	base.numOfChimneys_multip = numOfChimneys_multip;
	base.numOfFlues_multip =numOfFlues_multip ;
	base.numOfFansPassVents_multip =numOfFansPassVents_multip;
	base.numOfFluelessGasFires_multip=numOfFluelessGasFires_multip;
	base.total_solarGains=total_solarGains;

	base.numOfChimneys_m3perh = numOfChimneys_m3perh ;
	base.numOfFlues_m3perh =numOfFlues_m3perh;
	base.numOfFansPassVents_m3perh=numOfFansPassVents_m3perh;
	base.numOfFluelessGasFires_m3perh =numOfFluelessGasFires_m3perh ;	
}
void CopyVariablesToCurrentClass()
{	
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	current.JobDetRefNum     = JobDetRefNum;
	current.assessorName     = assessorName;
	current.JobDetComments   = JobDetComments;
	current.propertyFlatNameorNum = propertyFlatNameorNum;
	current.propertyLetter   = propertyLetter;
	current.propertyHouseNum = propertyHouseNum;
	current.propertyStreet   = propertyStreet;
	current.propertyLocality = propertyLocality;
	current.propertyDistrict = propertyDistrict;
	current.propertyTown     = propertyTown;
	current.propertyCounty   = propertyCounty;
	current.propertyPostCode = propertyPostCode;
	current.clientFlatNameorNum = clientFlatNameorNum;
	current.clientLetter     = clientLetter;
	current.clientHouseorBlockNum = clientHouseorBlockNum;
	current.clientStreet     = clientStreet;
	current.clientLocality   = clientLocality;
	current.clientDistrict   = clientDistrict;
	current.clientTown       = clientTown;
	current.clientCounty     = clientCounty;
	current.clientPostCode   = clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	current.locationString = locationString;

	current.dwellingType = dwellingType;
	current.builtForm = builtForm;
	current.Detachment = Detachment;
	current.FlatPosition =FlatPosition;
	current.dwellingTerrain =dwellingTerrain;

	current.storey1Level = storey1Level;
	current.storey2Level = storey2Level;
	current.storey3Level = storey3Level;
	current.storey4Level = storey4Level;
	current.storey5Level = storey5Level;
	current.storey6Level = storey6Level;
	current.dwellingShelteredSides = dwellingShelteredSides;
	current.yearPropertBuilt =yearPropertBuilt; 

	current.storey1 = storey1;
	current.storey2 = storey2;
	current.storey3 = storey3;
	current.storey4 = storey4;
	current.storey5 = storey5;
	current.storey6 = storey6;

	current.storey1Basement = storey1Basement;
	current.storey2Basement = storey2Basement;
	current.storey3Basement = storey3Basement;
	current.storey4Basement = storey4Basement;
	current.storey5Basement = storey5Basement;
	current.storey6Basement = storey6Basement;

	current.storey1Area = storey1Area;
	current.storey2Area = storey2Area;
	current.storey3Area = storey3Area;
	current.storey4Area = storey4Area;
	current.storey5Area = storey5Area;
	current.storey6Area = storey6Area;

	current.storey1Height = storey1Height;
	current.storey2Height = storey2Height;
	current.storey3Height = storey3Height;
	current.storey4Height = storey4Height;
	current.storey5Height = storey5Height;
	current.storey6Height = storey6Height;

	current.TFAfromHEM = TFAfromHEM;

	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	current.winOvershading = winOvershading;
	current.winGlazing     = winGlazing;

	current.totalGlzArea = totalGlzArea;
	current.winNArea	= winNArea;
	current.winNEArea	= winNEArea;
	current.winEArea	= winEArea;
	current.winSEArea	= winSEArea;
	current.winSArea	= winSArea;
	current.winSWArea	= winSWArea;
	current.winWArea	= winWArea;
	current.winNWArea	= winNWArea;
	current.rooflightsArea = rooflightsArea;

	current.winNSolTrans	= winNSolTrans;
	current.winNESolTrans	= winNESolTrans;
	current.winESolTrans	= winESolTrans;
	current.winSESolTrans	= winSESolTrans;
	current.winSSolTrans	= winSSolTrans;
	current.winSWSolTrans	= winSWSolTrans;
	current.winWSolTrans	= winWSolTrans;
	current.winNWSolTrans	= winNWSolTrans;
	current.rooflightsSolTrans = rooflightsSolTrans;

	current.winNFrameFactor	= winNFrameFactor;
	current.winNEFrameFactor	= winNEFrameFactor;
	current.winEFrameFactor	= winEFrameFactor;
	current.winSEFrameFactor	= winSEFrameFactor;
	current.winSFrameFactor	= winSFrameFactor;
	current.winSWFrameFactor	= winSWFrameFactor;
	current.winWFrameFactor	= winWFrameFactor;
	current.winNWFrameFactor	= winNWFrameFactor;
	current.rooflightsFrameFactor = rooflightsFrameFactor;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	current.grossAreaWall1 = grossAreaWall1;
	current.groosAreaRoof1 = groosAreaRoof1;
	current.netAreaDoors = netAreaDoors;
	current.netAreaWindows = netAreaWindows;
	current.netAreaRoofLights = netAreaRoofLights;
	current.netAreaGF = netAreaGF;
	current.netAreaExFloor = netAreaExFloor;
	current.netAreaWallType1 = netAreaWallType1;
	current.netAreaWallType2 = netAreaWallType2;
	current.netAreaRoofType1 = netAreaRoofType1;
	current.netAreaRoofType2 = netAreaRoofType2;
	current.netAreaPartyWall = netAreaPartyWall;
	current.netAreaPartyFloor = netAreaPartyFloor;
	current.netAreaPartyCeiling = netAreaPartyCeiling;
	current.netAreaInternalWall = netAreaInternalWall;
	current.netAreaInternalFloor = netAreaInternalFloor;
	current.netAreaInternalCeiling = netAreaInternalCeiling;

	current.UvalueDoors = UvalueDoors;
	current.UvalueWindows =UvalueWindows;
	current.UvalueRooflights = UvalueRooflights;
	current.UvalueGF = UvalueGF;
	current.UvalueExposedFloor = UvalueExposedFloor;
	current.UvalueWallType1 = UvalueWallType1;
	current.UvalueWallType2 = UvalueWallType2;
	current.UvalueRoofTYpe1 = UvalueRoofTYpe1;
	current.UvalueRoofType2 = UvalueRoofType2;
	current.UvaluePartyWall = UvaluePartyWall;

	current.kValueGF = kValueGF;
	current.kValueExpFloor = kValueExpFloor;
	current.kValueWallType1 = kValueWallType1;
	current.kValueWallType2 = kValueWallType2;
	current.kValueRoofType1 = kValueRoofType1;
	current.kValueRoofType2 = kValueRoofType2;
	current.kValuePartyWall = kValuePartyWall;
	current.kValuePartyFloor = kValuePartyFloor;
	current.kValuePartyCeiling = kValuePartyCeiling;
	current.kValueIntWall = kValueIntWall;
	current.kValueIntFloor = kValueIntFloor;
	current.kValueIntCeiling = kValueIntCeiling;

	current.thermalMassParameter = thermalMassParameter;
	current.livingRoomFraction = livingRoomFraction;
	current.extAreaSum = extAreaSum;
	current.exposureValue = exposureValue;
	current.extInsulationValue = extInsulationValue;
	current.extUvalueXareaSum = extUvalueXareaSum;
	current.hem_extInsulationValue = hem_extInsulationValue;

	current.hem_extAreaSum = hem_extAreaSum;
	current.hem_extUvalueXareaSum = hem_extUvalueXareaSum;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	current.ThermBGFPerimeter = ThermBGFPerimeter;
	current.ThermBFloorWithingDwellinPerimeter = ThermBFloorWithingDwellinPerimeter;
	current.ThermBFloorBetweenDwellinPerimeter = ThermBFloorBetweenDwellinPerimeter;
	current.ThermBBalconyWithingDwellingLength = ThermBBalconyWithingDwellingLength;
	current.ThermBBalconyBetweenDwellingLength = ThermBBalconyBetweenDwellingLength;
	current.ThermBEavesAtCeiling = ThermBEavesAtCeiling;
	current.ThermBEavesAtRafter = ThermBEavesAtRafter;
	current.ThermBGableAtCeiling = ThermBGableAtCeiling;
	current.ThermBGableAtRafter = ThermBGableAtRafter;
	current.ThermBLengthNormalCorners = ThermBLengthNormalCorners;
	current.ThermBLengthInvertedCorners = ThermBLengthInvertedCorners;
	current.ThermBPartWallBetweenDwelling = ThermBPartWallBetweenDwelling;
	current.yValueEntry = yValueEntry;

	current.ThermBMetalBoxLintelUserDef = ThermBMetalBoxLintelUserDef;
	current.ThermBOtherLintelUserDef =ThermBOtherLintelUserDef;
	current.ThermBSillUserDef = ThermBSillUserDef;
	current.ThermBJambUserDef =ThermBJambUserDef;
	current.ThermBGFPerimeterUserDef = ThermBGFPerimeterUserDef;
	current.ThermBFloorWithinDwellingUserDef = ThermBFloorWithinDwellingUserDef;
	current.ThermBFloorBwDwellingUserDef =  ThermBFloorBwDwellingUserDef;
	current.ThermBBalcWithinDwellingLengthUserDef =ThermBBalcWithinDwellingLengthUserDef;
	current.ThermBBalcBwDwellingLengthUserDef = ThermBBalcBwDwellingLengthUserDef;
	current.ThermBEavesInsAtCeilingUserDef =ThermBEavesInsAtCeilingUserDef;
	current.ThermBEavesInsAtRafterUserDef = ThermBEavesInsAtRafterUserDef;
	current.ThermBGableInsAtCeilingUserDef = ThermBGableInsAtCeilingUserDef;
	current.ThermBGableInsAtRafetUserDef = ThermBGableInsAtRafetUserDef;
	current.ThermBLengthOfNormalCornersUserDef = ThermBLengthOfNormalCornersUserDef;
	current.ThermBLengthOfInvertedCornersUserDef =ThermBLengthOfInvertedCornersUserDef;
	current.ThermBPartWallBetweenDwellingUserDef = ThermBPartWallBetweenDwellingUserDef;

	current.ThermBMetalBoxLintelSiValue = ThermBMetalBoxLintelSiValue;
	current.ThermBOtherLintelsSiValue =ThermBOtherLintelsSiValue;
	current.ThermBSillSiValue = ThermBSillSiValue;
	current.ThermBJambSiValue = ThermBJambSiValue;
	current.ThermBGFPerimeterSiValue = ThermBGFPerimeterSiValue;
	current. ThermBFloorWithinDwellingSiValue =  ThermBFloorWithinDwellingSiValue;
	current.ThermBFloorBetweenDwellingSiValue  =ThermBFloorBetweenDwellingSiValue;
	current.ThermBBalconyWithinDwellingSiValue =ThermBBalconyWithinDwellingSiValue;
	current.ThermBBalconyBwDwellingSiValue =ThermBBalconyBwDwellingSiValue;
	current.ThermBEavesInsAtCelingSiValue =ThermBEavesInsAtCelingSiValue;
	current. ThermBEavesInsAtRafterSiValue =ThermBEavesInsAtRafterSiValue;
	current.ThermBGableInsAtCeilingSiValue =ThermBGableInsAtCeilingSiValue;
	current.ThermBGableInsAtRafterSiValue = ThermBGableInsAtRafterSiValue;
	current.ThermBLengthOfNormalCornersSiValue =ThermBLengthOfNormalCornersSiValue;
	current.ThermBLengthOfInvertedCornersSiValue =ThermBLengthOfInvertedCornersSiValue;
	current.ThermBPartBwDwellingLengthSiValue =ThermBPartBwDwellingLengthSiValue;

	current.ThermBMetalBoxLintelResult = ThermBMetalBoxLintelResult;
	current.ThermBOtherLintelsResult   = ThermBOtherLintelsResult;
	current.ThermBSillResult  =ThermBSillResult;
	current.ThermBJambResult =ThermBJambResult;
	current.ThermBGFPerimeterResult =ThermBGFPerimeterResult;
	current.ThermBFloorWithinDwellingPerimeterResult =ThermBFloorWithinDwellingPerimeterResult;
	current.ThermBFloorBetweenDwellingPerimeterResult  =ThermBFloorBetweenDwellingPerimeterResult;
	current.ThermBBalcWithDwellingLengthResult =ThermBBalcWithDwellingLengthResult;
	current.ThermBBalconyBwDwellingLengthResult = ThermBBalconyBwDwellingLengthResult;
	current.ThermBEavesInsCeilingResult  =ThermBEavesInsCeilingResult;
	current.ThermBEavesInsRafterResult = ThermBEavesInsRafterResult;
	current.ThermBGableInsCeilingResult = ThermBGableInsCeilingResult;
	current.ThermBGableInsRafterResult = ThermBGableInsRafterResult;
	current.ThermBLengthNormalCornersResult = ThermBLengthNormalCornersResult;
	current.ThermBLengthInvertedCornersResult = ThermBLengthInvertedCornersResult;
	current.ThermBPartyWallBwDwellingResult = ThermBPartyWallBwDwellingResult;

	current.thermBridgeYvalue_grossArea = thermBridgeYvalue_grossArea ;
	current.hem_yValueEntry = hem_yValueEntry;

	current.versionText = versionText;
	current.titleBarText = titleBarText;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	current.mechVentType = mechVentType;
	current.pressureTestYN = pressureTestYN ;
	current.structInf = structInf;
	current.floorInf =floorInf;
	current.draughtLobby = draughtLobby;
	current.perWindowDraughtStripped = perWindowDraughtStripped;
	current.designAirPermeability = designAirPermeability;
	current.pressureTestScotland= pressureTestScotland;
	current.accreditedDetailsScotland = accreditedDetailsScotland;
	current.seekExemptionForLT3Dwellings = seekExemptionForLT3Dwellings;

	current.designAirPermRate = designAirPermRate;
	current.asBuiltAirPermRate = asBuiltAirPermRate;

	current.airPermMeasuredInDwelling = airPermMeasuredInDwelling;
	current.asBuiltRef = asBuiltRef;
	current.asBuiltTestDate = asBuiltTestDate;

	current.MVHRThermalEff = MVHRThermalEff;
	current.mechVentValuesFrom = mechVentValuesFrom;
	current.numsWetRooms = numsWetRooms;
	current.ductInsulation = ductInsulation;
	current.numsOpenFirePlaces = numsOpenFirePlaces ;
	current.numsOpenFlues =numsOpenFlues ;
	current.numsFluelessGasFires = numsFluelessGasFires;

	current.numsExtractFans = numsExtractFans;
	current.numsPassiveVents = numsPassiveVents;
	current.isACPresent = isACPresent;
	current.ACEnergyUse = ACEnergyUse;
	current.measuredQ50 = measuredQ50;
	current.numOfStoreys = numOfStoreys;

	current.dewllingVolume = dewllingVolume;
	current.infiltration_rate  = infiltration_rate;
	current.infiltration_rate18 = infiltration_rate18;
	current.shelterFactor = shelterFactor;
	current.infiltrationRateWithshelterFactor = infiltrationRateWithshelterFactor;
	current.infliltrationOpenings = infliltrationOpenings;
	current.additionalInfiltration = additionalInfiltration;
	current.windowInfiltration = windowInfiltration;
	current.numOfShelteredSides = numOfShelteredSides;
	current.totalWindSpeed = totalWindSpeed;
	current.totalWindFactor = totalWindFactor;
	current.effInfiltrationRate = effInfiltrationRate;

	current.achThrougSystem = achThrougSystem;
	current.valueIfExhaustAirHP = valueIfExhaustAirHP;
	current.valueIfBalancedHR = valueIfBalancedHR;

	current.effectiveACH = effectiveACH;
	current.effectiveACH_MVHR = effectiveACH_MVHR;
	current.achMVHR1 = achMVHR1;
	current.achMVHR2 = achMVHR2;

	current.spaceHeatingDemandMVHR1 = spaceHeatingDemandMVHR1;
	current.spaceHeatingDemandMVHR2 = spaceHeatingDemandMVHR2;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	current.primaryFuelUsed = primaryFuelUsed;
    current.secFuelUsed     = secFuelUsed;
	current.primaryFuelUsedString = primaryFuelUsedString;
	current.secFuelUsedString     = secFuelUsedString;
	current.mainFuel = mainFuel;
	current.electricityTarrif = electricityTarrif;
	current.mainHtType =mainHtType;
	current.mainHtEffFrom = mainHtEffFrom;
	current.boilerType = boilerType;
	current.isFanFluePresent = isFanFluePresent;
	current.mainHtControls = mainHtControls;
	current.mainHtEmitter =mainHtEmitter;
	current.isIterlockPresent = isIterlockPresent;
	current.isPumpInHeatedSpace = isPumpInHeatedSpace;
	current.mainHtSystem = mainHtSystem;

	current.boilerRef =boilerRef;
	current.boilerModel = boilerModel;
	current.isSecBoilerFuelPresent= isSecBoilerFuelPresent;
	current.mainHtCompensator = mainHtCompensator;
	current.mainHtManufacturerDesc =mainHtManufacturerDesc;
	current.mainHtTestMethod = mainHtTestMethod;

	//current.mainHtEff = mainHtEff;
	current.mainHtEffNominal = mainHtEffNominal; //@min

	current.mainHtEffAdj = mainHtEffAdj;
	current.mainHtTempAdj = mainHtTempAdj;
	current.mainHtFractionSupplied = mainHtFractionSupplied;

	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	current.oilPumpInHeatedSpace = oilPumpInHeatedSpace;
	current.oilBoilerInstalled   = oilBoilerInstalled;

	current.isThereCHP = isThereCHP;
	current.CHPfuel = CHPfuel;
	current.CPSUoperatingTemp = CPSUoperatingTemp;

	current.heatEmmFromCase = heatEmmFromCase;
	current.heatTransferredToWater = heatTransferredToWater;
	current.smokeControlledArea = smokeControlledArea;

	current.fractOfHtFromCHP = fractOfHtFromCHP;
	current.elecEffOfCHP = elecEffOfCHP;
	current.heatingEffOfCHP = heatingEffOfCHP;

	current.secComBoilerFuel = secComBoilerFuel;
	current.secComBoilerSystem = secComBoilerSystem;
	current.secComBoilerEff = secComBoilerEff;
	current.secComBoilerFractOfHtFromBoiler2 = secComBoilerFractOfHtFromBoiler2;
	current.secComBoilerManufactDesc = secComBoilerManufactDesc;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	current.isThereSecHeating = isThereSecHeating;
	current.secHtEffFrom = secHtEffFrom;
	current.secHtFuel = secHtFuel;

	current.secHtOpenFlueChimney = secHtOpenFlueChimney;
	current.secHtUnconnectedGasPoint = secHtUnconnectedGasPoint;
	current.secHtSystem = secHtSystem;
	current.secHtManufactDesc =secHtManufactDesc;
	current.secHtTestMethod = secHtTestMethod;
	current.secHtEff = secHtEff;
	current.secHtFraction = secHtFraction;

	current.spaceHeatingEffAdj = spaceHeatingEffAdj;
	current.waterHeatingEffAdj = waterHeatingEffAdj;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	current.btnWaterHtFromMainState = btnWaterHtFromMainState;
	current.WHtype = WHtype;
	current.WHtCylinderWithinDwelling = WHtCylinderWithinDwelling ;
	current.WHtFuel = WHtFuel;
	current.WHtWaterSepTimed = WHtWaterSepTimed;

	current.WHtCylManufactLossFactor = WHtCylManufactLossFactor;
	current.WHtCylInsType = WHtCylInsType;

	current.WHtCylThermostat = WHtCylThermostat;
	current.WHtCylInHeatedSpace = WHtCylInHeatedSpace;
	current.WHtCylPrimaryPipeworkInsulated = WHtCylPrimaryPipeworkInsulated;
	current.WHtCylPumpedPrimarySystem = WHtCylPumpedPrimarySystem;

	current.WHtTSnCPSUinSingleUnit = WHtTSnCPSUinSingleUnit;
	current.WHtTSnCPSUPrimaryPipeworkLT1_5m = WHtTSnCPSUPrimaryPipeworkLT1_5m;
	current.WHtTSnCPSUstoreInAirCupbrd = WHtTSnCPSUstoreInAirCupbrd;

	current.WHtCombiKeepHotYN = WHtCombiKeepHotYN;
	current.DHWfromCommunityScheme =DHWfromCommunityScheme;
	current.DHWComSchemeSystem = DHWComSchemeSystem;
	current.WHtHeatPumpUsesImmer = WHtHeatPumpUsesImmer;

	current.WHtUsesSummerImmer = WHtUsesSummerImmer;
	
	current.WHtCylDeclaredFactor =WHtCylDeclaredFactor;
	current.WHtCylVolume = WHtCylVolume;
	current.WHtCylInsThickness =  WHtCylInsThickness;

	current.WHtEff = WHtEff;
	current.WHtEffAdj = WHtEffAdj;

	current.WHtCombiKeepHotUsesElec = WHtCombiKeepHotUsesElec;
	current.WHtCombiPowerRating = WHtCombiPowerRating;

	current.DHWComSchemeProvidedFrom = DHWComSchemeProvidedFrom;
	current.DHWComSchemeCHP2PowerRatio = DHWComSchemeCHP2PowerRatio;
	current.DHWComSchemeEff = DHWComSchemeEff;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	current.isSHWPresent = isSHWPresent;
	current.isPVPresent  = isPVPresent;
	current.isWTPresent  = isWTPresent;
	current.uHydroyn = uHydroyn;
	current.uCHPyn = uCHPyn;
	current.MVHRyn = MVHRyn;

	current.SHWCollectorType = SHWCollectorType;
	current.SHWCollectorOrientation = SHWCollectorOrientation;
	current.SHWCollectorTilt = SHWCollectorTilt;
	current.SHWOvershading = SHWOvershading;
	current.isSHWAreaGross = isSHWAreaGross;
	current.isSHWSolarStoreCombined = isSHWSolarStoreCombined;
	current.SHWSolarCircPump = SHWSolarCircPump;
	current.SHWApertureArea = SHWApertureArea;
	current.SHW_ZLCE = SHW_ZLCE;
	current.SHW_HeatLossCoefficient =SHW_HeatLossCoefficient;
	current.SHW_dedicatedSolarStorageVolumeFactor =SHW_dedicatedSolarStorageVolumeFactor;

	current.PVCollectorOrientation = PVCollectorOrientation;
	current.PVCollectorTilt = PVCollectorTilt;
	current.PVOvershading = PVOvershading;
	current.dwellingExposure = dwellingExposure;
	current.CHPFuel = CHPFuel;

	current.SHW_overshadingFactor = SHW_overshadingFactor;
	current.SHW_annualSolarRadiation_pm2 = SHW_annualSolarRadiation_pm2 ;
	current.SHW_collectorPerformanceRatio = SHW_collectorPerformanceRatio;
	current.SHW_solarEnergyAvailable =SHW_solarEnergyAvailable;
	current.SHW_apertureArea =SHW_apertureArea;

	current.SHW_solarToLoadRatio = SHW_solarToLoadRatio;
	current.SHW_collectorPerformanceFactor =SHW_collectorPerformanceFactor;
	current.SHW_effectiveSolarVolume =SHW_effectiveSolarVolume;
	current.SHW_utilizationFactor = SHW_utilizationFactor;
	current.N_OCC = N_OCC;
	current.SHW_annualHotWaterUsage = SHW_annualHotWaterUsage;
	current.SHW_dailyHotWaterDemand_litres = SHW_dailyHotWaterDemand_litres;
	current.SHW_volumeRatio = SHW_volumeRatio;
	current.SHW_annualSolarInput = SHW_annualSolarInput;
	current.SHWDedSolStoreVol =SHWDedSolStoreVol;

	current.isRENAdditionalElectGenerated = isRENAdditionalElectGenerated;
	current.RENAddiationalElecGenerated = RENAddiationalElecGenerated ;
	current.REN_TFA = REN_TFA;

	current.installedPVPeakPower = installedPVPeakPower;
	current.PV_overshadingFactor = PV_overshadingFactor;
	current.PV_annualSolarRadiation_pm2 = PV_annualSolarRadiation_pm2 ;

	current.WTNumOf = WTNumOf;
	current.WTDiameter = WTDiameter;
	current.WTHeight =WTHeight;
	current.WTs3 = WTs3;

	//---------------------------------------------------------
	// RENEWABLES 2
	//---------------------------------------------------------
	current.uHydroAnnualAvgHead = uHydroAnnualAvgHead;
	current.uHydroAnnualAvgFlow = uHydroAnnualAvgFlow;
	current.uHydroEff = uHydroEff;
	current.uHydroAnnualEnergy = uHydroAnnualEnergy;

	current.uCHPheatToPowerRatio = uCHPheatToPowerRatio;
	current.uCHPElectricEff = uCHPElectricEff;
	current.uCHPHeatingEff = uCHPHeatingEff;
	current.uCHPHeatingFraction= uCHPHeatingFraction;
	current.uCHPAnnualElectricity = uCHPAnnualElectricity;
	current.MVHRThermalEff = MVHRThermalEff;
	current.lambda = lambda;

	current.FGHRSpresent           = FGHRSpresent;
	current.FGHRSstore           = FGHRSstore;
	current.FGHRSstoreVolume     = FGHRSstoreVolume;
	current.FGHRSusefulFracHtRec_kf1 = FGHRSusefulFracHtRec_kf1;
	current.FGHRSfittedMain      = FGHRSfittedMain;
	current.FGHRSfittedSec       = FGHRSfittedSec;
	current.FGHRStype            = FGHRStype;
	current.determineFGHRStype       = determineFGHRStype;
	current.FGHRStotFracHeatRec_kf2  = FGHRStotFracHeatRec_kf2;
	current.FGHRSauxelec   = FGHRSauxelec;
	current.FGHRSpvPoweredHt     = FGHRSpvPoweredHt;
	current.FGHRSpvPkPower       = FGHRSpvPkPower;
	current.FGHRSpvOrientation = FGHRSpvOrientation;
	current.FGHRSpvTilt          = FGHRSpvTilt;
	current.FGHRSpvOvershading   = FGHRSpvOvershading;
	current.FGHRScableLoss       = FGHRScableLoss;

	current.WWHRSpresent    = WWHRSpresent;
	current.WWHRSnumOfRooms = WWHRSnumOfRooms;
	current.WWHRS1Make      = WWHRS1Make;
	current.WWHRSnumMixerShowersWithBath1    = WWHRSnumMixerShowersWithBath1;
	current.WWHRSnumMixerShowersWithoutBath1 = WWHRSnumMixerShowersWithoutBath1;
	current.WWHRS1Model = WWHRS1Model;
	current.WWHRS1ModelQualifier = WWHRS1ModelQualifier;
	current.WWHRS2Make                       = WWHRS2Make;
	current.WWHRSnumMixerShowersWithBath2    = WWHRSnumMixerShowersWithBath2;
	current.WWHRSnumMixerShowersWithoutBath2 = WWHRSnumMixerShowersWithoutBath2;
	current.WWHRS2Model                      = WWHRS2Model;
	current.WWHRS2ModelQualifier             = WWHRS2ModelQualifier;
	//---------------------------------------------------------
	// Factor for LZCT
	//---------------------------------------------------------
	current.B_PV = B_PV;
	current.B_WT = B_WT;
	current.B_uHydro = B_uHydro;
	current.B_uCHP = B_uCHP;
	current.annualEnergy_PV = annualEnergy_PV;
	current.WTsupplyInput = WTsupplyInput;
	current.uHydrosupplyInput =uHydrosupplyInput;
	current.uCHPsupplyInput = uCHPsupplyInput;

	current.LZCT_elecDisplaced = LZCT_elecDisplaced;
	current.LZCT_elecSold =LZCT_elecSold;
	current.totalElectricalSupply = totalElectricalSupply;

	//-------------------------------------------------------
	// LIGHTS GLOBAL VARIABLES
	//-------------------------------------------------------
	current.fractionLEL =fractionLEL;

	//---------------------------------------------
	// SUMMER OVER HEATING GLOBAL VARIABLES
	//---------------------------------------------
	current.isTMPUserDef = isTMPUserDef;
	current.TMPvalue =  TMPvalue;
	current.TMPIntPartConstruction=TMPIntPartConstruction;
	current.TMPPartyWallConstruction=TMPPartyWallConstruction;
	current.isVentUserDefined=isVentUserDefined;
	current.airChangeRate=airChangeRate;
	current.isCrossVentOnMostFloors=isCrossVentOnMostFloors;
	current.windowVentilation=windowVentilation;
	current.areCurtainsClosedDuringDay=areCurtainsClosedDuringDay;
	current.fractCurtainsClosed=fractCurtainsClosed;
	current.blindCurtainType=blindCurtainType;
	current.sourceUserDefValues=sourceUserDefValues;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	current.chkInsulation  = chkInsulation;
	current.chkAirtightness = chkAirtightness;
	current.chkCapacity = chkCapacity;
	current.chkSolarIngress =chkSolarIngress;
	current.chkOccupancy = chkOccupancy;
	current.chkControlledSpace= chkControlledSpace;
	current.chkSDHW=chkSDHW;
	current.chkPV=chkPV;
	current.chkWT=chkWT;
	current.chkuCHP=chkuCHP;
	current.chkuHydro=chkuHydro;
	current.chkPCM=chkPCM;
	current.chkMVHR=chkMVHR;
	current.chkFGHRS = chkFGHRS;
	current.chkWWHRS = chkWWHRS;

	current.hemHouseType=hemHouseType;
	current.hemYearOfBuild=hemYearOfBuild;
	current.hemCoolingFuel=hemCoolingFuel;
	current.hemCoolingEff=hemCoolingEff;

	current.hemX_exposure=hemX_exposure;
	current.hemI_insulation=hemI_insulation;
	current.hemI_insulation1=hemI_insulation1;
	current.hemI_insulation2=hemI_insulation2;
	current.hemA_ach=hemA_ach;
	current.hemC_capacity=hemC_capacity;
	current.hemS_solarGains=hemS_solarGains;
	current.hemO_occupantDensity=hemO_occupantDensity;
	current.hemL_livingAreaFraction=hemL_livingAreaFraction;
	current.hemXIACSOL_string=hemXIACSOL_string;
	current.hemXIACSOL_string1=hemXIACSOL_string1;
	current.hemXIACSOL_string2=hemXIACSOL_string2;
	current.hemx_1 =hemx_1;
	current.hemx_2 =hemx_2;
	current.hemy_1 = hemy_1;
	current.hemy_2 =hemy_2;
	current.hemTFA =hemTFA;

	current.hemI_insulationSliderPos = hemI_insulationSliderPos;
	current.hemA_achSliderPos = hemA_achSliderPos;
	current.hemC_capacitySliderPos =hemC_capacitySliderPos;
	current.hemS_solarGainsSliderPos = hemS_solarGainsSliderPos;
	current.hemO_OCCDensitySliderPos=hemO_OCCDensitySliderPos;
	current.hemL_LAFracSliderPos=hemL_LAFracSliderPos;

	current.iStat=iStat;
	current.dwellingVoulme=dwellingVoulme;
	current.SFP=SFP;
	current.auxillaryElectricity=auxillaryElectricity;

	current.numOfOccupants=numOfOccupants;
	current.TFA=TFA;
	current.TFAfromHEM=TFAfromHEM;
	current.EB=EB;
	current.C1=C1;
	current.ZL=ZL;
	current.gL=gL;
	current.GL_total=GL_total;
	current.C2=C2;
	current.lightElectricity=lightElectricity;

	current.Vd_avg=Vd_avg;
	current.DHW_energy=DHW_energy;
	current.distributionLoss=distributionLoss;
	current.winterOpTemp=winterOpTemp;
	current.tempFactor=tempFactor;
	current.storageLoss=storageLoss;
	current.lossFactor=lossFactor;
	current.tankVolume=tankVolume;
	current.volumeFacor=volumeFacor;
	current.heatLossFactor=heatLossFactor;
	current.srorageLoss=srorageLoss;
	current.primaryCircuitLoss=primaryCircuitLoss;
	current.F_u=F_u;
	current.combiLoss=combiLoss;
	current.solarDHWInput=solarDHWInput;

	current.pvSupplyInput=pvSupplyInput;

	current.domesticHotWaterSupply=domesticHotWaterSupply;
	current.spaceHeatingDemand=spaceHeatingDemand;
	current.totalRenElecSupply=totalRenElecSupply;
	current.totalRenElecSupply_fuelCost = totalRenElecSupply_fuelCost;
	current.totalRenElecSupply_Emm=totalRenElecSupply_Emm;
	current.totalRenElecSupply_PrimEnergyFactor=totalRenElecSupply_PrimEnergyFactor;

	current.enterYValue=enterYValue;
	current.mainSpaceHtSupply=mainSpaceHtSupply;
	current.secSpaceHtSupply=secSpaceHtSupply;
	current.totalSpaceHtSupply=totalSpaceHtSupply;
	current.totalSpaceCoolingSupply=totalSpaceCoolingSupply;

	current.totalEnergy=totalEnergy;
	current.totalCost=totalCost;
	current.totalEmissions=totalEmissions;
	current.totalPrimaryEnergy=totalPrimaryEnergy;
	

	current.mainSpaceHtSupply_fuelCost=mainSpaceHtSupply_fuelCost;
	current.secSpaceHtSupply_fuelCost=secSpaceHtSupply_fuelCost;
	current.domesticHotWaterSupply_fuelCost=domesticHotWaterSupply_fuelCost;
	current.auxillaryElectricity_fuelCost=auxillaryElectricity_fuelCost;
	current.lightElectricity_fuelCost=lightElectricity_fuelCost;
	current.totalSpaceCoolingSupply_fuelCost=totalSpaceCoolingSupply_fuelCost;
	

	current.mainSpaceHtSupply_Emm=mainSpaceHtSupply_Emm;
	current.secSpaceHtSupply_Emm=secSpaceHtSupply_Emm;
	current.domesticHotWaterSupply_Emm=domesticHotWaterSupply_Emm;
	current.auxillaryElectricity_Emm=auxillaryElectricity_Emm;
	current.lightElectricity_Emm=lightElectricity_Emm;
	current.totalSpaceCoolingSupply_Emm=totalSpaceCoolingSupply_Emm;
	


	current.mainSpaceHtSupply_PrimEnergyFactor=mainSpaceHtSupply_PrimEnergyFactor;
	current.secSpaceHtSupply_PrimEnergyFactor=secSpaceHtSupply_PrimEnergyFactor;
	current.domesticHotWaterSupply_PrimEnergyFactor=domesticHotWaterSupply_PrimEnergyFactor;
	current.auxillaryElectricity_PrimEnergyFactor=auxillaryElectricity_PrimEnergyFactor;
	current.lightElectricity_PrimEnergyFactor=lightElectricity_PrimEnergyFactor;
	current.totalSpaceCoolingSupply_PrimEnergyFactor = totalSpaceCoolingSupply_PrimEnergyFactor;

	current.totalSpaceHtSupply_Disp		= totalSpaceHtSupply_Disp;
	current.totalSpaceCoolingSupply_Disp	=  totalSpaceCoolingSupply_Disp;
	current.domesticHotWaterSupply_Disp	= domesticHotWaterSupply_Disp;
	current.lightElectricity_Disp			= lightElectricity_Disp;
	current.auxillaryElectricity_Disp		= auxillaryElectricity_Disp;
	current.totalElectricalSupply_Disp		= totalElectricalSupply_Disp;
	current.mainSpaceHtSupply_Disp			= mainSpaceHtSupply_Disp;
	current.secSpaceHtSupply_Disp			= secSpaceHtSupply_Disp;
	current.LZCTelecSold_Disp				= LZCTelecSold_Disp;
	current.LZCTelecDisp_Disp				= LZCTelecDisp_Disp;
	
	current.primaryFuelUsed_Disp		= primaryFuelUsed_Disp;
	current.secFuelUsed_Disp			= secFuelUsed_Disp;
	current.primaryFuelUsed			= primaryFuelUsed;	
	current.secFuelUsed				= secFuelUsed;
	current.primaryFuelUsed_fuelCost   = primaryFuelUsed_fuelCost;	
	current.secFuelUsed_fuelCost       = secFuelUsed_fuelCost;
	current.primaryFuelUsed_Emm        = primaryFuelUsed_Emm;
	current.secFuelUsed_Emm            = secFuelUsed_Emm;
	


	//---------------------------------------------
	// GLOBAL VARIABLES FOR TC ID
	//---------------------------------------------
	// Create index number to read data from frdb.csv file
	current.X_exposure=X_exposure;
	current.I_insulation=I_insulation;
	current.I_insulation1=I_insulation1;
	current.I_insulation2=I_insulation2;
	current.A_ach=A_ach;
	current.A_ach_MVHR1=A_ach_MVHR1;
	current.A_ach_MVHR2=A_ach_MVHR2;
	current.C_capacity=C_capacity;
	current.S_solarGains = S_solarGains;
	current.O_occupantDensity=O_occupantDensity;
	current.L_livingAreaFraction =L_livingAreaFraction;
	current.XIACSOL_string  = XIACSOL_string;
	current.XIACSOL_string1 = XIACSOL_string1;
	current.XIACSOL_string2 = XIACSOL_string2;
	current.x_1 = x_1;
	current.x_2 = x_2;
	current.y_1 = y_1;
	current.y_2 = y_2;

	// String for user display
	current.XIACSOL_string_disp = XIACSOL_string_disp;
	current.XIACSOL_string_disp1 = XIACSOL_string_disp1;
	current.XIACSOL_string_disp2 = XIACSOL_string_disp2;

	//---------------------------------
	// Misc variables used in ach calc
	current.numOfChimneys_multip = numOfChimneys_multip;
	current.numOfFlues_multip =numOfFlues_multip ;
	current.numOfFansPassVents_multip =numOfFansPassVents_multip;
	current.numOfFluelessGasFires_multip=numOfFluelessGasFires_multip;
	current.total_solarGains=total_solarGains;

	current.numOfChimneys_m3perh = numOfChimneys_m3perh ;
	current.numOfFlues_m3perh =numOfFlues_m3perh;
	current.numOfFansPassVents_m3perh=numOfFansPassVents_m3perh;
	current.numOfFluelessGasFires_m3perh =numOfFluelessGasFires_m3perh ;	
}


void CopyCurrentToImprovement1()
{
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	imp1.JobDetRefNum     = JobDetRefNum;
	imp1.assessorName     = assessorName;
	imp1.JobDetComments   = JobDetComments;
	imp1.propertyFlatNameorNum = propertyFlatNameorNum;
	imp1.propertyLetter   = propertyLetter;
	imp1.propertyHouseNum = propertyHouseNum;
	imp1.propertyStreet   = propertyStreet;
	imp1.propertyLocality = propertyLocality;
	imp1.propertyDistrict = propertyDistrict;
	imp1.propertyTown     = propertyTown;
	imp1.propertyCounty   = propertyCounty;
	imp1.propertyPostCode = propertyPostCode;
	imp1.clientFlatNameorNum = clientFlatNameorNum;
	imp1.clientLetter     = clientLetter;
	imp1.clientHouseorBlockNum = clientHouseorBlockNum;
	imp1.clientStreet     = clientStreet;
	imp1.clientLocality   = clientLocality;
	imp1.clientDistrict   = clientDistrict;
	imp1.clientTown       = clientTown;
	imp1.clientCounty     = clientCounty;
	imp1.clientPostCode   = clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	imp1.locationString = locationString;

	imp1.dwellingType = dwellingType;
	imp1.builtForm = builtForm;
	imp1.Detachment = Detachment;
	imp1.FlatPosition =FlatPosition;
	imp1.dwellingTerrain =dwellingTerrain;

	imp1.storey1Level = storey1Level;
	imp1.storey2Level = storey2Level;
	imp1.storey3Level = storey3Level;
	imp1.storey4Level = storey4Level;
	imp1.storey5Level = storey5Level;
	imp1.storey6Level = storey6Level;
	imp1.dwellingShelteredSides = dwellingShelteredSides;
	imp1.yearPropertBuilt =yearPropertBuilt; 

	imp1.storey1 = storey1;
	imp1.storey2 = storey2;
	imp1.storey3 = storey3;
	imp1.storey4 = storey4;
	imp1.storey5 = storey5;
	imp1.storey6 = storey6;

	imp1.storey1Basement = storey1Basement;
	imp1.storey2Basement = storey2Basement;
	imp1.storey3Basement = storey3Basement;
	imp1.storey4Basement = storey4Basement;
	imp1.storey5Basement = storey5Basement;
	imp1.storey6Basement = storey6Basement;

	imp1.storey1Area = storey1Area;
	imp1.storey2Area = storey2Area;
	imp1.storey3Area = storey3Area;
	imp1.storey4Area = storey4Area;
	imp1.storey5Area = storey5Area;
	imp1.storey6Area = storey6Area;

	imp1.storey1Height = storey1Height;
	imp1.storey2Height = storey2Height;
	imp1.storey3Height = storey3Height;
	imp1.storey4Height = storey4Height;
	imp1.storey5Height = storey5Height;
	imp1.storey6Height = storey6Height;
	imp1.TFAfromHEM = TFAfromHEM;

	imp1.multipleLinearRegCoeff = multipleLinearRegCoeff;
	imp1.multipleLinearRegCoeff1= multipleLinearRegCoeff1;
	imp1.multipleLinearRegCoeff2= multipleLinearRegCoeff2;
	
	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	imp1.winOvershading = winOvershading;
	imp1.winGlazing     = winGlazing;

	imp1.totalGlzArea = totalGlzArea;
	imp1.winNArea	= winNArea;
	imp1.winNEArea	= winNEArea;
	imp1.winEArea	= winEArea;
	imp1.winSEArea	= winSEArea;
	imp1.winSArea	= winSArea;
	imp1.winSWArea	= winSWArea;
	imp1.winWArea	= winWArea;
	imp1.winNWArea	= winNWArea;
	imp1.rooflightsArea = rooflightsArea;

	imp1.winNSolTrans	= winNSolTrans;
	imp1.winNESolTrans	= winNESolTrans;
	imp1.winESolTrans	= winESolTrans;
	imp1.winSESolTrans	= winSESolTrans;
	imp1.winSSolTrans	= winSSolTrans;
	imp1.winSWSolTrans	= winSWSolTrans;
	imp1.winWSolTrans	= winWSolTrans;
	imp1.winNWSolTrans	= winNWSolTrans;
	imp1.rooflightsSolTrans = rooflightsSolTrans;

	imp1.winNFrameFactor	= winNFrameFactor;
	imp1.winNEFrameFactor	= winNEFrameFactor;
	imp1.winEFrameFactor	= winEFrameFactor;
	imp1.winSEFrameFactor	= winSEFrameFactor;
	imp1.winSFrameFactor	= winSFrameFactor;
	imp1.winSWFrameFactor	= winSWFrameFactor;
	imp1.winWFrameFactor	= winWFrameFactor;
	imp1.winNWFrameFactor	= winNWFrameFactor;
	imp1.rooflightsFrameFactor = rooflightsFrameFactor;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	imp1.grossAreaWall1 = grossAreaWall1;
	imp1.groosAreaRoof1 = groosAreaRoof1;
	imp1.netAreaDoors = netAreaDoors;
	imp1.netAreaWindows = netAreaWindows;
	imp1.netAreaRoofLights = netAreaRoofLights;
	imp1.netAreaGF = netAreaGF;
	imp1.netAreaExFloor = netAreaExFloor;
	imp1.netAreaWallType1 = netAreaWallType1;
	imp1.netAreaWallType2 = netAreaWallType2;
	imp1.netAreaRoofType1 = netAreaRoofType1;
	imp1.netAreaRoofType2 = netAreaRoofType2;
	imp1.netAreaPartyWall = netAreaPartyWall;
	imp1.netAreaPartyFloor = netAreaPartyFloor;
	imp1.netAreaPartyCeiling = netAreaPartyCeiling;
	imp1.netAreaInternalWall = netAreaInternalWall;
	imp1.netAreaInternalFloor = netAreaInternalFloor;
	imp1.netAreaInternalCeiling = netAreaInternalCeiling;

	imp1.UvalueDoors = UvalueDoors;
	imp1.UvalueWindows =UvalueWindows;
	imp1.UvalueRooflights = UvalueRooflights;
	imp1.UvalueGF = UvalueGF;
	imp1.UvalueExposedFloor = UvalueExposedFloor;
	imp1.UvalueWallType1 = UvalueWallType1;
	imp1.UvalueWallType2 = UvalueWallType2;
	imp1.UvalueRoofTYpe1 = UvalueRoofTYpe1;
	imp1.UvalueRoofType2 = UvalueRoofType2;
	imp1.UvaluePartyWall = UvaluePartyWall;

	imp1.kValueGF = kValueGF;
	imp1.kValueExpFloor = kValueExpFloor;
	imp1.kValueWallType1 = kValueWallType1;
	imp1.kValueWallType2 = kValueWallType2;
	imp1.kValueRoofType1 = kValueRoofType1;
	imp1.kValueRoofType2 = kValueRoofType2;
	imp1.kValuePartyWall = kValuePartyWall;
	imp1.kValuePartyFloor = kValuePartyFloor;
	imp1.kValuePartyCeiling = kValuePartyCeiling;
	imp1.kValueIntWall = kValueIntWall;
	imp1.kValueIntFloor = kValueIntFloor;
	imp1.kValueIntCeiling = kValueIntCeiling;

	imp1.thermalMassParameter = thermalMassParameter;
	imp1.livingRoomFraction = livingRoomFraction;
	imp1.extAreaSum = extAreaSum;
	imp1.exposureValue = exposureValue;
	imp1.extInsulationValue = extInsulationValue;
	imp1.extUvalueXareaSum = extUvalueXareaSum;
	imp1.hem_extInsulationValue = hem_extInsulationValue;

	imp1.hem_extAreaSum = hem_extAreaSum;
	imp1.hem_extUvalueXareaSum = hem_extUvalueXareaSum;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	imp1.ThermBGFPerimeter = ThermBGFPerimeter;
	imp1.ThermBFloorWithingDwellinPerimeter = ThermBFloorWithingDwellinPerimeter;
	imp1.ThermBFloorBetweenDwellinPerimeter = ThermBFloorBetweenDwellinPerimeter;
	imp1.ThermBBalconyWithingDwellingLength = ThermBBalconyWithingDwellingLength;
	imp1.ThermBBalconyBetweenDwellingLength = ThermBBalconyBetweenDwellingLength;
	imp1.ThermBEavesAtCeiling = ThermBEavesAtCeiling;
	imp1.ThermBEavesAtRafter = ThermBEavesAtRafter;
	imp1.ThermBGableAtCeiling = ThermBGableAtCeiling;
	imp1.ThermBGableAtRafter = ThermBGableAtRafter;
	imp1.ThermBLengthNormalCorners = ThermBLengthNormalCorners;
	imp1.ThermBLengthInvertedCorners = ThermBLengthInvertedCorners;
	imp1.ThermBPartWallBetweenDwelling = ThermBPartWallBetweenDwelling;
	imp1.yValueEntry = yValueEntry;

	imp1.ThermBMetalBoxLintelUserDef = ThermBMetalBoxLintelUserDef;
	imp1.ThermBOtherLintelUserDef =ThermBOtherLintelUserDef;
	imp1.ThermBSillUserDef = ThermBSillUserDef;
	imp1.ThermBJambUserDef =ThermBJambUserDef;
	imp1.ThermBGFPerimeterUserDef = ThermBGFPerimeterUserDef;
	imp1.ThermBFloorWithinDwellingUserDef = ThermBFloorWithinDwellingUserDef;
	imp1.ThermBFloorBwDwellingUserDef =  ThermBFloorBwDwellingUserDef;
	imp1.ThermBBalcWithinDwellingLengthUserDef =ThermBBalcWithinDwellingLengthUserDef;
	imp1.ThermBBalcBwDwellingLengthUserDef = ThermBBalcBwDwellingLengthUserDef;
	imp1.ThermBEavesInsAtCeilingUserDef =ThermBEavesInsAtCeilingUserDef;
	imp1.ThermBEavesInsAtRafterUserDef = ThermBEavesInsAtRafterUserDef;
	imp1.ThermBGableInsAtCeilingUserDef = ThermBGableInsAtCeilingUserDef;
	imp1.ThermBGableInsAtRafetUserDef = ThermBGableInsAtRafetUserDef;
	imp1.ThermBLengthOfNormalCornersUserDef = ThermBLengthOfNormalCornersUserDef;
	imp1.ThermBLengthOfInvertedCornersUserDef =ThermBLengthOfInvertedCornersUserDef;
	imp1.ThermBPartWallBetweenDwellingUserDef = ThermBPartWallBetweenDwellingUserDef;

	imp1.ThermBMetalBoxLintelSiValue = ThermBMetalBoxLintelSiValue;
	imp1.ThermBOtherLintelsSiValue =ThermBOtherLintelsSiValue;
	imp1.ThermBSillSiValue = ThermBSillSiValue;
	imp1.ThermBJambSiValue = ThermBJambSiValue;
	imp1.ThermBGFPerimeterSiValue = ThermBGFPerimeterSiValue;
	imp1. ThermBFloorWithinDwellingSiValue =  ThermBFloorWithinDwellingSiValue;
	imp1.ThermBFloorBetweenDwellingSiValue  =ThermBFloorBetweenDwellingSiValue;
	imp1.ThermBBalconyWithinDwellingSiValue =ThermBBalconyWithinDwellingSiValue;
	imp1.ThermBBalconyBwDwellingSiValue =ThermBBalconyBwDwellingSiValue;
	imp1.ThermBEavesInsAtCelingSiValue =ThermBEavesInsAtCelingSiValue;
	imp1. ThermBEavesInsAtRafterSiValue =ThermBEavesInsAtRafterSiValue;
	imp1.ThermBGableInsAtCeilingSiValue =ThermBGableInsAtCeilingSiValue;
	imp1.ThermBGableInsAtRafterSiValue = ThermBGableInsAtRafterSiValue;
	imp1.ThermBLengthOfNormalCornersSiValue =ThermBLengthOfNormalCornersSiValue;
	imp1.ThermBLengthOfInvertedCornersSiValue =ThermBLengthOfInvertedCornersSiValue;
	imp1.ThermBPartBwDwellingLengthSiValue =ThermBPartBwDwellingLengthSiValue;

	imp1.ThermBMetalBoxLintelResult = ThermBMetalBoxLintelResult;
	imp1.ThermBOtherLintelsResult   = ThermBOtherLintelsResult;
	imp1.ThermBSillResult  =ThermBSillResult;
	imp1.ThermBJambResult =ThermBJambResult;
	imp1.ThermBGFPerimeterResult =ThermBGFPerimeterResult;
	imp1.ThermBFloorWithinDwellingPerimeterResult =ThermBFloorWithinDwellingPerimeterResult;
	imp1.ThermBFloorBetweenDwellingPerimeterResult  =ThermBFloorBetweenDwellingPerimeterResult;
	imp1.ThermBBalcWithDwellingLengthResult =ThermBBalcWithDwellingLengthResult;
	imp1.ThermBBalconyBwDwellingLengthResult = ThermBBalconyBwDwellingLengthResult;
	imp1.ThermBEavesInsCeilingResult  =ThermBEavesInsCeilingResult;
	imp1.ThermBEavesInsRafterResult = ThermBEavesInsRafterResult;
	imp1.ThermBGableInsCeilingResult = ThermBGableInsCeilingResult;
	imp1.ThermBGableInsRafterResult = ThermBGableInsRafterResult;
	imp1.ThermBLengthNormalCornersResult = ThermBLengthNormalCornersResult;
	imp1.ThermBLengthInvertedCornersResult = ThermBLengthInvertedCornersResult;
	imp1.ThermBPartyWallBwDwellingResult = ThermBPartyWallBwDwellingResult;

	imp1.thermBridgeYvalue_grossArea = thermBridgeYvalue_grossArea ;
	imp1.hem_yValueEntry = hem_yValueEntry;

	imp1.versionText = versionText;
	imp1.titleBarText = titleBarText;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	imp1.mechVentType = mechVentType;
	imp1.pressureTestYN = pressureTestYN ;
	imp1.structInf = structInf;
	imp1.floorInf =floorInf;
	imp1.draughtLobby = draughtLobby;
	imp1.perWindowDraughtStripped = perWindowDraughtStripped;
	imp1.designAirPermeability = designAirPermeability;
	imp1.pressureTestScotland= pressureTestScotland;
	imp1.accreditedDetailsScotland = accreditedDetailsScotland;
	imp1.seekExemptionForLT3Dwellings = seekExemptionForLT3Dwellings;

	imp1.designAirPermRate = designAirPermRate;
	imp1.asBuiltAirPermRate = asBuiltAirPermRate;

	imp1.airPermMeasuredInDwelling = airPermMeasuredInDwelling;
	imp1.asBuiltRef = asBuiltRef;
	imp1.asBuiltTestDate = asBuiltTestDate;

	imp1.MVHRThermalEff = MVHRThermalEff;
	imp1.mechVentValuesFrom = mechVentValuesFrom;
	imp1.numsWetRooms = numsWetRooms;
	imp1.ductInsulation = ductInsulation;
	imp1.numsOpenFirePlaces = numsOpenFirePlaces ;
	imp1.numsOpenFlues =numsOpenFlues ;
	imp1.numsFluelessGasFires = numsFluelessGasFires;

	imp1.numsExtractFans = numsExtractFans;
	imp1.numsPassiveVents = numsPassiveVents;
	imp1.isACPresent = isACPresent;
	imp1.ACEnergyUse = ACEnergyUse;
	imp1.measuredQ50 = measuredQ50;
	imp1.numOfStoreys = numOfStoreys;

	imp1.dewllingVolume = dewllingVolume;
	imp1.infiltration_rate  = infiltration_rate;
	imp1.infiltration_rate18 = infiltration_rate18;
	imp1.shelterFactor = shelterFactor;
	imp1.infiltrationRateWithshelterFactor = infiltrationRateWithshelterFactor;
	imp1.infliltrationOpenings = infliltrationOpenings;
	imp1.additionalInfiltration = additionalInfiltration;
	imp1.windowInfiltration = windowInfiltration;
	imp1.numOfShelteredSides = numOfShelteredSides;
	imp1.totalWindSpeed = totalWindSpeed;
	imp1.totalWindFactor = totalWindFactor;
	imp1.effInfiltrationRate = effInfiltrationRate;

	imp1.achThrougSystem = achThrougSystem;
	imp1.valueIfExhaustAirHP = valueIfExhaustAirHP;
	imp1.valueIfBalancedHR = valueIfBalancedHR;

	imp1.effectiveACH = effectiveACH;
	imp1.effectiveACH_MVHR = effectiveACH_MVHR;
	imp1.achMVHR1 = achMVHR1;
	imp1.achMVHR2 = achMVHR2;

	imp1.spaceHeatingDemandMVHR1 = spaceHeatingDemandMVHR1;
	imp1.spaceHeatingDemandMVHR2 = spaceHeatingDemandMVHR2;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	imp1.primaryFuelUsed = primaryFuelUsed;
    imp1.secFuelUsed     = secFuelUsed;
	imp1.primaryFuelUsedString = primaryFuelUsedString;
	imp1.secFuelUsedString     = secFuelUsedString;
	imp1.mainFuel = mainFuel;
	imp1.electricityTarrif = electricityTarrif;
	imp1.mainHtType =mainHtType;
	imp1.mainHtEffFrom = mainHtEffFrom;
	imp1.boilerType = boilerType;
	imp1.isFanFluePresent = isFanFluePresent;
	imp1.mainHtControls = mainHtControls;
	imp1.mainHtEmitter =mainHtEmitter;
	imp1.isIterlockPresent = isIterlockPresent;
	imp1.isPumpInHeatedSpace = isPumpInHeatedSpace;
	imp1.mainHtSystem = mainHtSystem;

	imp1.boilerRef =boilerRef;
	imp1.boilerModel = boilerModel;
	imp1.isSecBoilerFuelPresent= isSecBoilerFuelPresent;
	imp1.mainHtCompensator = mainHtCompensator;
	imp1.mainHtManufacturerDesc =mainHtManufacturerDesc;
	imp1.mainHtTestMethod = mainHtTestMethod;

	//imp1.mainHtEff = mainHtEff;
	imp1.mainHtEffNominal = mainHtEffNominal;

	imp1.mainHtEffAdj = mainHtEffAdj;
	imp1.mainHtTempAdj = mainHtTempAdj;
	imp1.mainHtFractionSupplied = mainHtFractionSupplied;

	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	imp1.oilPumpInHeatedSpace = oilPumpInHeatedSpace;
	imp1.oilBoilerInstalled   = oilBoilerInstalled;

	imp1.isThereCHP = isThereCHP;
	imp1.CHPfuel = CHPfuel;
	imp1.CPSUoperatingTemp = CPSUoperatingTemp;

	imp1.heatEmmFromCase = heatEmmFromCase;
	imp1.heatTransferredToWater = heatTransferredToWater;
	imp1.smokeControlledArea = smokeControlledArea;

	imp1.fractOfHtFromCHP = fractOfHtFromCHP;
	imp1.elecEffOfCHP = elecEffOfCHP;
	imp1.heatingEffOfCHP = heatingEffOfCHP;

	imp1.secComBoilerFuel = secComBoilerFuel;
	imp1.secComBoilerSystem = secComBoilerSystem;
	imp1.secComBoilerEff = secComBoilerEff;
	imp1.secComBoilerFractOfHtFromBoiler2 = secComBoilerFractOfHtFromBoiler2;
	imp1.secComBoilerManufactDesc = secComBoilerManufactDesc;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	imp1.isThereSecHeating = isThereSecHeating;
	imp1.secHtEffFrom = secHtEffFrom;
	imp1.secHtFuel = secHtFuel;

	imp1.secHtOpenFlueChimney = secHtOpenFlueChimney;
	imp1.secHtUnconnectedGasPoint = secHtUnconnectedGasPoint;
	imp1.secHtSystem = secHtSystem;
	imp1.secHtManufactDesc =secHtManufactDesc;
	imp1.secHtTestMethod = secHtTestMethod;
	imp1.secHtEff = secHtEff;
	imp1.secHtFraction = secHtFraction;

	imp1.spaceHeatingEffAdj = spaceHeatingEffAdj;
	imp1.waterHeatingEffAdj = waterHeatingEffAdj;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	imp1.btnWaterHtFromMainState = btnWaterHtFromMainState;
	imp1.WHtype = WHtype;
	imp1.WHtCylinderWithinDwelling = WHtCylinderWithinDwelling ;
	imp1.WHtFuel = WHtFuel;
	imp1.WHtWaterSepTimed = WHtWaterSepTimed;

	imp1.WHtCylManufactLossFactor = WHtCylManufactLossFactor;
	imp1.WHtCylInsType = WHtCylInsType;

	imp1.WHtCylThermostat = WHtCylThermostat;
	imp1.WHtCylInHeatedSpace = WHtCylInHeatedSpace;
	imp1.WHtCylPrimaryPipeworkInsulated = WHtCylPrimaryPipeworkInsulated;
	imp1.WHtCylPumpedPrimarySystem = WHtCylPumpedPrimarySystem;

	imp1.WHtTSnCPSUinSingleUnit = WHtTSnCPSUinSingleUnit;
	imp1.WHtTSnCPSUPrimaryPipeworkLT1_5m = WHtTSnCPSUPrimaryPipeworkLT1_5m;
	imp1.WHtTSnCPSUstoreInAirCupbrd = WHtTSnCPSUstoreInAirCupbrd;

	imp1.WHtCombiKeepHotYN = WHtCombiKeepHotYN;
	imp1.DHWfromCommunityScheme =DHWfromCommunityScheme;
	imp1.DHWComSchemeSystem = DHWComSchemeSystem;
	imp1.WHtHeatPumpUsesImmer = WHtHeatPumpUsesImmer;

	imp1.WHtUsesSummerImmer = WHtUsesSummerImmer;

	imp1.WHtCylDeclaredFactor =WHtCylDeclaredFactor;
	imp1.WHtCylVolume = WHtCylVolume;
	imp1.WHtCylInsThickness =  WHtCylInsThickness;

	imp1.WHtEff = WHtEff;
	imp1.WHtEffAdj = WHtEffAdj;

	imp1.WHtCombiKeepHotUsesElec = WHtCombiKeepHotUsesElec;
	imp1.WHtCombiPowerRating = WHtCombiPowerRating;

	imp1.DHWComSchemeProvidedFrom = DHWComSchemeProvidedFrom;
	imp1.DHWComSchemeCHP2PowerRatio = DHWComSchemeCHP2PowerRatio;
	imp1.DHWComSchemeEff = DHWComSchemeEff;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	imp1.isSHWPresent = isSHWPresent;
	imp1.isPVPresent  = isPVPresent;
	imp1.isWTPresent  = isWTPresent;
	imp1.uHydroyn = uHydroyn;
	imp1.uCHPyn = uCHPyn;
	imp1.MVHRyn = MVHRyn;

	imp1.SHWCollectorType = SHWCollectorType;
	imp1.SHWCollectorOrientation = SHWCollectorOrientation;
	imp1.SHWCollectorTilt = SHWCollectorTilt;
	imp1.SHWOvershading = SHWOvershading;
	imp1.isSHWAreaGross = isSHWAreaGross;
	imp1.isSHWSolarStoreCombined = isSHWSolarStoreCombined;
	imp1.SHWSolarCircPump = SHWSolarCircPump;
	imp1.SHWApertureArea = SHWApertureArea;
	imp1.SHW_ZLCE = SHW_ZLCE;
	imp1.SHW_HeatLossCoefficient =SHW_HeatLossCoefficient;
	imp1.SHW_dedicatedSolarStorageVolumeFactor =SHW_dedicatedSolarStorageVolumeFactor;

	imp1.PVCollectorOrientation = PVCollectorOrientation;
	imp1.PVCollectorTilt = PVCollectorTilt;
	imp1.PVOvershading = PVOvershading;
	imp1.dwellingExposure = dwellingExposure;
	imp1.CHPFuel = CHPFuel;

	imp1.SHW_overshadingFactor = SHW_overshadingFactor;
	imp1.SHW_annualSolarRadiation_pm2 = SHW_annualSolarRadiation_pm2 ;
	imp1.SHW_collectorPerformanceRatio = SHW_collectorPerformanceRatio;
	imp1.SHW_solarEnergyAvailable =SHW_solarEnergyAvailable;
	imp1.SHW_apertureArea =SHW_apertureArea;

	imp1.SHW_solarToLoadRatio = SHW_solarToLoadRatio;
	imp1.SHW_collectorPerformanceFactor =SHW_collectorPerformanceFactor;
	imp1.SHW_effectiveSolarVolume =SHW_effectiveSolarVolume;
	imp1.SHW_utilizationFactor = SHW_utilizationFactor;
	imp1.N_OCC = N_OCC;
	imp1.SHW_annualHotWaterUsage = SHW_annualHotWaterUsage;
	imp1.SHW_dailyHotWaterDemand_litres = SHW_dailyHotWaterDemand_litres;
	imp1.SHW_volumeRatio = SHW_volumeRatio;
	imp1.SHW_annualSolarInput = SHW_annualSolarInput;
	imp1.SHWDedSolStoreVol =SHWDedSolStoreVol;

	imp1.isRENAdditionalElectGenerated = isRENAdditionalElectGenerated;
	imp1.RENAddiationalElecGenerated = RENAddiationalElecGenerated ;
	imp1.REN_TFA = REN_TFA;

	imp1.installedPVPeakPower = installedPVPeakPower;
	imp1.PV_overshadingFactor = PV_overshadingFactor;
	imp1.PV_annualSolarRadiation_pm2 = PV_annualSolarRadiation_pm2 ;

	imp1.WTNumOf = WTNumOf;
	imp1.WTDiameter = WTDiameter;
	imp1.WTHeight =WTHeight;
	imp1.WTs3 = WTs3;

	//---------------------------------------------------------
	// RENEWABLES 2
	//---------------------------------------------------------
	imp1.uHydroAnnualAvgHead = uHydroAnnualAvgHead;
	imp1.uHydroAnnualAvgFlow = uHydroAnnualAvgFlow;
	imp1.uHydroEff = uHydroEff;
	imp1.uHydroAnnualEnergy = uHydroAnnualEnergy;

	imp1.uCHPheatToPowerRatio = uCHPheatToPowerRatio;
	imp1.uCHPElectricEff = uCHPElectricEff;
	imp1.uCHPHeatingEff = uCHPHeatingEff;
	imp1.uCHPHeatingFraction= uCHPHeatingFraction;
	imp1.uCHPAnnualElectricity = uCHPAnnualElectricity;
	imp1.MVHRThermalEff = MVHRThermalEff;
	imp1.lambda = lambda;

	imp1.FGHRSpresent           = FGHRSpresent;
	imp1.FGHRSstore           = FGHRSstore;
	imp1.FGHRSstoreVolume     = FGHRSstoreVolume;
	imp1.FGHRSusefulFracHtRec_kf1 = FGHRSusefulFracHtRec_kf1;
	imp1.FGHRSfittedMain      = FGHRSfittedMain;
	imp1.FGHRSfittedSec       = FGHRSfittedSec;
	imp1.FGHRStype            = FGHRStype;
	imp1.determineFGHRStype   = determineFGHRStype;
	imp1.FGHRStotFracHeatRec_kf2  = FGHRStotFracHeatRec_kf2;
	imp1.FGHRSauxelec   = FGHRSauxelec;
	imp1.FGHRSpvPoweredHt     = FGHRSpvPoweredHt;
	imp1.FGHRSpvPkPower       = FGHRSpvPkPower;
	imp1.FGHRSpvOrientation = FGHRSpvOrientation;
	imp1.FGHRSpvTilt          = FGHRSpvTilt;
	imp1.FGHRSpvOvershading   = FGHRSpvOvershading;
	imp1.FGHRScableLoss       = FGHRScableLoss;

	imp1.WWHRSpresent    = WWHRSpresent;
	imp1.WWHRSnumOfRooms = WWHRSnumOfRooms;
	imp1.WWHRS1Make      = WWHRS1Make;
	imp1.WWHRSnumMixerShowersWithBath1    = WWHRSnumMixerShowersWithBath1;
	imp1.WWHRSnumMixerShowersWithoutBath1 = WWHRSnumMixerShowersWithoutBath1;
	imp1.WWHRS1Model = WWHRS1Model;
	imp1.WWHRS1ModelQualifier = WWHRS1ModelQualifier;
	imp1.WWHRS2Make                       = WWHRS2Make;
	imp1.WWHRSnumMixerShowersWithBath2    = WWHRSnumMixerShowersWithBath2;
	imp1.WWHRSnumMixerShowersWithoutBath2 = WWHRSnumMixerShowersWithoutBath2;
	imp1.WWHRS2Model                      = WWHRS2Model;
	imp1.WWHRS2ModelQualifier             = WWHRS2ModelQualifier;
	//---------------------------------------------------------
	// Factor for LZCT
	//---------------------------------------------------------
	imp1.B_PV = B_PV;
	imp1.B_WT = B_WT;
	imp1.B_uHydro = B_uHydro;
	imp1.B_uCHP = B_uCHP;
	imp1.annualEnergy_PV = annualEnergy_PV;
	imp1.WTsupplyInput = WTsupplyInput;
	imp1.uHydrosupplyInput =uHydrosupplyInput;
	imp1.uCHPsupplyInput = uCHPsupplyInput;

	imp1.LZCT_elecDisplaced = LZCT_elecDisplaced;
	imp1.LZCT_elecSold =LZCT_elecSold;
	imp1.totalElectricalSupply = totalElectricalSupply;

	//-------------------------------------------------------
	// LIGHTS GLOBAL VARIABLES
	//-------------------------------------------------------
	imp1.fractionLEL =fractionLEL;

	//---------------------------------------------
	// SUMMER OVER HEATING GLOBAL VARIABLES
	//---------------------------------------------
	imp1.isTMPUserDef = isTMPUserDef;
	imp1.TMPvalue =  TMPvalue;
	imp1.TMPIntPartConstruction=TMPIntPartConstruction;
	imp1.TMPPartyWallConstruction=TMPPartyWallConstruction;
	imp1.isVentUserDefined=isVentUserDefined;
	imp1.airChangeRate=airChangeRate;
	imp1.isCrossVentOnMostFloors=isCrossVentOnMostFloors;
	imp1.windowVentilation=windowVentilation;
	imp1.areCurtainsClosedDuringDay=areCurtainsClosedDuringDay;
	imp1.fractCurtainsClosed=fractCurtainsClosed;
	imp1.blindCurtainType=blindCurtainType;
	imp1.sourceUserDefValues=sourceUserDefValues;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	imp1.chkInsulation  = chkInsulation;
	imp1.chkAirtightness = chkAirtightness;
	imp1.chkCapacity = chkCapacity;
	imp1.chkSolarIngress =chkSolarIngress;
	imp1.chkOccupancy = chkOccupancy;
	imp1.chkControlledSpace= chkControlledSpace;
	imp1.chkSDHW=chkSDHW;
	imp1.chkPV=chkPV;
	imp1.chkWT=chkWT;
	imp1.chkuCHP=chkuCHP;
	imp1.chkuHydro=chkuHydro;
	imp1.chkPCM=chkPCM;
	imp1.chkMVHR=chkMVHR;
	imp1.chkFGHRS = chkFGHRS;
	imp1.chkWWHRS = chkWWHRS;

	imp1.hemHouseType=hemHouseType;
	imp1.hemYearOfBuild=hemYearOfBuild;
	imp1.hemCoolingFuel=hemCoolingFuel;
	imp1.hemCoolingEff=hemCoolingEff;

	imp1.hemX_exposure=hemX_exposure;
	imp1.hemI_insulation=hemI_insulation;
	imp1.hemI_insulation1=hemI_insulation1;
	imp1.hemI_insulation2=hemI_insulation2;
	imp1.hemA_ach=hemA_ach;
	imp1.hemC_capacity=hemC_capacity;
	imp1.hemS_solarGains=hemS_solarGains;
	imp1.hemO_occupantDensity=hemO_occupantDensity;
	imp1.hemL_livingAreaFraction=hemL_livingAreaFraction;
	imp1.hemXIACSOL_string=hemXIACSOL_string;
	imp1.hemXIACSOL_string1=hemXIACSOL_string1;
	imp1.hemXIACSOL_string2=hemXIACSOL_string2;
	imp1.hemx_1 =hemx_1;
	imp1.hemx_2 =hemx_2;
	imp1.hemy_1 = hemy_1;
	imp1.hemy_2 =hemy_2;
	imp1.hemTFA =hemTFA;

	imp1.hemI_insulationSliderPos = hemI_insulationSliderPos;
	imp1.hemA_achSliderPos = hemA_achSliderPos;
	imp1.hemC_capacitySliderPos =hemC_capacitySliderPos;
	imp1.hemS_solarGainsSliderPos = hemS_solarGainsSliderPos;
	imp1.hemO_OCCDensitySliderPos=hemO_OCCDensitySliderPos;
	imp1.hemL_LAFracSliderPos=hemL_LAFracSliderPos;

	imp1.iStat=iStat;
	imp1.dwellingVoulme=dwellingVoulme;
	imp1.SFP=SFP;
	imp1.auxillaryElectricity=auxillaryElectricity;

	imp1.numOfOccupants=numOfOccupants;
	imp1.TFA=TFA;
	imp1.TFAfromHEM=TFAfromHEM;
	imp1.EB=EB;
	imp1.C1=C1;
	imp1.ZL=ZL;
	imp1.gL=gL;
	imp1.GL_total=GL_total;
	imp1.C2=C2;
	imp1.lightElectricity=lightElectricity;

	imp1.Vd_avg=Vd_avg;
	imp1.DHW_energy=DHW_energy;
	imp1.distributionLoss=distributionLoss;
	imp1.winterOpTemp=winterOpTemp;
	imp1.tempFactor=tempFactor;
	imp1.storageLoss=storageLoss;
	imp1.lossFactor=lossFactor;
	imp1.tankVolume=tankVolume;
	imp1.volumeFacor=volumeFacor;
	imp1.heatLossFactor=heatLossFactor;
	imp1.srorageLoss=srorageLoss;
	imp1.primaryCircuitLoss=primaryCircuitLoss;
	imp1.F_u=F_u;
	imp1.combiLoss=combiLoss;
	imp1.solarDHWInput=solarDHWInput;

	imp1.pvSupplyInput=pvSupplyInput;

	imp1.domesticHotWaterSupply=domesticHotWaterSupply;
	imp1.spaceHeatingDemand=spaceHeatingDemand;
	imp1.totalRenElecSupply=totalRenElecSupply;
	imp1.totalRenElecSupply_fuelCost = totalRenElecSupply_fuelCost;
	imp1.totalRenElecSupply_Emm=totalRenElecSupply_Emm;
	imp1.totalRenElecSupply_PrimEnergyFactor=totalRenElecSupply_PrimEnergyFactor;

	imp1.enterYValue=enterYValue;
	imp1.mainSpaceHtSupply=mainSpaceHtSupply;
	imp1.secSpaceHtSupply=secSpaceHtSupply;
	imp1.totalSpaceHtSupply=totalSpaceHtSupply;
	imp1.totalSpaceCoolingSupply=totalSpaceCoolingSupply;

	imp1.totalEnergy=totalEnergy;
	imp1.totalCost=totalCost;
	imp1.totalEmissions=totalEmissions;
	imp1.totalPrimaryEnergy=totalPrimaryEnergy;

	imp1.mainSpaceHtSupply_fuelCost=mainSpaceHtSupply_fuelCost;
	imp1.secSpaceHtSupply_fuelCost=secSpaceHtSupply_fuelCost;
	imp1.domesticHotWaterSupply_fuelCost=domesticHotWaterSupply_fuelCost;
	imp1.auxillaryElectricity_fuelCost=auxillaryElectricity_fuelCost;
	imp1.lightElectricity_fuelCost=lightElectricity_fuelCost;
	imp1.totalSpaceCoolingSupply_fuelCost=totalSpaceCoolingSupply_fuelCost;

	imp1.mainSpaceHtSupply_Emm=mainSpaceHtSupply_Emm;
	imp1.secSpaceHtSupply_Emm=secSpaceHtSupply_Emm;
	imp1.domesticHotWaterSupply_Emm=domesticHotWaterSupply_Emm;
	imp1.auxillaryElectricity_Emm=auxillaryElectricity_Emm;
	imp1.lightElectricity_Emm=lightElectricity_Emm;
	imp1.totalSpaceCoolingSupply_Emm=totalSpaceCoolingSupply_Emm;

	imp1.mainSpaceHtSupply_PrimEnergyFactor=mainSpaceHtSupply_PrimEnergyFactor;
	imp1.secSpaceHtSupply_PrimEnergyFactor=secSpaceHtSupply_PrimEnergyFactor;
	imp1.domesticHotWaterSupply_PrimEnergyFactor=domesticHotWaterSupply_PrimEnergyFactor;
	imp1.auxillaryElectricity_PrimEnergyFactor=auxillaryElectricity_PrimEnergyFactor;
	imp1.lightElectricity_PrimEnergyFactor=lightElectricity_PrimEnergyFactor;
	imp1.totalSpaceCoolingSupply_PrimEnergyFactor = totalSpaceCoolingSupply_PrimEnergyFactor;

	imp1.totalSpaceHtSupply_Disp		= totalSpaceHtSupply_Disp;
	imp1.totalSpaceCoolingSupply_Disp	=  totalSpaceCoolingSupply_Disp;
	imp1.domesticHotWaterSupply_Disp	= domesticHotWaterSupply_Disp;
	imp1.lightElectricity_Disp			= lightElectricity_Disp;
	imp1.auxillaryElectricity_Disp		= auxillaryElectricity_Disp;
	imp1.totalElectricalSupply_Disp		= totalElectricalSupply_Disp;
	imp1.mainSpaceHtSupply_Disp			= mainSpaceHtSupply_Disp;
	imp1.secSpaceHtSupply_Disp			= secSpaceHtSupply_Disp;
	imp1.LZCTelecSold_Disp				= LZCTelecSold_Disp;
	imp1.LZCTelecDisp_Disp				= LZCTelecDisp_Disp;
	

	imp1.primaryFuelUsed_Disp		= primaryFuelUsed_Disp;
	imp1.secFuelUsed_Disp			= secFuelUsed_Disp;
	imp1.primaryFuelUsed			= primaryFuelUsed;	
	imp1.secFuelUsed				= secFuelUsed;
	imp1.primaryFuelUsed_fuelCost   = primaryFuelUsed_fuelCost;	
	imp1.secFuelUsed_fuelCost       = secFuelUsed_fuelCost;
	imp1.primaryFuelUsed_Emm        = primaryFuelUsed_Emm;
	imp1.secFuelUsed_Emm            = secFuelUsed_Emm;


	//---------------------------------------------
	// GLOBAL VARIABLES FOR TC ID
	//---------------------------------------------
	// Create index number to read data from frdb.csv file
	imp1.X_exposure=X_exposure;
	imp1.I_insulation=I_insulation;
	imp1.I_insulation1=I_insulation1;
	imp1.I_insulation2=I_insulation2;
	imp1.A_ach=A_ach;
	imp1.A_ach_MVHR1=A_ach_MVHR1;
	imp1.A_ach_MVHR2=A_ach_MVHR2;
	imp1.C_capacity=C_capacity;
	imp1.S_solarGains = S_solarGains;
	imp1.O_occupantDensity=O_occupantDensity;
	imp1.L_livingAreaFraction =L_livingAreaFraction;
	imp1.XIACSOL_string  = XIACSOL_string;
	imp1.XIACSOL_string1 = XIACSOL_string1;
	imp1.XIACSOL_string2 = XIACSOL_string2;
	imp1.x_1 = x_1;
	imp1.x_2 = x_2;
	imp1.y_1 = y_1;
	imp1.y_2 = y_2;

	// String for user display
	imp1.XIACSOL_string_disp = XIACSOL_string_disp;
	imp1.XIACSOL_string_disp1 = XIACSOL_string_disp1;
	imp1.XIACSOL_string_disp2 = XIACSOL_string_disp2;

	

	//---------------------------------
	// Misc variables used in ach calc
	imp1.numOfChimneys_multip = numOfChimneys_multip;
	imp1.numOfFlues_multip =numOfFlues_multip ;
	imp1.numOfFansPassVents_multip =numOfFansPassVents_multip;
	imp1.numOfFluelessGasFires_multip=numOfFluelessGasFires_multip;
	imp1.total_solarGains=total_solarGains;

	imp1.numOfChimneys_m3perh = numOfChimneys_m3perh ;
	imp1.numOfFlues_m3perh =numOfFlues_m3perh;
	imp1.numOfFansPassVents_m3perh=numOfFansPassVents_m3perh;
	imp1.numOfFluelessGasFires_m3perh =numOfFluelessGasFires_m3perh ;

}

void CopyCurrentToImprovement2()
{
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	imp2.JobDetRefNum     = JobDetRefNum;
	imp2.assessorName     = assessorName;
	imp2.JobDetComments   = JobDetComments;
	imp2.propertyFlatNameorNum = propertyFlatNameorNum;
	imp2.propertyLetter   = propertyLetter;
	imp2.propertyHouseNum = propertyHouseNum;
	imp2.propertyStreet   = propertyStreet;
	imp2.propertyLocality = propertyLocality;
	imp2.propertyDistrict = propertyDistrict;
	imp2.propertyTown     = propertyTown;
	imp2.propertyCounty   = propertyCounty;
	imp2.propertyPostCode = propertyPostCode;
	imp2.clientFlatNameorNum = clientFlatNameorNum;
	imp2.clientLetter     = clientLetter;
	imp2.clientHouseorBlockNum = clientHouseorBlockNum;
	imp2.clientStreet     = clientStreet;
	imp2.clientLocality   = clientLocality;
	imp2.clientDistrict   = clientDistrict;
	imp2.clientTown       = clientTown;
	imp2.clientCounty     = clientCounty;
	imp2.clientPostCode   = clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	imp2.locationString = locationString;

	imp2.dwellingType = dwellingType;
	imp2.builtForm = builtForm;
	imp2.Detachment = Detachment;
	imp2.FlatPosition =FlatPosition;
	imp2.dwellingTerrain =dwellingTerrain;

	imp2.storey1Level = storey1Level;
	imp2.storey2Level = storey2Level;
	imp2.storey3Level = storey3Level;
	imp2.storey4Level = storey4Level;
	imp2.storey5Level = storey5Level;
	imp2.storey6Level = storey6Level;
	imp2.dwellingShelteredSides = dwellingShelteredSides;
	imp2.yearPropertBuilt =yearPropertBuilt; 

	imp2.storey1 = storey1;
	imp2.storey2 = storey2;
	imp2.storey3 = storey3;
	imp2.storey4 = storey4;
	imp2.storey5 = storey5;
	imp2.storey6 = storey6;

	imp2.storey1Basement = storey1Basement;
	imp2.storey2Basement = storey2Basement;
	imp2.storey3Basement = storey3Basement;
	imp2.storey4Basement = storey4Basement;
	imp2.storey5Basement = storey5Basement;
	imp2.storey6Basement = storey6Basement;

	imp2.storey1Area = storey1Area;
	imp2.storey2Area = storey2Area;
	imp2.storey3Area = storey3Area;
	imp2.storey4Area = storey4Area;
	imp2.storey5Area = storey5Area;
	imp2.storey6Area = storey6Area;

	imp2.storey1Height = storey1Height;
	imp2.storey2Height = storey2Height;
	imp2.storey3Height = storey3Height;
	imp2.storey4Height = storey4Height;
	imp2.storey5Height = storey5Height;
	imp2.storey6Height = storey6Height;
	imp2.TFAfromHEM = TFAfromHEM;

	imp2.multipleLinearRegCoeff = multipleLinearRegCoeff;
	imp2.multipleLinearRegCoeff1= multipleLinearRegCoeff1;
	imp2.multipleLinearRegCoeff2= multipleLinearRegCoeff2;
	
	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	imp2.winOvershading = winOvershading;
	imp2.winGlazing     = winGlazing;

	imp2.totalGlzArea = totalGlzArea;
	imp2.winNArea	= winNArea;
	imp2.winNEArea	= winNEArea;
	imp2.winEArea	= winEArea;
	imp2.winSEArea	= winSEArea;
	imp2.winSArea	= winSArea;
	imp2.winSWArea	= winSWArea;
	imp2.winWArea	= winWArea;
	imp2.winNWArea	= winNWArea;
	imp2.rooflightsArea = rooflightsArea;

	imp2.winNSolTrans	= winNSolTrans;
	imp2.winNESolTrans	= winNESolTrans;
	imp2.winESolTrans	= winESolTrans;
	imp2.winSESolTrans	= winSESolTrans;
	imp2.winSSolTrans	= winSSolTrans;
	imp2.winSWSolTrans	= winSWSolTrans;
	imp2.winWSolTrans	= winWSolTrans;
	imp2.winNWSolTrans	= winNWSolTrans;
	imp2.rooflightsSolTrans = rooflightsSolTrans;

	imp2.winNFrameFactor	= winNFrameFactor;
	imp2.winNEFrameFactor	= winNEFrameFactor;
	imp2.winEFrameFactor	= winEFrameFactor;
	imp2.winSEFrameFactor	= winSEFrameFactor;
	imp2.winSFrameFactor	= winSFrameFactor;
	imp2.winSWFrameFactor	= winSWFrameFactor;
	imp2.winWFrameFactor	= winWFrameFactor;
	imp2.winNWFrameFactor	= winNWFrameFactor;
	imp2.rooflightsFrameFactor = rooflightsFrameFactor;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	imp2.grossAreaWall1 = grossAreaWall1;
	imp2.groosAreaRoof1 = groosAreaRoof1;
	imp2.netAreaDoors = netAreaDoors;
	imp2.netAreaWindows = netAreaWindows;
	imp2.netAreaRoofLights = netAreaRoofLights;
	imp2.netAreaGF = netAreaGF;
	imp2.netAreaExFloor = netAreaExFloor;
	imp2.netAreaWallType1 = netAreaWallType1;
	imp2.netAreaWallType2 = netAreaWallType2;
	imp2.netAreaRoofType1 = netAreaRoofType1;
	imp2.netAreaRoofType2 = netAreaRoofType2;
	imp2.netAreaPartyWall = netAreaPartyWall;
	imp2.netAreaPartyFloor = netAreaPartyFloor;
	imp2.netAreaPartyCeiling = netAreaPartyCeiling;
	imp2.netAreaInternalWall = netAreaInternalWall;
	imp2.netAreaInternalFloor = netAreaInternalFloor;
	imp2.netAreaInternalCeiling = netAreaInternalCeiling;

	imp2.UvalueDoors = UvalueDoors;
	imp2.UvalueWindows =UvalueWindows;
	imp2.UvalueRooflights = UvalueRooflights;
	imp2.UvalueGF = UvalueGF;
	imp2.UvalueExposedFloor = UvalueExposedFloor;
	imp2.UvalueWallType1 = UvalueWallType1;
	imp2.UvalueWallType2 = UvalueWallType2;
	imp2.UvalueRoofTYpe1 = UvalueRoofTYpe1;
	imp2.UvalueRoofType2 = UvalueRoofType2;
	imp2.UvaluePartyWall = UvaluePartyWall;

	imp2.kValueGF = kValueGF;
	imp2.kValueExpFloor = kValueExpFloor;
	imp2.kValueWallType1 = kValueWallType1;
	imp2.kValueWallType2 = kValueWallType2;
	imp2.kValueRoofType1 = kValueRoofType1;
	imp2.kValueRoofType2 = kValueRoofType2;
	imp2.kValuePartyWall = kValuePartyWall;
	imp2.kValuePartyFloor = kValuePartyFloor;
	imp2.kValuePartyCeiling = kValuePartyCeiling;
	imp2.kValueIntWall = kValueIntWall;
	imp2.kValueIntFloor = kValueIntFloor;
	imp2.kValueIntCeiling = kValueIntCeiling;

	imp2.thermalMassParameter = thermalMassParameter;
	imp2.livingRoomFraction = livingRoomFraction;
	imp2.extAreaSum = extAreaSum;
	imp2.exposureValue = exposureValue;
	imp2.extInsulationValue = extInsulationValue;
	imp2.extUvalueXareaSum = extUvalueXareaSum;
	imp2.hem_extInsulationValue = hem_extInsulationValue;

	imp2.hem_extAreaSum = hem_extAreaSum;
	imp2.hem_extUvalueXareaSum = hem_extUvalueXareaSum;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	imp2.ThermBGFPerimeter = ThermBGFPerimeter;
	imp2.ThermBFloorWithingDwellinPerimeter = ThermBFloorWithingDwellinPerimeter;
	imp2.ThermBFloorBetweenDwellinPerimeter = ThermBFloorBetweenDwellinPerimeter;
	imp2.ThermBBalconyWithingDwellingLength = ThermBBalconyWithingDwellingLength;
	imp2.ThermBBalconyBetweenDwellingLength = ThermBBalconyBetweenDwellingLength;
	imp2.ThermBEavesAtCeiling = ThermBEavesAtCeiling;
	imp2.ThermBEavesAtRafter = ThermBEavesAtRafter;
	imp2.ThermBGableAtCeiling = ThermBGableAtCeiling;
	imp2.ThermBGableAtRafter = ThermBGableAtRafter;
	imp2.ThermBLengthNormalCorners = ThermBLengthNormalCorners;
	imp2.ThermBLengthInvertedCorners = ThermBLengthInvertedCorners;
	imp2.ThermBPartWallBetweenDwelling = ThermBPartWallBetweenDwelling;
	imp2.yValueEntry = yValueEntry;

	imp2.ThermBMetalBoxLintelUserDef = ThermBMetalBoxLintelUserDef;
	imp2.ThermBOtherLintelUserDef =ThermBOtherLintelUserDef;
	imp2.ThermBSillUserDef = ThermBSillUserDef;
	imp2.ThermBJambUserDef =ThermBJambUserDef;
	imp2.ThermBGFPerimeterUserDef = ThermBGFPerimeterUserDef;
	imp2.ThermBFloorWithinDwellingUserDef = ThermBFloorWithinDwellingUserDef;
	imp2.ThermBFloorBwDwellingUserDef =  ThermBFloorBwDwellingUserDef;
	imp2.ThermBBalcWithinDwellingLengthUserDef =ThermBBalcWithinDwellingLengthUserDef;
	imp2.ThermBBalcBwDwellingLengthUserDef = ThermBBalcBwDwellingLengthUserDef;
	imp2.ThermBEavesInsAtCeilingUserDef =ThermBEavesInsAtCeilingUserDef;
	imp2.ThermBEavesInsAtRafterUserDef = ThermBEavesInsAtRafterUserDef;
	imp2.ThermBGableInsAtCeilingUserDef = ThermBGableInsAtCeilingUserDef;
	imp2.ThermBGableInsAtRafetUserDef = ThermBGableInsAtRafetUserDef;
	imp2.ThermBLengthOfNormalCornersUserDef = ThermBLengthOfNormalCornersUserDef;
	imp2.ThermBLengthOfInvertedCornersUserDef =ThermBLengthOfInvertedCornersUserDef;
	imp2.ThermBPartWallBetweenDwellingUserDef = ThermBPartWallBetweenDwellingUserDef;

	imp2.ThermBMetalBoxLintelSiValue = ThermBMetalBoxLintelSiValue;
	imp2.ThermBOtherLintelsSiValue =ThermBOtherLintelsSiValue;
	imp2.ThermBSillSiValue = ThermBSillSiValue;
	imp2.ThermBJambSiValue = ThermBJambSiValue;
	imp2.ThermBGFPerimeterSiValue = ThermBGFPerimeterSiValue;
	imp2. ThermBFloorWithinDwellingSiValue =  ThermBFloorWithinDwellingSiValue;
	imp2.ThermBFloorBetweenDwellingSiValue  =ThermBFloorBetweenDwellingSiValue;
	imp2.ThermBBalconyWithinDwellingSiValue =ThermBBalconyWithinDwellingSiValue;
	imp2.ThermBBalconyBwDwellingSiValue =ThermBBalconyBwDwellingSiValue;
	imp2.ThermBEavesInsAtCelingSiValue =ThermBEavesInsAtCelingSiValue;
	imp2. ThermBEavesInsAtRafterSiValue =ThermBEavesInsAtRafterSiValue;
	imp2.ThermBGableInsAtCeilingSiValue =ThermBGableInsAtCeilingSiValue;
	imp2.ThermBGableInsAtRafterSiValue = ThermBGableInsAtRafterSiValue;
	imp2.ThermBLengthOfNormalCornersSiValue =ThermBLengthOfNormalCornersSiValue;
	imp2.ThermBLengthOfInvertedCornersSiValue =ThermBLengthOfInvertedCornersSiValue;
	imp2.ThermBPartBwDwellingLengthSiValue =ThermBPartBwDwellingLengthSiValue;

	imp2.ThermBMetalBoxLintelResult = ThermBMetalBoxLintelResult;
	imp2.ThermBOtherLintelsResult   = ThermBOtherLintelsResult;
	imp2.ThermBSillResult  =ThermBSillResult;
	imp2.ThermBJambResult =ThermBJambResult;
	imp2.ThermBGFPerimeterResult =ThermBGFPerimeterResult;
	imp2.ThermBFloorWithinDwellingPerimeterResult =ThermBFloorWithinDwellingPerimeterResult;
	imp2.ThermBFloorBetweenDwellingPerimeterResult  =ThermBFloorBetweenDwellingPerimeterResult;
	imp2.ThermBBalcWithDwellingLengthResult =ThermBBalcWithDwellingLengthResult;
	imp2.ThermBBalconyBwDwellingLengthResult = ThermBBalconyBwDwellingLengthResult;
	imp2.ThermBEavesInsCeilingResult  =ThermBEavesInsCeilingResult;
	imp2.ThermBEavesInsRafterResult = ThermBEavesInsRafterResult;
	imp2.ThermBGableInsCeilingResult = ThermBGableInsCeilingResult;
	imp2.ThermBGableInsRafterResult = ThermBGableInsRafterResult;
	imp2.ThermBLengthNormalCornersResult = ThermBLengthNormalCornersResult;
	imp2.ThermBLengthInvertedCornersResult = ThermBLengthInvertedCornersResult;
	imp2.ThermBPartyWallBwDwellingResult = ThermBPartyWallBwDwellingResult;

	imp2.thermBridgeYvalue_grossArea = thermBridgeYvalue_grossArea ;
	imp2.hem_yValueEntry = hem_yValueEntry;

	imp2.versionText = versionText;
	imp2.titleBarText = titleBarText;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	imp2.mechVentType = mechVentType;
	imp2.pressureTestYN = pressureTestYN ;
	imp2.structInf = structInf;
	imp2.floorInf =floorInf;
	imp2.draughtLobby = draughtLobby;
	imp2.perWindowDraughtStripped = perWindowDraughtStripped;
	imp2.designAirPermeability = designAirPermeability;
	imp2.pressureTestScotland= pressureTestScotland;
	imp2.accreditedDetailsScotland = accreditedDetailsScotland;
	imp2.seekExemptionForLT3Dwellings = seekExemptionForLT3Dwellings;

	imp2.designAirPermRate = designAirPermRate;
	imp2.asBuiltAirPermRate = asBuiltAirPermRate;

	imp2.airPermMeasuredInDwelling = airPermMeasuredInDwelling;
	imp2.asBuiltRef = asBuiltRef;
	imp2.asBuiltTestDate = asBuiltTestDate;

	imp2.MVHRThermalEff = MVHRThermalEff;
	imp2.mechVentValuesFrom = mechVentValuesFrom;
	imp2.numsWetRooms = numsWetRooms;
	imp2.ductInsulation = ductInsulation;
	imp2.numsOpenFirePlaces = numsOpenFirePlaces ;
	imp2.numsOpenFlues =numsOpenFlues ;
	imp2.numsFluelessGasFires = numsFluelessGasFires;

	imp2.numsExtractFans = numsExtractFans;
	imp2.numsPassiveVents = numsPassiveVents;
	imp2.isACPresent = isACPresent;
	imp2.ACEnergyUse = ACEnergyUse;
	imp2.measuredQ50 = measuredQ50;
	imp2.numOfStoreys = numOfStoreys;

	imp2.dewllingVolume = dewllingVolume;
	imp2.infiltration_rate  = infiltration_rate;
	imp2.infiltration_rate18 = infiltration_rate18;
	imp2.shelterFactor = shelterFactor;
	imp2.infiltrationRateWithshelterFactor = infiltrationRateWithshelterFactor;
	imp2.infliltrationOpenings = infliltrationOpenings;
	imp2.additionalInfiltration = additionalInfiltration;
	imp2.windowInfiltration = windowInfiltration;
	imp2.numOfShelteredSides = numOfShelteredSides;
	imp2.totalWindSpeed = totalWindSpeed;
	imp2.totalWindFactor = totalWindFactor;
	imp2.effInfiltrationRate = effInfiltrationRate;

	imp2.achThrougSystem = achThrougSystem;
	imp2.valueIfExhaustAirHP = valueIfExhaustAirHP;
	imp2.valueIfBalancedHR = valueIfBalancedHR;

	imp2.effectiveACH = effectiveACH;
	imp2.effectiveACH_MVHR = effectiveACH_MVHR;
	imp2.achMVHR1 = achMVHR1;
	imp2.achMVHR2 = achMVHR2;

	imp2.spaceHeatingDemandMVHR1 = spaceHeatingDemandMVHR1;
	imp2.spaceHeatingDemandMVHR2 = spaceHeatingDemandMVHR2;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	imp2.primaryFuelUsed = primaryFuelUsed;
    imp2.secFuelUsed     = secFuelUsed;
	imp2.primaryFuelUsedString = primaryFuelUsedString;
	imp2.secFuelUsedString     = secFuelUsedString;
	imp2.mainFuel = mainFuel;
	imp2.electricityTarrif = electricityTarrif;
	imp2.mainHtType =mainHtType;
	imp2.mainHtEffFrom = mainHtEffFrom;
	imp2.boilerType = boilerType;
	imp2.isFanFluePresent = isFanFluePresent;
	imp2.mainHtControls = mainHtControls;
	imp2.mainHtEmitter =mainHtEmitter;
	imp2.isIterlockPresent = isIterlockPresent;
	imp2.isPumpInHeatedSpace = isPumpInHeatedSpace;
	imp2.mainHtSystem = mainHtSystem;

	imp2.boilerRef =boilerRef;
	imp2.boilerModel = boilerModel;
	imp2.isSecBoilerFuelPresent= isSecBoilerFuelPresent;
	imp2.mainHtCompensator = mainHtCompensator;
	imp2.mainHtManufacturerDesc =mainHtManufacturerDesc;
	imp2.mainHtTestMethod = mainHtTestMethod;

	//imp2.mainHtEff = mainHtEff;
	imp2.mainHtEffNominal = mainHtEffNominal;//@min

	imp2.mainHtEffAdj = mainHtEffAdj;
	imp2.mainHtTempAdj = mainHtTempAdj;
	imp2.mainHtFractionSupplied = mainHtFractionSupplied;

	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	imp2.oilPumpInHeatedSpace = oilPumpInHeatedSpace;
	imp2.oilBoilerInstalled   = oilBoilerInstalled;

	imp2.isThereCHP = isThereCHP;
	imp2.CHPfuel = CHPfuel;
	imp2.CPSUoperatingTemp = CPSUoperatingTemp;

	imp2.heatEmmFromCase = heatEmmFromCase;
	imp2.heatTransferredToWater = heatTransferredToWater;
	imp2.smokeControlledArea = smokeControlledArea;

	imp2.fractOfHtFromCHP = fractOfHtFromCHP;
	imp2.elecEffOfCHP = elecEffOfCHP;
	imp2.heatingEffOfCHP = heatingEffOfCHP;

	imp2.secComBoilerFuel = secComBoilerFuel;
	imp2.secComBoilerSystem = secComBoilerSystem;
	imp2.secComBoilerEff = secComBoilerEff;
	imp2.secComBoilerFractOfHtFromBoiler2 = secComBoilerFractOfHtFromBoiler2;
	imp2.secComBoilerManufactDesc = secComBoilerManufactDesc;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	imp2.isThereSecHeating = isThereSecHeating;
	imp2.secHtEffFrom = secHtEffFrom;
	imp2.secHtFuel = secHtFuel;

	imp2.secHtOpenFlueChimney = secHtOpenFlueChimney;
	imp2.secHtUnconnectedGasPoint = secHtUnconnectedGasPoint;
	imp2.secHtSystem = secHtSystem;
	imp2.secHtManufactDesc =secHtManufactDesc;
	imp2.secHtTestMethod = secHtTestMethod;
	imp2.secHtEff = secHtEff;
	imp2.secHtFraction = secHtFraction;

	imp2.spaceHeatingEffAdj = spaceHeatingEffAdj;
	imp2.waterHeatingEffAdj = waterHeatingEffAdj;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	imp2.btnWaterHtFromMainState = btnWaterHtFromMainState;
	imp2.WHtype = WHtype;
	imp2.WHtCylinderWithinDwelling = WHtCylinderWithinDwelling ;
	imp2.WHtFuel = WHtFuel;
	imp2.WHtWaterSepTimed = WHtWaterSepTimed;

	imp2.WHtCylManufactLossFactor = WHtCylManufactLossFactor;
	imp2.WHtCylInsType = WHtCylInsType;

	imp2.WHtCylThermostat = WHtCylThermostat;
	imp2.WHtCylInHeatedSpace = WHtCylInHeatedSpace;
	imp2.WHtCylPrimaryPipeworkInsulated = WHtCylPrimaryPipeworkInsulated;
	imp2.WHtCylPumpedPrimarySystem = WHtCylPumpedPrimarySystem;

	imp2.WHtTSnCPSUinSingleUnit = WHtTSnCPSUinSingleUnit;
	imp2.WHtTSnCPSUPrimaryPipeworkLT1_5m = WHtTSnCPSUPrimaryPipeworkLT1_5m;
	imp2.WHtTSnCPSUstoreInAirCupbrd = WHtTSnCPSUstoreInAirCupbrd;

	imp2.WHtCombiKeepHotYN = WHtCombiKeepHotYN;
	imp2.DHWfromCommunityScheme =DHWfromCommunityScheme;
	imp2.DHWComSchemeSystem = DHWComSchemeSystem;
	imp2.WHtHeatPumpUsesImmer = WHtHeatPumpUsesImmer;

	imp2.WHtUsesSummerImmer = WHtUsesSummerImmer;

	imp2.WHtCylDeclaredFactor =WHtCylDeclaredFactor;
	imp2.WHtCylVolume = WHtCylVolume;
	imp2.WHtCylInsThickness =  WHtCylInsThickness;

	imp2.WHtEff = WHtEff;
	imp2.WHtEffAdj = WHtEffAdj;

	imp2.WHtCombiKeepHotUsesElec = WHtCombiKeepHotUsesElec;
	imp2.WHtCombiPowerRating = WHtCombiPowerRating;

	imp2.DHWComSchemeProvidedFrom = DHWComSchemeProvidedFrom;
	imp2.DHWComSchemeCHP2PowerRatio = DHWComSchemeCHP2PowerRatio;
	imp2.DHWComSchemeEff = DHWComSchemeEff;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	imp2.isSHWPresent = isSHWPresent;
	imp2.isPVPresent  = isPVPresent;
	imp2.isWTPresent  = isWTPresent;
	imp2.uHydroyn = uHydroyn;
	imp2.uCHPyn = uCHPyn;
	imp2.MVHRyn = MVHRyn;

	imp2.SHWCollectorType = SHWCollectorType;
	imp2.SHWCollectorOrientation = SHWCollectorOrientation;
	imp2.SHWCollectorTilt = SHWCollectorTilt;
	imp2.SHWOvershading = SHWOvershading;
	imp2.isSHWAreaGross = isSHWAreaGross;
	imp2.isSHWSolarStoreCombined = isSHWSolarStoreCombined;
	imp2.SHWSolarCircPump = SHWSolarCircPump;
	imp2.SHWApertureArea = SHWApertureArea;
	imp2.SHW_ZLCE = SHW_ZLCE;
	imp2.SHW_HeatLossCoefficient =SHW_HeatLossCoefficient;
	imp2.SHW_dedicatedSolarStorageVolumeFactor =SHW_dedicatedSolarStorageVolumeFactor;

	imp2.PVCollectorOrientation = PVCollectorOrientation;
	imp2.PVCollectorTilt = PVCollectorTilt;
	imp2.PVOvershading = PVOvershading;
	imp2.dwellingExposure = dwellingExposure;
	imp2.CHPFuel = CHPFuel;

	imp2.SHW_overshadingFactor = SHW_overshadingFactor;
	imp2.SHW_annualSolarRadiation_pm2 = SHW_annualSolarRadiation_pm2 ;
	imp2.SHW_collectorPerformanceRatio = SHW_collectorPerformanceRatio;
	imp2.SHW_solarEnergyAvailable =SHW_solarEnergyAvailable;
	imp2.SHW_apertureArea =SHW_apertureArea;

	imp2.SHW_solarToLoadRatio = SHW_solarToLoadRatio;
	imp2.SHW_collectorPerformanceFactor =SHW_collectorPerformanceFactor;
	imp2.SHW_effectiveSolarVolume =SHW_effectiveSolarVolume;
	imp2.SHW_utilizationFactor = SHW_utilizationFactor;
	imp2.N_OCC = N_OCC;
	imp2.SHW_annualHotWaterUsage = SHW_annualHotWaterUsage;
	imp2.SHW_dailyHotWaterDemand_litres = SHW_dailyHotWaterDemand_litres;
	imp2.SHW_volumeRatio = SHW_volumeRatio;
	imp2.SHW_annualSolarInput = SHW_annualSolarInput;
	imp2.SHWDedSolStoreVol =SHWDedSolStoreVol;

	imp2.isRENAdditionalElectGenerated = isRENAdditionalElectGenerated;
	imp2.RENAddiationalElecGenerated = RENAddiationalElecGenerated ;
	imp2.REN_TFA = REN_TFA;

	imp2.installedPVPeakPower = installedPVPeakPower;
	imp2.PV_overshadingFactor = PV_overshadingFactor;
	imp2.PV_annualSolarRadiation_pm2 = PV_annualSolarRadiation_pm2 ;

	imp2.WTNumOf = WTNumOf;
	imp2.WTDiameter = WTDiameter;
	imp2.WTHeight =WTHeight;
	imp2.WTs3 = WTs3;

	//---------------------------------------------------------
	// RENEWABLES 2
	//---------------------------------------------------------
	imp2.uHydroAnnualAvgHead = uHydroAnnualAvgHead;
	imp2.uHydroAnnualAvgFlow = uHydroAnnualAvgFlow;
	imp2.uHydroEff = uHydroEff;
	imp2.uHydroAnnualEnergy = uHydroAnnualEnergy;

	imp2.uCHPheatToPowerRatio = uCHPheatToPowerRatio;
	imp2.uCHPElectricEff = uCHPElectricEff;
	imp2.uCHPHeatingEff = uCHPHeatingEff;
	imp2.uCHPHeatingFraction= uCHPHeatingFraction;
	imp2.uCHPAnnualElectricity = uCHPAnnualElectricity;
	imp2.MVHRThermalEff = MVHRThermalEff;
	imp2.lambda = lambda;

	imp2.FGHRSpresent           = FGHRSpresent;
	imp2.FGHRSstore           = FGHRSstore;
	imp2.FGHRSstoreVolume     = FGHRSstoreVolume;
	imp2.FGHRSusefulFracHtRec_kf1 = FGHRSusefulFracHtRec_kf1;
	imp2.FGHRSfittedMain      = FGHRSfittedMain;
	imp2.FGHRSfittedSec       = FGHRSfittedSec;
	imp2.FGHRStype            = FGHRStype;
	imp2.determineFGHRStype   = determineFGHRStype;
	imp2.FGHRStotFracHeatRec_kf2  = FGHRStotFracHeatRec_kf2;
	imp2.FGHRSauxelec   = FGHRSauxelec;
	imp2.FGHRSpvPoweredHt     = FGHRSpvPoweredHt;
	imp2.FGHRSpvPkPower       = FGHRSpvPkPower;
	imp2.FGHRSpvOrientation = FGHRSpvOrientation;
	imp2.FGHRSpvTilt          = FGHRSpvTilt;
	imp2.FGHRSpvOvershading   = FGHRSpvOvershading;
	imp2.FGHRScableLoss       = FGHRScableLoss;

	imp2.WWHRSpresent    = WWHRSpresent;
	imp2.WWHRSnumOfRooms = WWHRSnumOfRooms;
	imp2.WWHRS1Make      = WWHRS1Make;
	imp2.WWHRSnumMixerShowersWithBath1    = WWHRSnumMixerShowersWithBath1;
	imp2.WWHRSnumMixerShowersWithoutBath1 = WWHRSnumMixerShowersWithoutBath1;
	imp2.WWHRS1Model = WWHRS1Model;
	imp2.WWHRS1ModelQualifier = WWHRS1ModelQualifier;
	imp2.WWHRS2Make                       = WWHRS2Make;
	imp2.WWHRSnumMixerShowersWithBath2    = WWHRSnumMixerShowersWithBath2;
	imp2.WWHRSnumMixerShowersWithoutBath2 = WWHRSnumMixerShowersWithoutBath2;
	imp2.WWHRS2Model                      = WWHRS2Model;
	imp2.WWHRS2ModelQualifier             = WWHRS2ModelQualifier;

	//---------------------------------------------------------
	// Factor for LZCT
	//---------------------------------------------------------
	imp2.B_PV = B_PV;
	imp2.B_WT = B_WT;
	imp2.B_uHydro = B_uHydro;
	imp2.B_uCHP = B_uCHP;
	imp2.annualEnergy_PV = annualEnergy_PV;
	imp2.WTsupplyInput = WTsupplyInput;
	imp2.uHydrosupplyInput =uHydrosupplyInput;
	imp2.uCHPsupplyInput = uCHPsupplyInput;

	imp2.LZCT_elecDisplaced = LZCT_elecDisplaced;
	imp2.LZCT_elecSold =LZCT_elecSold;
	imp2.totalElectricalSupply = totalElectricalSupply;

	//-------------------------------------------------------
	// LIGHTS GLOBAL VARIABLES
	//-------------------------------------------------------
	imp2.fractionLEL =fractionLEL;

	//---------------------------------------------
	// SUMMER OVER HEATING GLOBAL VARIABLES
	//---------------------------------------------
	imp2.isTMPUserDef = isTMPUserDef;
	imp2.TMPvalue =  TMPvalue;
	imp2.TMPIntPartConstruction=TMPIntPartConstruction;
	imp2.TMPPartyWallConstruction=TMPPartyWallConstruction;
	imp2.isVentUserDefined=isVentUserDefined;
	imp2.airChangeRate=airChangeRate;
	imp2.isCrossVentOnMostFloors=isCrossVentOnMostFloors;
	imp2.windowVentilation=windowVentilation;
	imp2.areCurtainsClosedDuringDay=areCurtainsClosedDuringDay;
	imp2.fractCurtainsClosed=fractCurtainsClosed;
	imp2.blindCurtainType=blindCurtainType;
	imp2.sourceUserDefValues=sourceUserDefValues;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	imp2.chkInsulation  = chkInsulation;
	imp2.chkAirtightness = chkAirtightness;
	imp2.chkCapacity = chkCapacity;
	imp2.chkSolarIngress =chkSolarIngress;
	imp2.chkOccupancy = chkOccupancy;
	imp2.chkControlledSpace= chkControlledSpace;
	imp2.chkSDHW=chkSDHW;
	imp2.chkPV=chkPV;
	imp2.chkWT=chkWT;
	imp2.chkuCHP=chkuCHP;
	imp2.chkuHydro=chkuHydro;
	imp2.chkPCM=chkPCM;
	imp2.chkMVHR=chkMVHR;
	imp2.chkFGHRS = chkFGHRS;
	imp2.chkWWHRS = chkWWHRS;

	imp2.hemHouseType=hemHouseType;
	imp2.hemYearOfBuild=hemYearOfBuild;
	imp2.hemCoolingFuel=hemCoolingFuel;
	imp2.hemCoolingEff=hemCoolingEff;

	imp2.hemX_exposure=hemX_exposure;
	imp2.hemI_insulation=hemI_insulation;
	imp2.hemI_insulation1=hemI_insulation1;
	imp2.hemI_insulation2=hemI_insulation2;
	imp2.hemA_ach=hemA_ach;
	imp2.hemC_capacity=hemC_capacity;
	imp2.hemS_solarGains=hemS_solarGains;
	imp2.hemO_occupantDensity=hemO_occupantDensity;
	imp2.hemL_livingAreaFraction=hemL_livingAreaFraction;
	imp2.hemXIACSOL_string=hemXIACSOL_string;
	imp2.hemXIACSOL_string1=hemXIACSOL_string1;
	imp2.hemXIACSOL_string2=hemXIACSOL_string2;
	imp2.hemx_1 =hemx_1;
	imp2.hemx_2 =hemx_2;
	imp2.hemy_1 = hemy_1;
	imp2.hemy_2 =hemy_2;
	imp2.hemTFA =hemTFA;

	imp2.hemI_insulationSliderPos = hemI_insulationSliderPos;
	imp2.hemA_achSliderPos = hemA_achSliderPos;
	imp2.hemC_capacitySliderPos =hemC_capacitySliderPos;
	imp2.hemS_solarGainsSliderPos = hemS_solarGainsSliderPos;
	imp2.hemO_OCCDensitySliderPos=hemO_OCCDensitySliderPos;
	imp2.hemL_LAFracSliderPos=hemL_LAFracSliderPos;

	imp2.iStat=iStat;
	imp2.dwellingVoulme=dwellingVoulme;
	imp2.SFP=SFP;
	imp2.auxillaryElectricity=auxillaryElectricity;

	imp2.numOfOccupants=numOfOccupants;
	imp2.TFA=TFA;
	imp2.TFAfromHEM=TFAfromHEM;
	imp2.EB=EB;
	imp2.C1=C1;
	imp2.ZL=ZL;
	imp2.gL=gL;
	imp2.GL_total=GL_total;
	imp2.C2=C2;
	imp2.lightElectricity=lightElectricity;

	imp2.Vd_avg=Vd_avg;
	imp2.DHW_energy=DHW_energy;
	imp2.distributionLoss=distributionLoss;
	imp2.winterOpTemp=winterOpTemp;
	imp2.tempFactor=tempFactor;
	imp2.storageLoss=storageLoss;
	imp2.lossFactor=lossFactor;
	imp2.tankVolume=tankVolume;
	imp2.volumeFacor=volumeFacor;
	imp2.heatLossFactor=heatLossFactor;
	imp2.srorageLoss=srorageLoss;
	imp2.primaryCircuitLoss=primaryCircuitLoss;
	imp2.F_u=F_u;
	imp2.combiLoss=combiLoss;
	imp2.solarDHWInput=solarDHWInput;

	imp2.pvSupplyInput=pvSupplyInput;

	imp2.domesticHotWaterSupply=domesticHotWaterSupply;
	imp2.spaceHeatingDemand=spaceHeatingDemand;
	imp2.totalRenElecSupply=totalRenElecSupply;
	imp2.totalRenElecSupply_fuelCost = totalRenElecSupply_fuelCost;
	imp2.totalRenElecSupply_Emm=totalRenElecSupply_Emm;
	imp2.totalRenElecSupply_PrimEnergyFactor=totalRenElecSupply_PrimEnergyFactor;

	imp2.enterYValue=enterYValue;
	imp2.mainSpaceHtSupply=mainSpaceHtSupply;
	imp2.secSpaceHtSupply=secSpaceHtSupply;
	imp2.totalSpaceHtSupply=totalSpaceHtSupply;
	imp2.totalSpaceCoolingSupply=totalSpaceCoolingSupply;

	imp2.totalEnergy=totalEnergy;
	imp2.totalCost=totalCost;
	imp2.totalEmissions=totalEmissions;
	imp2.totalPrimaryEnergy=totalPrimaryEnergy;

	imp2.mainSpaceHtSupply_fuelCost=mainSpaceHtSupply_fuelCost;
	imp2.secSpaceHtSupply_fuelCost=secSpaceHtSupply_fuelCost;
	imp2.domesticHotWaterSupply_fuelCost=domesticHotWaterSupply_fuelCost;
	imp2.auxillaryElectricity_fuelCost=auxillaryElectricity_fuelCost;
	imp2.lightElectricity_fuelCost=lightElectricity_fuelCost;
	imp2.totalSpaceCoolingSupply_fuelCost=totalSpaceCoolingSupply_fuelCost;

	imp2.mainSpaceHtSupply_Emm=mainSpaceHtSupply_Emm;
	imp2.secSpaceHtSupply_Emm=secSpaceHtSupply_Emm;
	imp2.domesticHotWaterSupply_Emm=domesticHotWaterSupply_Emm;
	imp2.auxillaryElectricity_Emm=auxillaryElectricity_Emm;
	imp2.lightElectricity_Emm=lightElectricity_Emm;
	imp2.totalSpaceCoolingSupply_Emm=totalSpaceCoolingSupply_Emm;

	imp2.mainSpaceHtSupply_PrimEnergyFactor=mainSpaceHtSupply_PrimEnergyFactor;
	imp2.secSpaceHtSupply_PrimEnergyFactor=secSpaceHtSupply_PrimEnergyFactor;
	imp2.domesticHotWaterSupply_PrimEnergyFactor=domesticHotWaterSupply_PrimEnergyFactor;
	imp2.auxillaryElectricity_PrimEnergyFactor=auxillaryElectricity_PrimEnergyFactor;
	imp2.lightElectricity_PrimEnergyFactor=lightElectricity_PrimEnergyFactor;
	imp2.totalSpaceCoolingSupply_PrimEnergyFactor = totalSpaceCoolingSupply_PrimEnergyFactor;

	imp2.totalSpaceHtSupply_Disp		= totalSpaceHtSupply_Disp;
	imp2.totalSpaceCoolingSupply_Disp	=  totalSpaceCoolingSupply_Disp;
	imp2.domesticHotWaterSupply_Disp	= domesticHotWaterSupply_Disp;
	imp2.lightElectricity_Disp			= lightElectricity_Disp;
	imp2.auxillaryElectricity_Disp		= auxillaryElectricity_Disp;
	imp2.totalElectricalSupply_Disp		= totalElectricalSupply_Disp;
	imp2.mainSpaceHtSupply_Disp			= mainSpaceHtSupply_Disp;
	imp2.secSpaceHtSupply_Disp			= secSpaceHtSupply_Disp;
	imp2.LZCTelecSold_Disp				= LZCTelecSold_Disp;
	imp2.LZCTelecDisp_Disp				= LZCTelecDisp_Disp;
	imp2.primaryFuelUsed_Disp		    = primaryFuelUsed_Disp;
	imp2.secFuelUsed_Disp				= secFuelUsed_Disp;

	imp2.primaryFuelUsed_Disp		= primaryFuelUsed_Disp;
	imp2.secFuelUsed_Disp			= secFuelUsed_Disp;
	imp2.primaryFuelUsed			= primaryFuelUsed;	
	imp2.secFuelUsed				= secFuelUsed;
	imp2.primaryFuelUsed_fuelCost   = primaryFuelUsed_fuelCost;	
	imp2.secFuelUsed_fuelCost       = secFuelUsed_fuelCost;
	imp2.primaryFuelUsed_Emm        = primaryFuelUsed_Emm;
	imp2.secFuelUsed_Emm            = secFuelUsed_Emm;

	//---------------------------------------------
	// GLOBAL VARIABLES FOR TC ID
	//---------------------------------------------
	// Create index number to read data from frdb.csv file
	imp2.X_exposure=X_exposure;
	imp2.I_insulation=I_insulation;
	imp2.I_insulation1=I_insulation1;
	imp2.I_insulation2=I_insulation2;
	imp2.A_ach=A_ach;
	imp2.A_ach_MVHR1=A_ach_MVHR1;
	imp2.A_ach_MVHR2=A_ach_MVHR2;
	imp2.C_capacity=C_capacity;
	imp2.S_solarGains = S_solarGains;
	imp2.O_occupantDensity=O_occupantDensity;
	imp2.L_livingAreaFraction =L_livingAreaFraction;
	imp2.XIACSOL_string  = XIACSOL_string;
	imp2.XIACSOL_string1 = XIACSOL_string1;
	imp2.XIACSOL_string2 = XIACSOL_string2;
	imp2.x_1 = x_1;
	imp2.x_2 = x_2;
	imp2.y_1 = y_1;
	imp2.y_2 = y_2;

	// String for user display
	imp2.XIACSOL_string_disp = XIACSOL_string_disp;
	imp2.XIACSOL_string_disp1 = XIACSOL_string_disp1;
	imp2.XIACSOL_string_disp2 = XIACSOL_string_disp2;

	

	//---------------------------------
	// Misc variables used in ach calc
	imp2.numOfChimneys_multip = numOfChimneys_multip;
	imp2.numOfFlues_multip =numOfFlues_multip ;
	imp2.numOfFansPassVents_multip =numOfFansPassVents_multip;
	imp2.numOfFluelessGasFires_multip=numOfFluelessGasFires_multip;
	imp2.total_solarGains=total_solarGains;

	imp2.numOfChimneys_m3perh = numOfChimneys_m3perh ;
	imp2.numOfFlues_m3perh =numOfFlues_m3perh;
	imp2.numOfFansPassVents_m3perh=numOfFansPassVents_m3perh;
	imp2.numOfFluelessGasFires_m3perh =numOfFluelessGasFires_m3perh ;
}

void CopyCurrentToImprovement3()
{
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	imp3.JobDetRefNum     = JobDetRefNum;
	imp3.assessorName     = assessorName;
	imp3.JobDetComments   = JobDetComments;
	imp3.propertyFlatNameorNum = propertyFlatNameorNum;
	imp3.propertyLetter   = propertyLetter;
	imp3.propertyHouseNum = propertyHouseNum;
	imp3.propertyStreet   = propertyStreet;
	imp3.propertyLocality = propertyLocality;
	imp3.propertyDistrict = propertyDistrict;
	imp3.propertyTown     = propertyTown;
	imp3.propertyCounty   = propertyCounty;
	imp3.propertyPostCode = propertyPostCode;
	imp3.clientFlatNameorNum = clientFlatNameorNum;
	imp3.clientLetter     = clientLetter;
	imp3.clientHouseorBlockNum = clientHouseorBlockNum;
	imp3.clientStreet     = clientStreet;
	imp3.clientLocality   = clientLocality;
	imp3.clientDistrict   = clientDistrict;
	imp3.clientTown       = clientTown;
	imp3.clientCounty     = clientCounty;
	imp3.clientPostCode   = clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	imp3.locationString = locationString;

	imp3.dwellingType = dwellingType;
	imp3.builtForm = builtForm;
	imp3.Detachment = Detachment;
	imp3.FlatPosition =FlatPosition;
	imp3.dwellingTerrain =dwellingTerrain;

	imp3.storey1Level = storey1Level;
	imp3.storey2Level = storey2Level;
	imp3.storey3Level = storey3Level;
	imp3.storey4Level = storey4Level;
	imp3.storey5Level = storey5Level;
	imp3.storey6Level = storey6Level;
	imp3.dwellingShelteredSides = dwellingShelteredSides;
	imp3.yearPropertBuilt =yearPropertBuilt; 

	imp3.storey1 = storey1;
	imp3.storey2 = storey2;
	imp3.storey3 = storey3;
	imp3.storey4 = storey4;
	imp3.storey5 = storey5;
	imp3.storey6 = storey6;

	imp3.storey1Basement = storey1Basement;
	imp3.storey2Basement = storey2Basement;
	imp3.storey3Basement = storey3Basement;
	imp3.storey4Basement = storey4Basement;
	imp3.storey5Basement = storey5Basement;
	imp3.storey6Basement = storey6Basement;

	imp3.storey1Area = storey1Area;
	imp3.storey2Area = storey2Area;
	imp3.storey3Area = storey3Area;
	imp3.storey4Area = storey4Area;
	imp3.storey5Area = storey5Area;
	imp3.storey6Area = storey6Area;

	imp3.storey1Height = storey1Height;
	imp3.storey2Height = storey2Height;
	imp3.storey3Height = storey3Height;
	imp3.storey4Height = storey4Height;
	imp3.storey5Height = storey5Height;
	imp3.storey6Height = storey6Height;
	imp4.TFAfromHEM = TFAfromHEM;

	imp3.multipleLinearRegCoeff = multipleLinearRegCoeff;
	imp3.multipleLinearRegCoeff1= multipleLinearRegCoeff1;
	imp3.multipleLinearRegCoeff2= multipleLinearRegCoeff2;
	
	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	imp3.winOvershading = winOvershading;
	imp3.winGlazing     = winGlazing;

	imp3.totalGlzArea = totalGlzArea;
	imp3.winNArea	= winNArea;
	imp3.winNEArea	= winNEArea;
	imp3.winEArea	= winEArea;
	imp3.winSEArea	= winSEArea;
	imp3.winSArea	= winSArea;
	imp3.winSWArea	= winSWArea;
	imp3.winWArea	= winWArea;
	imp3.winNWArea	= winNWArea;
	imp3.rooflightsArea = rooflightsArea;

	imp3.winNSolTrans	= winNSolTrans;
	imp3.winNESolTrans	= winNESolTrans;
	imp3.winESolTrans	= winESolTrans;
	imp3.winSESolTrans	= winSESolTrans;
	imp3.winSSolTrans	= winSSolTrans;
	imp3.winSWSolTrans	= winSWSolTrans;
	imp3.winWSolTrans	= winWSolTrans;
	imp3.winNWSolTrans	= winNWSolTrans;
	imp3.rooflightsSolTrans = rooflightsSolTrans;

	imp3.winNFrameFactor	= winNFrameFactor;
	imp3.winNEFrameFactor	= winNEFrameFactor;
	imp3.winEFrameFactor	= winEFrameFactor;
	imp3.winSEFrameFactor	= winSEFrameFactor;
	imp3.winSFrameFactor	= winSFrameFactor;
	imp3.winSWFrameFactor	= winSWFrameFactor;
	imp3.winWFrameFactor	= winWFrameFactor;
	imp3.winNWFrameFactor	= winNWFrameFactor;
	imp3.rooflightsFrameFactor = rooflightsFrameFactor;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	imp3.grossAreaWall1 = grossAreaWall1;
	imp3.groosAreaRoof1 = groosAreaRoof1;
	imp3.netAreaDoors = netAreaDoors;
	imp3.netAreaWindows = netAreaWindows;
	imp3.netAreaRoofLights = netAreaRoofLights;
	imp3.netAreaGF = netAreaGF;
	imp3.netAreaExFloor = netAreaExFloor;
	imp3.netAreaWallType1 = netAreaWallType1;
	imp3.netAreaWallType2 = netAreaWallType2;
	imp3.netAreaRoofType1 = netAreaRoofType1;
	imp3.netAreaRoofType2 = netAreaRoofType2;
	imp3.netAreaPartyWall = netAreaPartyWall;
	imp3.netAreaPartyFloor = netAreaPartyFloor;
	imp3.netAreaPartyCeiling = netAreaPartyCeiling;
	imp3.netAreaInternalWall = netAreaInternalWall;
	imp3.netAreaInternalFloor = netAreaInternalFloor;
	imp3.netAreaInternalCeiling = netAreaInternalCeiling;

	imp3.UvalueDoors = UvalueDoors;
	imp3.UvalueWindows =UvalueWindows;
	imp3.UvalueRooflights = UvalueRooflights;
	imp3.UvalueGF = UvalueGF;
	imp3.UvalueExposedFloor = UvalueExposedFloor;
	imp3.UvalueWallType1 = UvalueWallType1;
	imp3.UvalueWallType2 = UvalueWallType2;
	imp3.UvalueRoofTYpe1 = UvalueRoofTYpe1;
	imp3.UvalueRoofType2 = UvalueRoofType2;
	imp3.UvaluePartyWall = UvaluePartyWall;

	imp3.kValueGF = kValueGF;
	imp3.kValueExpFloor = kValueExpFloor;
	imp3.kValueWallType1 = kValueWallType1;
	imp3.kValueWallType2 = kValueWallType2;
	imp3.kValueRoofType1 = kValueRoofType1;
	imp3.kValueRoofType2 = kValueRoofType2;
	imp3.kValuePartyWall = kValuePartyWall;
	imp3.kValuePartyFloor = kValuePartyFloor;
	imp3.kValuePartyCeiling = kValuePartyCeiling;
	imp3.kValueIntWall = kValueIntWall;
	imp3.kValueIntFloor = kValueIntFloor;
	imp3.kValueIntCeiling = kValueIntCeiling;

	imp3.thermalMassParameter = thermalMassParameter;
	imp3.livingRoomFraction = livingRoomFraction;
	imp3.extAreaSum = extAreaSum;
	imp3.exposureValue = exposureValue;
	imp3.extInsulationValue = extInsulationValue;
	imp3.extUvalueXareaSum = extUvalueXareaSum;
	imp3.hem_extInsulationValue = hem_extInsulationValue;

	imp3.hem_extAreaSum = hem_extAreaSum;
	imp3.hem_extUvalueXareaSum = hem_extUvalueXareaSum;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	imp3.ThermBGFPerimeter = ThermBGFPerimeter;
	imp3.ThermBFloorWithingDwellinPerimeter = ThermBFloorWithingDwellinPerimeter;
	imp3.ThermBFloorBetweenDwellinPerimeter = ThermBFloorBetweenDwellinPerimeter;
	imp3.ThermBBalconyWithingDwellingLength = ThermBBalconyWithingDwellingLength;
	imp3.ThermBBalconyBetweenDwellingLength = ThermBBalconyBetweenDwellingLength;
	imp3.ThermBEavesAtCeiling = ThermBEavesAtCeiling;
	imp3.ThermBEavesAtRafter = ThermBEavesAtRafter;
	imp3.ThermBGableAtCeiling = ThermBGableAtCeiling;
	imp3.ThermBGableAtRafter = ThermBGableAtRafter;
	imp3.ThermBLengthNormalCorners = ThermBLengthNormalCorners;
	imp3.ThermBLengthInvertedCorners = ThermBLengthInvertedCorners;
	imp3.ThermBPartWallBetweenDwelling = ThermBPartWallBetweenDwelling;
	imp3.yValueEntry = yValueEntry;

	imp3.ThermBMetalBoxLintelUserDef = ThermBMetalBoxLintelUserDef;
	imp3.ThermBOtherLintelUserDef =ThermBOtherLintelUserDef;
	imp3.ThermBSillUserDef = ThermBSillUserDef;
	imp3.ThermBJambUserDef =ThermBJambUserDef;
	imp3.ThermBGFPerimeterUserDef = ThermBGFPerimeterUserDef;
	imp3.ThermBFloorWithinDwellingUserDef = ThermBFloorWithinDwellingUserDef;
	imp3.ThermBFloorBwDwellingUserDef =  ThermBFloorBwDwellingUserDef;
	imp3.ThermBBalcWithinDwellingLengthUserDef =ThermBBalcWithinDwellingLengthUserDef;
	imp3.ThermBBalcBwDwellingLengthUserDef = ThermBBalcBwDwellingLengthUserDef;
	imp3.ThermBEavesInsAtCeilingUserDef =ThermBEavesInsAtCeilingUserDef;
	imp3.ThermBEavesInsAtRafterUserDef = ThermBEavesInsAtRafterUserDef;
	imp3.ThermBGableInsAtCeilingUserDef = ThermBGableInsAtCeilingUserDef;
	imp3.ThermBGableInsAtRafetUserDef = ThermBGableInsAtRafetUserDef;
	imp3.ThermBLengthOfNormalCornersUserDef = ThermBLengthOfNormalCornersUserDef;
	imp3.ThermBLengthOfInvertedCornersUserDef =ThermBLengthOfInvertedCornersUserDef;
	imp3.ThermBPartWallBetweenDwellingUserDef = ThermBPartWallBetweenDwellingUserDef;

	imp3.ThermBMetalBoxLintelSiValue = ThermBMetalBoxLintelSiValue;
	imp3.ThermBOtherLintelsSiValue =ThermBOtherLintelsSiValue;
	imp3.ThermBSillSiValue = ThermBSillSiValue;
	imp3.ThermBJambSiValue = ThermBJambSiValue;
	imp3.ThermBGFPerimeterSiValue = ThermBGFPerimeterSiValue;
	imp3. ThermBFloorWithinDwellingSiValue =  ThermBFloorWithinDwellingSiValue;
	imp3.ThermBFloorBetweenDwellingSiValue  =ThermBFloorBetweenDwellingSiValue;
	imp3.ThermBBalconyWithinDwellingSiValue =ThermBBalconyWithinDwellingSiValue;
	imp3.ThermBBalconyBwDwellingSiValue =ThermBBalconyBwDwellingSiValue;
	imp3.ThermBEavesInsAtCelingSiValue =ThermBEavesInsAtCelingSiValue;
	imp3. ThermBEavesInsAtRafterSiValue =ThermBEavesInsAtRafterSiValue;
	imp3.ThermBGableInsAtCeilingSiValue =ThermBGableInsAtCeilingSiValue;
	imp3.ThermBGableInsAtRafterSiValue = ThermBGableInsAtRafterSiValue;
	imp3.ThermBLengthOfNormalCornersSiValue =ThermBLengthOfNormalCornersSiValue;
	imp3.ThermBLengthOfInvertedCornersSiValue =ThermBLengthOfInvertedCornersSiValue;
	imp3.ThermBPartBwDwellingLengthSiValue =ThermBPartBwDwellingLengthSiValue;

	imp3.ThermBMetalBoxLintelResult = ThermBMetalBoxLintelResult;
	imp3.ThermBOtherLintelsResult   = ThermBOtherLintelsResult;
	imp3.ThermBSillResult  =ThermBSillResult;
	imp3.ThermBJambResult =ThermBJambResult;
	imp3.ThermBGFPerimeterResult =ThermBGFPerimeterResult;
	imp3.ThermBFloorWithinDwellingPerimeterResult =ThermBFloorWithinDwellingPerimeterResult;
	imp3.ThermBFloorBetweenDwellingPerimeterResult  =ThermBFloorBetweenDwellingPerimeterResult;
	imp3.ThermBBalcWithDwellingLengthResult =ThermBBalcWithDwellingLengthResult;
	imp3.ThermBBalconyBwDwellingLengthResult = ThermBBalconyBwDwellingLengthResult;
	imp3.ThermBEavesInsCeilingResult  =ThermBEavesInsCeilingResult;
	imp3.ThermBEavesInsRafterResult = ThermBEavesInsRafterResult;
	imp3.ThermBGableInsCeilingResult = ThermBGableInsCeilingResult;
	imp3.ThermBGableInsRafterResult = ThermBGableInsRafterResult;
	imp3.ThermBLengthNormalCornersResult = ThermBLengthNormalCornersResult;
	imp3.ThermBLengthInvertedCornersResult = ThermBLengthInvertedCornersResult;
	imp3.ThermBPartyWallBwDwellingResult = ThermBPartyWallBwDwellingResult;

	imp3.thermBridgeYvalue_grossArea = thermBridgeYvalue_grossArea ;
	imp3.hem_yValueEntry = hem_yValueEntry;

	imp3.versionText = versionText;
	imp3.titleBarText = titleBarText;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	imp3.mechVentType = mechVentType;
	imp3.pressureTestYN = pressureTestYN ;
	imp3.structInf = structInf;
	imp3.floorInf =floorInf;
	imp3.draughtLobby = draughtLobby;
	imp3.perWindowDraughtStripped = perWindowDraughtStripped;
	imp3.designAirPermeability = designAirPermeability;
	imp3.pressureTestScotland= pressureTestScotland;
	imp3.accreditedDetailsScotland = accreditedDetailsScotland;
	imp3.seekExemptionForLT3Dwellings = seekExemptionForLT3Dwellings;

	imp3.designAirPermRate = designAirPermRate;
	imp3.asBuiltAirPermRate = asBuiltAirPermRate;

	imp3.airPermMeasuredInDwelling = airPermMeasuredInDwelling;
	imp3.asBuiltRef = asBuiltRef;
	imp3.asBuiltTestDate = asBuiltTestDate;

	imp3.MVHRThermalEff = MVHRThermalEff;
	imp3.mechVentValuesFrom = mechVentValuesFrom;
	imp3.numsWetRooms = numsWetRooms;
	imp3.ductInsulation = ductInsulation;
	imp3.numsOpenFirePlaces = numsOpenFirePlaces ;
	imp3.numsOpenFlues =numsOpenFlues ;
	imp3.numsFluelessGasFires = numsFluelessGasFires;

	imp3.numsExtractFans = numsExtractFans;
	imp3.numsPassiveVents = numsPassiveVents;
	imp3.isACPresent = isACPresent;
	imp3.ACEnergyUse = ACEnergyUse;
	imp3.measuredQ50 = measuredQ50;
	imp3.numOfStoreys = numOfStoreys;

	imp3.dewllingVolume = dewllingVolume;
	imp3.infiltration_rate  = infiltration_rate;
	imp3.infiltration_rate18 = infiltration_rate18;
	imp3.shelterFactor = shelterFactor;
	imp3.infiltrationRateWithshelterFactor = infiltrationRateWithshelterFactor;
	imp3.infliltrationOpenings = infliltrationOpenings;
	imp3.additionalInfiltration = additionalInfiltration;
	imp3.windowInfiltration = windowInfiltration;
	imp3.numOfShelteredSides = numOfShelteredSides;
	imp3.totalWindSpeed = totalWindSpeed;
	imp3.totalWindFactor = totalWindFactor;
	imp3.effInfiltrationRate = effInfiltrationRate;

	imp3.achThrougSystem = achThrougSystem;
	imp3.valueIfExhaustAirHP = valueIfExhaustAirHP;
	imp3.valueIfBalancedHR = valueIfBalancedHR;

	imp3.effectiveACH = effectiveACH;
	imp3.effectiveACH_MVHR = effectiveACH_MVHR;
	imp3.achMVHR1 = achMVHR1;
	imp3.achMVHR2 = achMVHR2;

	imp3.spaceHeatingDemandMVHR1 = spaceHeatingDemandMVHR1;
	imp3.spaceHeatingDemandMVHR2 = spaceHeatingDemandMVHR2;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	imp3.primaryFuelUsed = primaryFuelUsed;
    imp3.secFuelUsed     = secFuelUsed;
	imp3.primaryFuelUsedString = primaryFuelUsedString;
	imp3.secFuelUsedString     = secFuelUsedString;
	imp3.mainFuel = mainFuel;
	imp3.electricityTarrif = electricityTarrif;
	imp3.mainHtType =mainHtType;
	imp3.mainHtEffFrom = mainHtEffFrom;
	imp3.boilerType = boilerType;
	imp3.isFanFluePresent = isFanFluePresent;
	imp3.mainHtControls = mainHtControls;
	imp3.mainHtEmitter =mainHtEmitter;
	imp3.isIterlockPresent = isIterlockPresent;
	imp3.isPumpInHeatedSpace = isPumpInHeatedSpace;
	imp3.mainHtSystem = mainHtSystem;

	imp3.boilerRef =boilerRef;
	imp3.boilerModel = boilerModel;
	imp3.isSecBoilerFuelPresent= isSecBoilerFuelPresent;
	imp3.mainHtCompensator = mainHtCompensator;
	imp3.mainHtManufacturerDesc =mainHtManufacturerDesc;
	imp3.mainHtTestMethod = mainHtTestMethod;

	//imp3.mainHtEff = mainHtEff;
	imp3.mainHtEffNominal = mainHtEffNominal;//@min

	imp3.mainHtEffAdj = mainHtEffAdj;
	imp3.mainHtTempAdj = mainHtTempAdj;
	imp3.mainHtFractionSupplied = mainHtFractionSupplied;

	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	imp3.oilPumpInHeatedSpace = oilPumpInHeatedSpace;
	imp3.oilBoilerInstalled   = oilBoilerInstalled;

	imp3.isThereCHP = isThereCHP;
	imp3.CHPfuel = CHPfuel;
	imp3.CPSUoperatingTemp = CPSUoperatingTemp;

	imp3.heatEmmFromCase = heatEmmFromCase;
	imp3.heatTransferredToWater = heatTransferredToWater;
	imp3.smokeControlledArea = smokeControlledArea;

	imp3.fractOfHtFromCHP = fractOfHtFromCHP;
	imp3.elecEffOfCHP = elecEffOfCHP;
	imp3.heatingEffOfCHP = heatingEffOfCHP;

	imp3.secComBoilerFuel = secComBoilerFuel;
	imp3.secComBoilerSystem = secComBoilerSystem;
	imp3.secComBoilerEff = secComBoilerEff;
	imp3.secComBoilerFractOfHtFromBoiler2 = secComBoilerFractOfHtFromBoiler2;
	imp3.secComBoilerManufactDesc = secComBoilerManufactDesc;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	imp3.isThereSecHeating = isThereSecHeating;
	imp3.secHtEffFrom = secHtEffFrom;
	imp3.secHtFuel = secHtFuel;

	imp3.secHtOpenFlueChimney = secHtOpenFlueChimney;
	imp3.secHtUnconnectedGasPoint = secHtUnconnectedGasPoint;
	imp3.secHtSystem = secHtSystem;
	imp3.secHtManufactDesc =secHtManufactDesc;
	imp3.secHtTestMethod = secHtTestMethod;
	imp3.secHtEff = secHtEff;
	imp3.secHtFraction = secHtFraction;

	imp3.spaceHeatingEffAdj = spaceHeatingEffAdj;
	imp3.waterHeatingEffAdj = waterHeatingEffAdj;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	imp3.btnWaterHtFromMainState = btnWaterHtFromMainState;
	imp3.WHtype = WHtype;
	imp3.WHtCylinderWithinDwelling = WHtCylinderWithinDwelling ;
	imp3.WHtFuel = WHtFuel;
	imp3.WHtWaterSepTimed = WHtWaterSepTimed;

	imp3.WHtCylManufactLossFactor = WHtCylManufactLossFactor;
	imp3.WHtCylInsType = WHtCylInsType;

	imp3.WHtCylThermostat = WHtCylThermostat;
	imp3.WHtCylInHeatedSpace = WHtCylInHeatedSpace;
	imp3.WHtCylPrimaryPipeworkInsulated = WHtCylPrimaryPipeworkInsulated;
	imp3.WHtCylPumpedPrimarySystem = WHtCylPumpedPrimarySystem;

	imp3.WHtTSnCPSUinSingleUnit = WHtTSnCPSUinSingleUnit;
	imp3.WHtTSnCPSUPrimaryPipeworkLT1_5m = WHtTSnCPSUPrimaryPipeworkLT1_5m;
	imp3.WHtTSnCPSUstoreInAirCupbrd = WHtTSnCPSUstoreInAirCupbrd;

	imp3.WHtCombiKeepHotYN = WHtCombiKeepHotYN;
	imp3.DHWfromCommunityScheme =DHWfromCommunityScheme;
	imp3.DHWComSchemeSystem = DHWComSchemeSystem;
	imp3.WHtHeatPumpUsesImmer = WHtHeatPumpUsesImmer;

	imp3.WHtUsesSummerImmer = WHtUsesSummerImmer;

	imp3.WHtCylDeclaredFactor =WHtCylDeclaredFactor;
	imp3.WHtCylVolume = WHtCylVolume;
	imp3.WHtCylInsThickness =  WHtCylInsThickness;

	imp3.WHtEff = WHtEff;
	imp3.WHtEffAdj = WHtEffAdj;

	imp3.WHtCombiKeepHotUsesElec = WHtCombiKeepHotUsesElec;
	imp3.WHtCombiPowerRating = WHtCombiPowerRating;

	imp3.DHWComSchemeProvidedFrom = DHWComSchemeProvidedFrom;
	imp3.DHWComSchemeCHP2PowerRatio = DHWComSchemeCHP2PowerRatio;
	imp3.DHWComSchemeEff = DHWComSchemeEff;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	imp3.isSHWPresent = isSHWPresent;
	imp3.isPVPresent  = isPVPresent;
	imp3.isWTPresent  = isWTPresent;
	imp3.uHydroyn = uHydroyn;
	imp3.uCHPyn = uCHPyn;
	imp3.MVHRyn = MVHRyn;

	imp3.SHWCollectorType = SHWCollectorType;
	imp3.SHWCollectorOrientation = SHWCollectorOrientation;
	imp3.SHWCollectorTilt = SHWCollectorTilt;
	imp3.SHWOvershading = SHWOvershading;
	imp3.isSHWAreaGross = isSHWAreaGross;
	imp3.isSHWSolarStoreCombined = isSHWSolarStoreCombined;
	imp3.SHWSolarCircPump = SHWSolarCircPump;
	imp3.SHWApertureArea = SHWApertureArea;
	imp3.SHW_ZLCE = SHW_ZLCE;
	imp3.SHW_HeatLossCoefficient =SHW_HeatLossCoefficient;
	imp3.SHW_dedicatedSolarStorageVolumeFactor =SHW_dedicatedSolarStorageVolumeFactor;

	imp3.PVCollectorOrientation = PVCollectorOrientation;
	imp3.PVCollectorTilt = PVCollectorTilt;
	imp3.PVOvershading = PVOvershading;
	imp3.dwellingExposure = dwellingExposure;
	imp3.CHPFuel = CHPFuel;

	imp3.SHW_overshadingFactor = SHW_overshadingFactor;
	imp3.SHW_annualSolarRadiation_pm2 = SHW_annualSolarRadiation_pm2 ;
	imp3.SHW_collectorPerformanceRatio = SHW_collectorPerformanceRatio;
	imp3.SHW_solarEnergyAvailable =SHW_solarEnergyAvailable;
	imp3.SHW_apertureArea =SHW_apertureArea;

	imp3.SHW_solarToLoadRatio = SHW_solarToLoadRatio;
	imp3.SHW_collectorPerformanceFactor =SHW_collectorPerformanceFactor;
	imp3.SHW_effectiveSolarVolume =SHW_effectiveSolarVolume;
	imp3.SHW_utilizationFactor = SHW_utilizationFactor;
	imp3.N_OCC = N_OCC;
	imp3.SHW_annualHotWaterUsage = SHW_annualHotWaterUsage;
	imp3.SHW_dailyHotWaterDemand_litres = SHW_dailyHotWaterDemand_litres;
	imp3.SHW_volumeRatio = SHW_volumeRatio;
	imp3.SHW_annualSolarInput = SHW_annualSolarInput;
	imp3.SHWDedSolStoreVol =SHWDedSolStoreVol;

	imp3.isRENAdditionalElectGenerated = isRENAdditionalElectGenerated;
	imp3.RENAddiationalElecGenerated = RENAddiationalElecGenerated ;
	imp3.REN_TFA = REN_TFA;

	imp3.installedPVPeakPower = installedPVPeakPower;
	imp3.PV_overshadingFactor = PV_overshadingFactor;
	imp3.PV_annualSolarRadiation_pm2 = PV_annualSolarRadiation_pm2 ;

	imp3.WTNumOf = WTNumOf;
	imp3.WTDiameter = WTDiameter;
	imp3.WTHeight =WTHeight;
	imp3.WTs3 = WTs3;

	//---------------------------------------------------------
	// RENEWABLES 2
	//---------------------------------------------------------
	imp3.uHydroAnnualAvgHead = uHydroAnnualAvgHead;
	imp3.uHydroAnnualAvgFlow = uHydroAnnualAvgFlow;
	imp3.uHydroEff = uHydroEff;
	imp3.uHydroAnnualEnergy = uHydroAnnualEnergy;

	imp3.uCHPheatToPowerRatio = uCHPheatToPowerRatio;
	imp3.uCHPElectricEff = uCHPElectricEff;
	imp3.uCHPHeatingEff = uCHPHeatingEff;
	imp3.uCHPHeatingFraction= uCHPHeatingFraction;
	imp3.uCHPAnnualElectricity = uCHPAnnualElectricity;
	imp3.MVHRThermalEff = MVHRThermalEff;
	imp3.lambda = lambda;

	imp3.FGHRSpresent           = FGHRSpresent;
	imp3.FGHRSstore           = FGHRSstore;
	imp3.FGHRSstoreVolume     = FGHRSstoreVolume;
	imp3.FGHRSusefulFracHtRec_kf1 = FGHRSusefulFracHtRec_kf1;
	imp3.FGHRSfittedMain      = FGHRSfittedMain;
	imp3.FGHRSfittedSec       = FGHRSfittedSec;
	imp3.FGHRStype            = FGHRStype;
	imp3.determineFGHRStype   = determineFGHRStype;
	imp3.FGHRStotFracHeatRec_kf2  = FGHRStotFracHeatRec_kf2;
	imp3.FGHRSauxelec   = FGHRSauxelec;
	imp3.FGHRSpvPoweredHt     = FGHRSpvPoweredHt;
	imp3.FGHRSpvPkPower       = FGHRSpvPkPower;
	imp3.FGHRSpvOrientation = FGHRSpvOrientation;
	imp3.FGHRSpvTilt          = FGHRSpvTilt;
	imp3.FGHRSpvOvershading   = FGHRSpvOvershading;
	imp3.FGHRScableLoss       = FGHRScableLoss;

	imp3.WWHRSpresent    = WWHRSpresent;
	imp3.WWHRSnumOfRooms = WWHRSnumOfRooms;
	imp3.WWHRS1Make      = WWHRS1Make;
	imp3.WWHRSnumMixerShowersWithBath1    = WWHRSnumMixerShowersWithBath1;
	imp3.WWHRSnumMixerShowersWithoutBath1 = WWHRSnumMixerShowersWithoutBath1;
	imp3.WWHRS1Model = WWHRS1Model;
	imp3.WWHRS1ModelQualifier = WWHRS1ModelQualifier;
	imp3.WWHRS2Make                       = WWHRS2Make;
	imp3.WWHRSnumMixerShowersWithBath2    = WWHRSnumMixerShowersWithBath2;
	imp3.WWHRSnumMixerShowersWithoutBath2 = WWHRSnumMixerShowersWithoutBath2;
	imp3.WWHRS2Model                      = WWHRS2Model;
	imp3.WWHRS2ModelQualifier             = WWHRS2ModelQualifier;

	//---------------------------------------------------------
	// Factor for LZCT
	//---------------------------------------------------------
	imp3.B_PV = B_PV;
	imp3.B_WT = B_WT;
	imp3.B_uHydro = B_uHydro;
	imp3.B_uCHP = B_uCHP;
	imp3.annualEnergy_PV = annualEnergy_PV;
	imp3.WTsupplyInput = WTsupplyInput;
	imp3.uHydrosupplyInput =uHydrosupplyInput;
	imp3.uCHPsupplyInput = uCHPsupplyInput;

	imp3.LZCT_elecDisplaced = LZCT_elecDisplaced;
	imp3.LZCT_elecSold =LZCT_elecSold;
	imp3.totalElectricalSupply = totalElectricalSupply;

	//-------------------------------------------------------
	// LIGHTS GLOBAL VARIABLES
	//-------------------------------------------------------
	imp3.fractionLEL =fractionLEL;

	//---------------------------------------------
	// SUMMER OVER HEATING GLOBAL VARIABLES
	//---------------------------------------------
	imp3.isTMPUserDef = isTMPUserDef;
	imp3.TMPvalue =  TMPvalue;
	imp3.TMPIntPartConstruction=TMPIntPartConstruction;
	imp3.TMPPartyWallConstruction=TMPPartyWallConstruction;
	imp3.isVentUserDefined=isVentUserDefined;
	imp3.airChangeRate=airChangeRate;
	imp3.isCrossVentOnMostFloors=isCrossVentOnMostFloors;
	imp3.windowVentilation=windowVentilation;
	imp3.areCurtainsClosedDuringDay=areCurtainsClosedDuringDay;
	imp3.fractCurtainsClosed=fractCurtainsClosed;
	imp3.blindCurtainType=blindCurtainType;
	imp3.sourceUserDefValues=sourceUserDefValues;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	imp3.chkInsulation  = chkInsulation;
	imp3.chkAirtightness = chkAirtightness;
	imp3.chkCapacity = chkCapacity;
	imp3.chkSolarIngress =chkSolarIngress;
	imp3.chkOccupancy = chkOccupancy;
	imp3.chkControlledSpace= chkControlledSpace;
	imp3.chkSDHW=chkSDHW;
	imp3.chkPV=chkPV;
	imp3.chkWT=chkWT;
	imp3.chkuCHP=chkuCHP;
	imp3.chkuHydro=chkuHydro;
	imp3.chkPCM=chkPCM;
	imp3.chkMVHR=chkMVHR;
	imp3.chkFGHRS = chkFGHRS;
	imp4.chkWWHRS = chkWWHRS;

	imp3.hemHouseType=hemHouseType;
	imp3.hemYearOfBuild=hemYearOfBuild;
	imp3.hemCoolingFuel=hemCoolingFuel;
	imp3.hemCoolingEff=hemCoolingEff;

	imp3.hemX_exposure=hemX_exposure;
	imp3.hemI_insulation=hemI_insulation;
	imp3.hemI_insulation1=hemI_insulation1;
	imp3.hemI_insulation2=hemI_insulation2;
	imp3.hemA_ach=hemA_ach;
	imp3.hemC_capacity=hemC_capacity;
	imp3.hemS_solarGains=hemS_solarGains;
	imp3.hemO_occupantDensity=hemO_occupantDensity;
	imp3.hemL_livingAreaFraction=hemL_livingAreaFraction;
	imp3.hemXIACSOL_string=hemXIACSOL_string;
	imp3.hemXIACSOL_string1=hemXIACSOL_string1;
	imp3.hemXIACSOL_string2=hemXIACSOL_string2;
	imp3.hemx_1 =hemx_1;
	imp3.hemx_2 =hemx_2;
	imp3.hemy_1 = hemy_1;
	imp3.hemy_2 =hemy_2;
	imp3.hemTFA =hemTFA;

	imp3.hemI_insulationSliderPos = hemI_insulationSliderPos;
	imp3.hemA_achSliderPos = hemA_achSliderPos;
	imp3.hemC_capacitySliderPos =hemC_capacitySliderPos;
	imp3.hemS_solarGainsSliderPos = hemS_solarGainsSliderPos;
	imp3.hemO_OCCDensitySliderPos=hemO_OCCDensitySliderPos;
	imp3.hemL_LAFracSliderPos=hemL_LAFracSliderPos;

	imp3.iStat=iStat;
	imp3.dwellingVoulme=dwellingVoulme;
	imp3.SFP=SFP;
	imp3.auxillaryElectricity=auxillaryElectricity;

	imp3.numOfOccupants=numOfOccupants;
	imp3.TFA=TFA;
	imp3.TFAfromHEM=TFAfromHEM;
	imp3.EB=EB;
	imp3.C1=C1;
	imp3.ZL=ZL;
	imp3.gL=gL;
	imp3.GL_total=GL_total;
	imp3.C2=C2;
	imp3.lightElectricity=lightElectricity;

	imp3.Vd_avg=Vd_avg;
	imp3.DHW_energy=DHW_energy;
	imp3.distributionLoss=distributionLoss;
	imp3.winterOpTemp=winterOpTemp;
	imp3.tempFactor=tempFactor;
	imp3.storageLoss=storageLoss;
	imp3.lossFactor=lossFactor;
	imp3.tankVolume=tankVolume;
	imp3.volumeFacor=volumeFacor;
	imp3.heatLossFactor=heatLossFactor;
	imp3.srorageLoss=srorageLoss;
	imp3.primaryCircuitLoss=primaryCircuitLoss;
	imp3.F_u=F_u;
	imp3.combiLoss=combiLoss;
	imp3.solarDHWInput=solarDHWInput;

	imp3.pvSupplyInput=pvSupplyInput;

	imp3.domesticHotWaterSupply=domesticHotWaterSupply;
	imp3.spaceHeatingDemand=spaceHeatingDemand;
	imp3.totalRenElecSupply=totalRenElecSupply;
	imp3.totalRenElecSupply_fuelCost = totalRenElecSupply_fuelCost;
	imp3.totalRenElecSupply_Emm=totalRenElecSupply_Emm;
	imp3.totalRenElecSupply_PrimEnergyFactor=totalRenElecSupply_PrimEnergyFactor;

	imp3.enterYValue=enterYValue;
	imp3.mainSpaceHtSupply=mainSpaceHtSupply;
	imp3.secSpaceHtSupply=secSpaceHtSupply;
	imp3.totalSpaceHtSupply=totalSpaceHtSupply;
	imp3.totalSpaceCoolingSupply=totalSpaceCoolingSupply;

	imp3.totalEnergy=totalEnergy;
	imp3.totalCost=totalCost;
	imp3.totalEmissions=totalEmissions;
	imp3.totalPrimaryEnergy=totalPrimaryEnergy;

	imp3.mainSpaceHtSupply_fuelCost=mainSpaceHtSupply_fuelCost;
	imp3.secSpaceHtSupply_fuelCost=secSpaceHtSupply_fuelCost;
	imp3.domesticHotWaterSupply_fuelCost=domesticHotWaterSupply_fuelCost;
	imp3.auxillaryElectricity_fuelCost=auxillaryElectricity_fuelCost;
	imp3.lightElectricity_fuelCost=lightElectricity_fuelCost;
	imp3.totalSpaceCoolingSupply_fuelCost=totalSpaceCoolingSupply_fuelCost;

	imp3.mainSpaceHtSupply_Emm=mainSpaceHtSupply_Emm;
	imp3.secSpaceHtSupply_Emm=secSpaceHtSupply_Emm;
	imp3.domesticHotWaterSupply_Emm=domesticHotWaterSupply_Emm;
	imp3.auxillaryElectricity_Emm=auxillaryElectricity_Emm;
	imp3.lightElectricity_Emm=lightElectricity_Emm;
	imp3.totalSpaceCoolingSupply_Emm=totalSpaceCoolingSupply_Emm;

	imp3.mainSpaceHtSupply_PrimEnergyFactor=mainSpaceHtSupply_PrimEnergyFactor;
	imp3.secSpaceHtSupply_PrimEnergyFactor=secSpaceHtSupply_PrimEnergyFactor;
	imp3.domesticHotWaterSupply_PrimEnergyFactor=domesticHotWaterSupply_PrimEnergyFactor;
	imp3.auxillaryElectricity_PrimEnergyFactor=auxillaryElectricity_PrimEnergyFactor;
	imp3.lightElectricity_PrimEnergyFactor=lightElectricity_PrimEnergyFactor;
	imp3.totalSpaceCoolingSupply_PrimEnergyFactor = totalSpaceCoolingSupply_PrimEnergyFactor;

	imp3.totalSpaceHtSupply_Disp		= totalSpaceHtSupply_Disp;
	imp3.totalSpaceCoolingSupply_Disp	=  totalSpaceCoolingSupply_Disp;
	imp3.domesticHotWaterSupply_Disp	= domesticHotWaterSupply_Disp;
	imp3.lightElectricity_Disp			= lightElectricity_Disp;
	imp3.auxillaryElectricity_Disp		= auxillaryElectricity_Disp;
	imp3.totalElectricalSupply_Disp		= totalElectricalSupply_Disp;
	imp3.mainSpaceHtSupply_Disp			= mainSpaceHtSupply_Disp;
	imp3.secSpaceHtSupply_Disp			= secSpaceHtSupply_Disp;
	imp3.LZCTelecSold_Disp				= LZCTelecSold_Disp;
	imp3.LZCTelecDisp_Disp				= LZCTelecDisp_Disp;
	
	imp3.primaryFuelUsed_Disp		= primaryFuelUsed_Disp;
	imp3.secFuelUsed_Disp			= secFuelUsed_Disp;
	imp3.primaryFuelUsed			= primaryFuelUsed;	
	imp3.secFuelUsed				= secFuelUsed;
	imp3.primaryFuelUsed_fuelCost   = primaryFuelUsed_fuelCost;	
	imp3.secFuelUsed_fuelCost       = secFuelUsed_fuelCost;
	imp3.primaryFuelUsed_Emm        = primaryFuelUsed_Emm;
	imp3.secFuelUsed_Emm            = secFuelUsed_Emm;

	//---------------------------------------------
	// GLOBAL VARIABLES FOR TC ID
	//---------------------------------------------
	// Create index number to read data from frdb.csv file
	imp3.X_exposure=X_exposure;
	imp3.I_insulation=I_insulation;
	imp3.I_insulation1=I_insulation1;
	imp3.I_insulation2=I_insulation2;
	imp3.A_ach=A_ach;
	imp3.A_ach_MVHR1=A_ach_MVHR1;
	imp3.A_ach_MVHR2=A_ach_MVHR2;
	imp3.C_capacity=C_capacity;
	imp3.S_solarGains = S_solarGains;
	imp3.O_occupantDensity=O_occupantDensity;
	imp3.L_livingAreaFraction =L_livingAreaFraction;
	imp3.XIACSOL_string  = XIACSOL_string;
	imp3.XIACSOL_string1 = XIACSOL_string1;
	imp3.XIACSOL_string2 = XIACSOL_string2;
	imp3.x_1 = x_1;
	imp3.x_2 = x_2;
	imp3.y_1 = y_1;
	imp3.y_2 = y_2;

	// String for user display
	imp3.XIACSOL_string_disp = XIACSOL_string_disp;
	imp3.XIACSOL_string_disp1 = XIACSOL_string_disp1;
	imp3.XIACSOL_string_disp2 = XIACSOL_string_disp2;

	

	//---------------------------------
	// Misc variables used in ach calc
	imp3.numOfChimneys_multip = numOfChimneys_multip;
	imp3.numOfFlues_multip =numOfFlues_multip ;
	imp3.numOfFansPassVents_multip =numOfFansPassVents_multip;
	imp3.numOfFluelessGasFires_multip=numOfFluelessGasFires_multip;
	imp3.total_solarGains=total_solarGains;

	imp3.numOfChimneys_m3perh = numOfChimneys_m3perh ;
	imp3.numOfFlues_m3perh =numOfFlues_m3perh;
	imp3.numOfFansPassVents_m3perh=numOfFansPassVents_m3perh;
	imp3.numOfFluelessGasFires_m3perh =numOfFluelessGasFires_m3perh ;
}

void CopyCurrentToImprovement4()
{
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	imp4.JobDetRefNum     = JobDetRefNum;
	imp4.assessorName     = assessorName;
	imp4.JobDetComments   = JobDetComments;
	imp4.propertyFlatNameorNum = propertyFlatNameorNum;
	imp4.propertyLetter   = propertyLetter;
	imp4.propertyHouseNum = propertyHouseNum;
	imp4.propertyStreet   = propertyStreet;
	imp4.propertyLocality = propertyLocality;
	imp4.propertyDistrict = propertyDistrict;
	imp4.propertyTown     = propertyTown;
	imp4.propertyCounty   = propertyCounty;
	imp4.propertyPostCode = propertyPostCode;
	imp4.clientFlatNameorNum = clientFlatNameorNum;
	imp4.clientLetter     = clientLetter;
	imp4.clientHouseorBlockNum = clientHouseorBlockNum;
	imp4.clientStreet     = clientStreet;
	imp4.clientLocality   = clientLocality;
	imp4.clientDistrict   = clientDistrict;
	imp4.clientTown       = clientTown;
	imp4.clientCounty     = clientCounty;
	imp4.clientPostCode   = clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	imp4.locationString = locationString;

	imp4.dwellingType = dwellingType;
	imp4.builtForm = builtForm;
	imp4.Detachment = Detachment;
	imp4.FlatPosition =FlatPosition;
	imp4.dwellingTerrain =dwellingTerrain;

	imp4.storey1Level = storey1Level;
	imp4.storey2Level = storey2Level;
	imp4.storey3Level = storey3Level;
	imp4.storey4Level = storey4Level;
	imp4.storey5Level = storey5Level;
	imp4.storey6Level = storey6Level;
	imp4.dwellingShelteredSides = dwellingShelteredSides;
	imp4.yearPropertBuilt =yearPropertBuilt; 

	imp4.storey1 = storey1;
	imp4.storey2 = storey2;
	imp4.storey3 = storey3;
	imp4.storey4 = storey4;
	imp4.storey5 = storey5;
	imp4.storey6 = storey6;

	imp4.storey1Basement = storey1Basement;
	imp4.storey2Basement = storey2Basement;
	imp4.storey3Basement = storey3Basement;
	imp4.storey4Basement = storey4Basement;
	imp4.storey5Basement = storey5Basement;
	imp4.storey6Basement = storey6Basement;

	imp4.storey1Area = storey1Area;
	imp4.storey2Area = storey2Area;
	imp4.storey3Area = storey3Area;
	imp4.storey4Area = storey4Area;
	imp4.storey5Area = storey5Area;
	imp4.storey6Area = storey6Area;

	imp4.storey1Height = storey1Height;
	imp4.storey2Height = storey2Height;
	imp4.storey3Height = storey3Height;
	imp4.storey4Height = storey4Height;
	imp4.storey5Height = storey5Height;
	imp4.storey6Height = storey6Height;
	imp4.TFAfromHEM = TFAfromHEM;

	imp4.multipleLinearRegCoeff = multipleLinearRegCoeff;
	imp4.multipleLinearRegCoeff1= multipleLinearRegCoeff1;
	imp4.multipleLinearRegCoeff2= multipleLinearRegCoeff2;
	
	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	imp4.winOvershading = winOvershading;
	imp4.winGlazing     = winGlazing;

	imp4.totalGlzArea = totalGlzArea;
	imp4.winNArea	= winNArea;
	imp4.winNEArea	= winNEArea;
	imp4.winEArea	= winEArea;
	imp4.winSEArea	= winSEArea;
	imp4.winSArea	= winSArea;
	imp4.winSWArea	= winSWArea;
	imp4.winWArea	= winWArea;
	imp4.winNWArea	= winNWArea;
	imp4.rooflightsArea = rooflightsArea;

	imp4.winNSolTrans	= winNSolTrans;
	imp4.winNESolTrans	= winNESolTrans;
	imp4.winESolTrans	= winESolTrans;
	imp4.winSESolTrans	= winSESolTrans;
	imp4.winSSolTrans	= winSSolTrans;
	imp4.winSWSolTrans	= winSWSolTrans;
	imp4.winWSolTrans	= winWSolTrans;
	imp4.winNWSolTrans	= winNWSolTrans;
	imp4.rooflightsSolTrans = rooflightsSolTrans;

	imp4.winNFrameFactor	= winNFrameFactor;
	imp4.winNEFrameFactor	= winNEFrameFactor;
	imp4.winEFrameFactor	= winEFrameFactor;
	imp4.winSEFrameFactor	= winSEFrameFactor;
	imp4.winSFrameFactor	= winSFrameFactor;
	imp4.winSWFrameFactor	= winSWFrameFactor;
	imp4.winWFrameFactor	= winWFrameFactor;
	imp4.winNWFrameFactor	= winNWFrameFactor;
	imp4.rooflightsFrameFactor = rooflightsFrameFactor;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	imp4.grossAreaWall1 = grossAreaWall1;
	imp4.groosAreaRoof1 = groosAreaRoof1;
	imp4.netAreaDoors = netAreaDoors;
	imp4.netAreaWindows = netAreaWindows;
	imp4.netAreaRoofLights = netAreaRoofLights;
	imp4.netAreaGF = netAreaGF;
	imp4.netAreaExFloor = netAreaExFloor;
	imp4.netAreaWallType1 = netAreaWallType1;
	imp4.netAreaWallType2 = netAreaWallType2;
	imp4.netAreaRoofType1 = netAreaRoofType1;
	imp4.netAreaRoofType2 = netAreaRoofType2;
	imp4.netAreaPartyWall = netAreaPartyWall;
	imp4.netAreaPartyFloor = netAreaPartyFloor;
	imp4.netAreaPartyCeiling = netAreaPartyCeiling;
	imp4.netAreaInternalWall = netAreaInternalWall;
	imp4.netAreaInternalFloor = netAreaInternalFloor;
	imp4.netAreaInternalCeiling = netAreaInternalCeiling;

	imp4.UvalueDoors = UvalueDoors;
	imp4.UvalueWindows =UvalueWindows;
	imp4.UvalueRooflights = UvalueRooflights;
	imp4.UvalueGF = UvalueGF;
	imp4.UvalueExposedFloor = UvalueExposedFloor;
	imp4.UvalueWallType1 = UvalueWallType1;
	imp4.UvalueWallType2 = UvalueWallType2;
	imp4.UvalueRoofTYpe1 = UvalueRoofTYpe1;
	imp4.UvalueRoofType2 = UvalueRoofType2;
	imp4.UvaluePartyWall = UvaluePartyWall;

	imp4.kValueGF = kValueGF;
	imp4.kValueExpFloor = kValueExpFloor;
	imp4.kValueWallType1 = kValueWallType1;
	imp4.kValueWallType2 = kValueWallType2;
	imp4.kValueRoofType1 = kValueRoofType1;
	imp4.kValueRoofType2 = kValueRoofType2;
	imp4.kValuePartyWall = kValuePartyWall;
	imp4.kValuePartyFloor = kValuePartyFloor;
	imp4.kValuePartyCeiling = kValuePartyCeiling;
	imp4.kValueIntWall = kValueIntWall;
	imp4.kValueIntFloor = kValueIntFloor;
	imp4.kValueIntCeiling = kValueIntCeiling;

	imp4.thermalMassParameter = thermalMassParameter;
	imp4.livingRoomFraction = livingRoomFraction;
	imp4.extAreaSum = extAreaSum;
	imp4.exposureValue = exposureValue;
	imp4.extInsulationValue = extInsulationValue;
	imp4.extUvalueXareaSum = extUvalueXareaSum;
	imp4.hem_extInsulationValue = hem_extInsulationValue;

	imp4.hem_extAreaSum = hem_extAreaSum;
	imp4.hem_extUvalueXareaSum = hem_extUvalueXareaSum;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	imp4.ThermBGFPerimeter = ThermBGFPerimeter;
	imp4.ThermBFloorWithingDwellinPerimeter = ThermBFloorWithingDwellinPerimeter;
	imp4.ThermBFloorBetweenDwellinPerimeter = ThermBFloorBetweenDwellinPerimeter;
	imp4.ThermBBalconyWithingDwellingLength = ThermBBalconyWithingDwellingLength;
	imp4.ThermBBalconyBetweenDwellingLength = ThermBBalconyBetweenDwellingLength;
	imp4.ThermBEavesAtCeiling = ThermBEavesAtCeiling;
	imp4.ThermBEavesAtRafter = ThermBEavesAtRafter;
	imp4.ThermBGableAtCeiling = ThermBGableAtCeiling;
	imp4.ThermBGableAtRafter = ThermBGableAtRafter;
	imp4.ThermBLengthNormalCorners = ThermBLengthNormalCorners;
	imp4.ThermBLengthInvertedCorners = ThermBLengthInvertedCorners;
	imp4.ThermBPartWallBetweenDwelling = ThermBPartWallBetweenDwelling;
	imp4.yValueEntry = yValueEntry;

	imp4.ThermBMetalBoxLintelUserDef = ThermBMetalBoxLintelUserDef;
	imp4.ThermBOtherLintelUserDef =ThermBOtherLintelUserDef;
	imp4.ThermBSillUserDef = ThermBSillUserDef;
	imp4.ThermBJambUserDef =ThermBJambUserDef;
	imp4.ThermBGFPerimeterUserDef = ThermBGFPerimeterUserDef;
	imp4.ThermBFloorWithinDwellingUserDef = ThermBFloorWithinDwellingUserDef;
	imp4.ThermBFloorBwDwellingUserDef =  ThermBFloorBwDwellingUserDef;
	imp4.ThermBBalcWithinDwellingLengthUserDef =ThermBBalcWithinDwellingLengthUserDef;
	imp4.ThermBBalcBwDwellingLengthUserDef = ThermBBalcBwDwellingLengthUserDef;
	imp4.ThermBEavesInsAtCeilingUserDef =ThermBEavesInsAtCeilingUserDef;
	imp4.ThermBEavesInsAtRafterUserDef = ThermBEavesInsAtRafterUserDef;
	imp4.ThermBGableInsAtCeilingUserDef = ThermBGableInsAtCeilingUserDef;
	imp4.ThermBGableInsAtRafetUserDef = ThermBGableInsAtRafetUserDef;
	imp4.ThermBLengthOfNormalCornersUserDef = ThermBLengthOfNormalCornersUserDef;
	imp4.ThermBLengthOfInvertedCornersUserDef =ThermBLengthOfInvertedCornersUserDef;
	imp4.ThermBPartWallBetweenDwellingUserDef = ThermBPartWallBetweenDwellingUserDef;

	imp4.ThermBMetalBoxLintelSiValue = ThermBMetalBoxLintelSiValue;
	imp4.ThermBOtherLintelsSiValue =ThermBOtherLintelsSiValue;
	imp4.ThermBSillSiValue = ThermBSillSiValue;
	imp4.ThermBJambSiValue = ThermBJambSiValue;
	imp4.ThermBGFPerimeterSiValue = ThermBGFPerimeterSiValue;
	imp4. ThermBFloorWithinDwellingSiValue =  ThermBFloorWithinDwellingSiValue;
	imp4.ThermBFloorBetweenDwellingSiValue  =ThermBFloorBetweenDwellingSiValue;
	imp4.ThermBBalconyWithinDwellingSiValue =ThermBBalconyWithinDwellingSiValue;
	imp4.ThermBBalconyBwDwellingSiValue =ThermBBalconyBwDwellingSiValue;
	imp4.ThermBEavesInsAtCelingSiValue =ThermBEavesInsAtCelingSiValue;
	imp4. ThermBEavesInsAtRafterSiValue =ThermBEavesInsAtRafterSiValue;
	imp4.ThermBGableInsAtCeilingSiValue =ThermBGableInsAtCeilingSiValue;
	imp4.ThermBGableInsAtRafterSiValue = ThermBGableInsAtRafterSiValue;
	imp4.ThermBLengthOfNormalCornersSiValue =ThermBLengthOfNormalCornersSiValue;
	imp4.ThermBLengthOfInvertedCornersSiValue =ThermBLengthOfInvertedCornersSiValue;
	imp4.ThermBPartBwDwellingLengthSiValue =ThermBPartBwDwellingLengthSiValue;

	imp4.ThermBMetalBoxLintelResult = ThermBMetalBoxLintelResult;
	imp4.ThermBOtherLintelsResult   = ThermBOtherLintelsResult;
	imp4.ThermBSillResult  =ThermBSillResult;
	imp4.ThermBJambResult =ThermBJambResult;
	imp4.ThermBGFPerimeterResult =ThermBGFPerimeterResult;
	imp4.ThermBFloorWithinDwellingPerimeterResult =ThermBFloorWithinDwellingPerimeterResult;
	imp4.ThermBFloorBetweenDwellingPerimeterResult  =ThermBFloorBetweenDwellingPerimeterResult;
	imp4.ThermBBalcWithDwellingLengthResult =ThermBBalcWithDwellingLengthResult;
	imp4.ThermBBalconyBwDwellingLengthResult = ThermBBalconyBwDwellingLengthResult;
	imp4.ThermBEavesInsCeilingResult  =ThermBEavesInsCeilingResult;
	imp4.ThermBEavesInsRafterResult = ThermBEavesInsRafterResult;
	imp4.ThermBGableInsCeilingResult = ThermBGableInsCeilingResult;
	imp4.ThermBGableInsRafterResult = ThermBGableInsRafterResult;
	imp4.ThermBLengthNormalCornersResult = ThermBLengthNormalCornersResult;
	imp4.ThermBLengthInvertedCornersResult = ThermBLengthInvertedCornersResult;
	imp4.ThermBPartyWallBwDwellingResult = ThermBPartyWallBwDwellingResult;

	imp4.thermBridgeYvalue_grossArea = thermBridgeYvalue_grossArea ;
	imp4.hem_yValueEntry = hem_yValueEntry;

	imp4.versionText = versionText;
	imp4.titleBarText = titleBarText;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	imp4.mechVentType = mechVentType;
	imp4.pressureTestYN = pressureTestYN ;
	imp4.structInf = structInf;
	imp4.floorInf =floorInf;
	imp4.draughtLobby = draughtLobby;
	imp4.perWindowDraughtStripped = perWindowDraughtStripped;
	imp4.designAirPermeability = designAirPermeability;
	imp4.pressureTestScotland= pressureTestScotland;
	imp4.accreditedDetailsScotland = accreditedDetailsScotland;
	imp4.seekExemptionForLT3Dwellings = seekExemptionForLT3Dwellings;

	imp4.designAirPermRate = designAirPermRate;
	imp4.asBuiltAirPermRate = asBuiltAirPermRate;

	imp4.airPermMeasuredInDwelling = airPermMeasuredInDwelling;
	imp4.asBuiltRef = asBuiltRef;
	imp4.asBuiltTestDate = asBuiltTestDate;

	imp4.MVHRThermalEff = MVHRThermalEff;
	imp4.mechVentValuesFrom = mechVentValuesFrom;
	imp4.numsWetRooms = numsWetRooms;
	imp4.ductInsulation = ductInsulation;
	imp4.numsOpenFirePlaces = numsOpenFirePlaces ;
	imp4.numsOpenFlues =numsOpenFlues ;
	imp4.numsFluelessGasFires = numsFluelessGasFires;

	imp4.numsExtractFans = numsExtractFans;
	imp4.numsPassiveVents = numsPassiveVents;
	imp4.isACPresent = isACPresent;
	imp4.ACEnergyUse = ACEnergyUse;
	imp4.measuredQ50 = measuredQ50;
	imp4.numOfStoreys = numOfStoreys;

	imp4.dewllingVolume = dewllingVolume;
	imp4.infiltration_rate  = infiltration_rate;
	imp4.infiltration_rate18 = infiltration_rate18;
	imp4.shelterFactor = shelterFactor;
	imp4.infiltrationRateWithshelterFactor = infiltrationRateWithshelterFactor;
	imp4.infliltrationOpenings = infliltrationOpenings;
	imp4.additionalInfiltration = additionalInfiltration;
	imp4.windowInfiltration = windowInfiltration;
	imp4.numOfShelteredSides = numOfShelteredSides;
	imp4.totalWindSpeed = totalWindSpeed;
	imp4.totalWindFactor = totalWindFactor;
	imp4.effInfiltrationRate = effInfiltrationRate;

	imp4.achThrougSystem = achThrougSystem;
	imp4.valueIfExhaustAirHP = valueIfExhaustAirHP;
	imp4.valueIfBalancedHR = valueIfBalancedHR;

	imp4.effectiveACH = effectiveACH;
	imp4.effectiveACH_MVHR = effectiveACH_MVHR;
	imp4.achMVHR1 = achMVHR1;
	imp4.achMVHR2 = achMVHR2;

	imp4.spaceHeatingDemandMVHR1 = spaceHeatingDemandMVHR1;
	imp4.spaceHeatingDemandMVHR2 = spaceHeatingDemandMVHR2;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	imp4.primaryFuelUsed = primaryFuelUsed;
    imp4.secFuelUsed     = secFuelUsed;
	imp4.primaryFuelUsedString = primaryFuelUsedString;
	imp4.secFuelUsedString     = secFuelUsedString;
	imp4.mainFuel = mainFuel;
	imp4.electricityTarrif = electricityTarrif;
	imp4.mainHtType =mainHtType;
	imp4.mainHtEffFrom = mainHtEffFrom;
	imp4.boilerType = boilerType;
	imp4.isFanFluePresent = isFanFluePresent;
	imp4.mainHtControls = mainHtControls;
	imp4.mainHtEmitter =mainHtEmitter;
	imp4.isIterlockPresent = isIterlockPresent;
	imp4.isPumpInHeatedSpace = isPumpInHeatedSpace;
	imp4.mainHtSystem = mainHtSystem;

	imp4.boilerRef =boilerRef;
	imp4.boilerModel = boilerModel;
	imp4.isSecBoilerFuelPresent= isSecBoilerFuelPresent;
	imp4.mainHtCompensator = mainHtCompensator;
	imp4.mainHtManufacturerDesc =mainHtManufacturerDesc;
	imp4.mainHtTestMethod = mainHtTestMethod;

	//imp4.mainHtEff = mainHtEff;
	imp4.mainHtEffNominal = mainHtEffNominal;//@min

	imp4.mainHtEffAdj = mainHtEffAdj;
	imp4.mainHtTempAdj = mainHtTempAdj;
	imp4.mainHtFractionSupplied = mainHtFractionSupplied;

	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	imp4.oilPumpInHeatedSpace = oilPumpInHeatedSpace;
	imp4.oilBoilerInstalled   = oilBoilerInstalled;

	imp4.isThereCHP = isThereCHP;
	imp4.CHPfuel = CHPfuel;
	imp4.CPSUoperatingTemp = CPSUoperatingTemp;

	imp4.heatEmmFromCase = heatEmmFromCase;
	imp4.heatTransferredToWater = heatTransferredToWater;
	imp4.smokeControlledArea = smokeControlledArea;

	imp4.fractOfHtFromCHP = fractOfHtFromCHP;
	imp4.elecEffOfCHP = elecEffOfCHP;
	imp4.heatingEffOfCHP = heatingEffOfCHP;

	imp4.secComBoilerFuel = secComBoilerFuel;
	imp4.secComBoilerSystem = secComBoilerSystem;
	imp4.secComBoilerEff = secComBoilerEff;
	imp4.secComBoilerFractOfHtFromBoiler2 = secComBoilerFractOfHtFromBoiler2;
	imp4.secComBoilerManufactDesc = secComBoilerManufactDesc;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	imp4.isThereSecHeating = isThereSecHeating;
	imp4.secHtEffFrom = secHtEffFrom;
	imp4.secHtFuel = secHtFuel;

	imp4.secHtOpenFlueChimney = secHtOpenFlueChimney;
	imp4.secHtUnconnectedGasPoint = secHtUnconnectedGasPoint;
	imp4.secHtSystem = secHtSystem;
	imp4.secHtManufactDesc =secHtManufactDesc;
	imp4.secHtTestMethod = secHtTestMethod;
	imp4.secHtEff = secHtEff;
	imp4.secHtFraction = secHtFraction;

	imp4.spaceHeatingEffAdj = spaceHeatingEffAdj;
	imp4.waterHeatingEffAdj = waterHeatingEffAdj;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	imp4.btnWaterHtFromMainState = btnWaterHtFromMainState;
	imp4.WHtype = WHtype;
	imp4.WHtCylinderWithinDwelling = WHtCylinderWithinDwelling ;
	imp4.WHtFuel = WHtFuel;
	imp4.WHtWaterSepTimed = WHtWaterSepTimed;

	imp4.WHtCylManufactLossFactor = WHtCylManufactLossFactor;
	imp4.WHtCylInsType = WHtCylInsType;

	imp4.WHtCylThermostat = WHtCylThermostat;
	imp4.WHtCylInHeatedSpace = WHtCylInHeatedSpace;
	imp4.WHtCylPrimaryPipeworkInsulated = WHtCylPrimaryPipeworkInsulated;
	imp4.WHtCylPumpedPrimarySystem = WHtCylPumpedPrimarySystem;

	imp4.WHtTSnCPSUinSingleUnit = WHtTSnCPSUinSingleUnit;
	imp4.WHtTSnCPSUPrimaryPipeworkLT1_5m = WHtTSnCPSUPrimaryPipeworkLT1_5m;
	imp4.WHtTSnCPSUstoreInAirCupbrd = WHtTSnCPSUstoreInAirCupbrd;

	imp4.WHtCombiKeepHotYN = WHtCombiKeepHotYN;
	imp4.DHWfromCommunityScheme =DHWfromCommunityScheme;
	imp4.DHWComSchemeSystem = DHWComSchemeSystem;
	imp4.WHtHeatPumpUsesImmer = WHtHeatPumpUsesImmer;

	imp4.WHtUsesSummerImmer = WHtUsesSummerImmer;

	imp4.WHtCylDeclaredFactor =WHtCylDeclaredFactor;
	imp4.WHtCylVolume = WHtCylVolume;
	imp4.WHtCylInsThickness =  WHtCylInsThickness;

	imp4.WHtEff = WHtEff;
	imp4.WHtEffAdj = WHtEffAdj;

	imp4.WHtCombiKeepHotUsesElec = WHtCombiKeepHotUsesElec;
	imp4.WHtCombiPowerRating = WHtCombiPowerRating;

	imp4.DHWComSchemeProvidedFrom = DHWComSchemeProvidedFrom;
	imp4.DHWComSchemeCHP2PowerRatio = DHWComSchemeCHP2PowerRatio;
	imp4.DHWComSchemeEff = DHWComSchemeEff;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	imp4.isSHWPresent = isSHWPresent;
	imp4.isPVPresent  = isPVPresent;
	imp4.isWTPresent  = isWTPresent;
	imp4.uHydroyn = uHydroyn;
	imp4.uCHPyn = uCHPyn;
	imp4.MVHRyn = MVHRyn;

	imp4.SHWCollectorType = SHWCollectorType;
	imp4.SHWCollectorOrientation = SHWCollectorOrientation;
	imp4.SHWCollectorTilt = SHWCollectorTilt;
	imp4.SHWOvershading = SHWOvershading;
	imp4.isSHWAreaGross = isSHWAreaGross;
	imp4.isSHWSolarStoreCombined = isSHWSolarStoreCombined;
	imp4.SHWSolarCircPump = SHWSolarCircPump;
	imp4.SHWApertureArea = SHWApertureArea;
	imp4.SHW_ZLCE = SHW_ZLCE;
	imp4.SHW_HeatLossCoefficient =SHW_HeatLossCoefficient;
	imp4.SHW_dedicatedSolarStorageVolumeFactor =SHW_dedicatedSolarStorageVolumeFactor;

	imp4.PVCollectorOrientation = PVCollectorOrientation;
	imp4.PVCollectorTilt = PVCollectorTilt;
	imp4.PVOvershading = PVOvershading;
	imp4.dwellingExposure = dwellingExposure;
	imp4.CHPFuel = CHPFuel;

	imp4.SHW_overshadingFactor = SHW_overshadingFactor;
	imp4.SHW_annualSolarRadiation_pm2 = SHW_annualSolarRadiation_pm2 ;
	imp4.SHW_collectorPerformanceRatio = SHW_collectorPerformanceRatio;
	imp4.SHW_solarEnergyAvailable =SHW_solarEnergyAvailable;
	imp4.SHW_apertureArea =SHW_apertureArea;

	imp4.SHW_solarToLoadRatio = SHW_solarToLoadRatio;
	imp4.SHW_collectorPerformanceFactor =SHW_collectorPerformanceFactor;
	imp4.SHW_effectiveSolarVolume =SHW_effectiveSolarVolume;
	imp4.SHW_utilizationFactor = SHW_utilizationFactor;
	imp4.N_OCC = N_OCC;
	imp4.SHW_annualHotWaterUsage = SHW_annualHotWaterUsage;
	imp4.SHW_dailyHotWaterDemand_litres = SHW_dailyHotWaterDemand_litres;
	imp4.SHW_volumeRatio = SHW_volumeRatio;
	imp4.SHW_annualSolarInput = SHW_annualSolarInput;
	imp4.SHWDedSolStoreVol =SHWDedSolStoreVol;

	imp4.isRENAdditionalElectGenerated = isRENAdditionalElectGenerated;
	imp4.RENAddiationalElecGenerated = RENAddiationalElecGenerated ;
	imp4.REN_TFA = REN_TFA;

	imp4.installedPVPeakPower = installedPVPeakPower;
	imp4.PV_overshadingFactor = PV_overshadingFactor;
	imp4.PV_annualSolarRadiation_pm2 = PV_annualSolarRadiation_pm2 ;

	imp4.WTNumOf = WTNumOf;
	imp4.WTDiameter = WTDiameter;
	imp4.WTHeight =WTHeight;
	imp4.WTs3 = WTs3;

	//---------------------------------------------------------
	// RENEWABLES 2
	//---------------------------------------------------------
	imp4.uHydroAnnualAvgHead = uHydroAnnualAvgHead;
	imp4.uHydroAnnualAvgFlow = uHydroAnnualAvgFlow;
	imp4.uHydroEff = uHydroEff;
	imp4.uHydroAnnualEnergy = uHydroAnnualEnergy;

	imp4.uCHPheatToPowerRatio = uCHPheatToPowerRatio;
	imp4.uCHPElectricEff = uCHPElectricEff;
	imp4.uCHPHeatingEff = uCHPHeatingEff;
	imp4.uCHPHeatingFraction= uCHPHeatingFraction;
	imp4.uCHPAnnualElectricity = uCHPAnnualElectricity;
	imp4.MVHRThermalEff = MVHRThermalEff;
	imp4.lambda = lambda;

	imp4.FGHRSpresent           = FGHRSpresent;
	imp4.FGHRSstore           = FGHRSstore;
	imp4.FGHRSstoreVolume     = FGHRSstoreVolume;
	imp4.FGHRSusefulFracHtRec_kf1 = FGHRSusefulFracHtRec_kf1;
	imp4.FGHRSfittedMain      = FGHRSfittedMain;
	imp4.FGHRSfittedSec       = FGHRSfittedSec;
	imp4.FGHRStype            = FGHRStype;
	imp4.determineFGHRStype   = determineFGHRStype;
	imp4.FGHRStotFracHeatRec_kf2  = FGHRStotFracHeatRec_kf2;
	imp4.FGHRSauxelec   = FGHRSauxelec;
	imp4.FGHRSpvPoweredHt     = FGHRSpvPoweredHt;
	imp4.FGHRSpvPkPower       = FGHRSpvPkPower;
	imp4.FGHRSpvOrientation = FGHRSpvOrientation;
	imp4.FGHRSpvTilt          = FGHRSpvTilt;
	imp4.FGHRSpvOvershading   = FGHRSpvOvershading;
	imp4.FGHRScableLoss       = FGHRScableLoss;

	imp4.WWHRSpresent    = WWHRSpresent;
	imp4.WWHRSnumOfRooms = WWHRSnumOfRooms;
	imp4.WWHRS1Make      = WWHRS1Make;
	imp4.WWHRSnumMixerShowersWithBath1    = WWHRSnumMixerShowersWithBath1;
	imp4.WWHRSnumMixerShowersWithoutBath1 = WWHRSnumMixerShowersWithoutBath1;
	imp4.WWHRS1Model = WWHRS1Model;
	imp4.WWHRS1ModelQualifier = WWHRS1ModelQualifier;
	imp4.WWHRS2Make                       = WWHRS2Make;
	imp4.WWHRSnumMixerShowersWithBath2    = WWHRSnumMixerShowersWithBath2;
	imp4.WWHRSnumMixerShowersWithoutBath2 = WWHRSnumMixerShowersWithoutBath2;
	imp4.WWHRS2Model                      = WWHRS2Model;
	imp4.WWHRS2ModelQualifier             = WWHRS2ModelQualifier;
	//---------------------------------------------------------
	// Factor for LZCT
	//---------------------------------------------------------
	imp4.B_PV = B_PV;
	imp4.B_WT = B_WT;
	imp4.B_uHydro = B_uHydro;
	imp4.B_uCHP = B_uCHP;
	imp4.annualEnergy_PV = annualEnergy_PV;
	imp4.WTsupplyInput = WTsupplyInput;
	imp4.uHydrosupplyInput =uHydrosupplyInput;
	imp4.uCHPsupplyInput = uCHPsupplyInput;

	imp4.LZCT_elecDisplaced = LZCT_elecDisplaced;
	imp4.LZCT_elecSold =LZCT_elecSold;
	imp4.totalElectricalSupply = totalElectricalSupply;

	//-------------------------------------------------------
	// LIGHTS GLOBAL VARIABLES
	//-------------------------------------------------------
	imp4.fractionLEL =fractionLEL;

	//---------------------------------------------
	// SUMMER OVER HEATING GLOBAL VARIABLES
	//---------------------------------------------
	imp4.isTMPUserDef = isTMPUserDef;
	imp4.TMPvalue =  TMPvalue;
	imp4.TMPIntPartConstruction=TMPIntPartConstruction;
	imp4.TMPPartyWallConstruction=TMPPartyWallConstruction;
	imp4.isVentUserDefined=isVentUserDefined;
	imp4.airChangeRate=airChangeRate;
	imp4.isCrossVentOnMostFloors=isCrossVentOnMostFloors;
	imp4.windowVentilation=windowVentilation;
	imp4.areCurtainsClosedDuringDay=areCurtainsClosedDuringDay;
	imp4.fractCurtainsClosed=fractCurtainsClosed;
	imp4.blindCurtainType=blindCurtainType;
	imp4.sourceUserDefValues=sourceUserDefValues;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	imp4.chkInsulation  = chkInsulation;
	imp4.chkAirtightness = chkAirtightness;
	imp4.chkCapacity = chkCapacity;
	imp4.chkSolarIngress =chkSolarIngress;
	imp4.chkOccupancy = chkOccupancy;
	imp4.chkControlledSpace= chkControlledSpace;
	imp4.chkSDHW=chkSDHW;
	imp4.chkPV=chkPV;
	imp4.chkWT=chkWT;
	imp4.chkuCHP=chkuCHP;
	imp4.chkuHydro=chkuHydro;
	imp4.chkPCM=chkPCM;
	imp4.chkMVHR=chkMVHR;
	imp4.chkFGHRS = chkFGHRS;
	imp4.chkWWHRS = chkWWHRS;

	imp4.hemHouseType=hemHouseType;
	imp4.hemYearOfBuild=hemYearOfBuild;
	imp4.hemCoolingFuel=hemCoolingFuel;
	imp4.hemCoolingEff=hemCoolingEff;

	imp4.hemX_exposure=hemX_exposure;
	imp4.hemI_insulation=hemI_insulation;
	imp4.hemI_insulation1=hemI_insulation1;
	imp4.hemI_insulation2=hemI_insulation2;
	imp4.hemA_ach=hemA_ach;
	imp4.hemC_capacity=hemC_capacity;
	imp4.hemS_solarGains=hemS_solarGains;
	imp4.hemO_occupantDensity=hemO_occupantDensity;
	imp4.hemL_livingAreaFraction=hemL_livingAreaFraction;
	imp4.hemXIACSOL_string=hemXIACSOL_string;
	imp4.hemXIACSOL_string1=hemXIACSOL_string1;
	imp4.hemXIACSOL_string2=hemXIACSOL_string2;
	imp4.hemx_1 =hemx_1;
	imp4.hemx_2 =hemx_2;
	imp4.hemy_1 = hemy_1;
	imp4.hemy_2 =hemy_2;
	imp4.hemTFA =hemTFA;

	imp4.hemI_insulationSliderPos = hemI_insulationSliderPos;
	imp4.hemA_achSliderPos = hemA_achSliderPos;
	imp4.hemC_capacitySliderPos =hemC_capacitySliderPos;
	imp4.hemS_solarGainsSliderPos = hemS_solarGainsSliderPos;
	imp4.hemO_OCCDensitySliderPos=hemO_OCCDensitySliderPos;
	imp4.hemL_LAFracSliderPos=hemL_LAFracSliderPos;

	imp4.iStat=iStat;
	imp4.dwellingVoulme=dwellingVoulme;
	imp4.SFP=SFP;
	imp4.auxillaryElectricity=auxillaryElectricity;

	imp4.numOfOccupants=numOfOccupants;
	imp4.TFA=TFA;
	imp4.TFAfromHEM=TFAfromHEM;
	imp4.EB=EB;
	imp4.C1=C1;
	imp4.ZL=ZL;
	imp4.gL=gL;
	imp4.GL_total=GL_total;
	imp4.C2=C2;
	imp4.lightElectricity=lightElectricity;

	imp4.Vd_avg=Vd_avg;
	imp4.DHW_energy=DHW_energy;
	imp4.distributionLoss=distributionLoss;
	imp4.winterOpTemp=winterOpTemp;
	imp4.tempFactor=tempFactor;
	imp4.storageLoss=storageLoss;
	imp4.lossFactor=lossFactor;
	imp4.tankVolume=tankVolume;
	imp4.volumeFacor=volumeFacor;
	imp4.heatLossFactor=heatLossFactor;
	imp4.srorageLoss=srorageLoss;
	imp4.primaryCircuitLoss=primaryCircuitLoss;
	imp4.F_u=F_u;
	imp4.combiLoss=combiLoss;
	imp4.solarDHWInput=solarDHWInput;

	imp4.pvSupplyInput=pvSupplyInput;

	imp4.domesticHotWaterSupply=domesticHotWaterSupply;
	imp4.spaceHeatingDemand=spaceHeatingDemand;
	imp4.totalRenElecSupply=totalRenElecSupply;
	imp4.totalRenElecSupply_fuelCost = totalRenElecSupply_fuelCost;
	imp4.totalRenElecSupply_Emm=totalRenElecSupply_Emm;
	imp4.totalRenElecSupply_PrimEnergyFactor=totalRenElecSupply_PrimEnergyFactor;

	imp4.enterYValue=enterYValue;
	imp4.mainSpaceHtSupply=mainSpaceHtSupply;
	imp4.secSpaceHtSupply=secSpaceHtSupply;
	imp4.totalSpaceHtSupply=totalSpaceHtSupply;
	imp4.totalSpaceCoolingSupply=totalSpaceCoolingSupply;

	imp4.totalEnergy=totalEnergy;
	imp4.totalCost=totalCost;
	imp4.totalEmissions=totalEmissions;
	imp4.totalPrimaryEnergy=totalPrimaryEnergy;

	imp4.mainSpaceHtSupply_fuelCost=mainSpaceHtSupply_fuelCost;
	imp4.secSpaceHtSupply_fuelCost=secSpaceHtSupply_fuelCost;
	imp4.domesticHotWaterSupply_fuelCost=domesticHotWaterSupply_fuelCost;
	imp4.auxillaryElectricity_fuelCost=auxillaryElectricity_fuelCost;
	imp4.lightElectricity_fuelCost=lightElectricity_fuelCost;
	imp4.totalSpaceCoolingSupply_fuelCost=totalSpaceCoolingSupply_fuelCost;

	imp4.mainSpaceHtSupply_Emm=mainSpaceHtSupply_Emm;
	imp4.secSpaceHtSupply_Emm=secSpaceHtSupply_Emm;
	imp4.domesticHotWaterSupply_Emm=domesticHotWaterSupply_Emm;
	imp4.auxillaryElectricity_Emm=auxillaryElectricity_Emm;
	imp4.lightElectricity_Emm=lightElectricity_Emm;
	imp4.totalSpaceCoolingSupply_Emm=totalSpaceCoolingSupply_Emm;

	imp4.mainSpaceHtSupply_PrimEnergyFactor=mainSpaceHtSupply_PrimEnergyFactor;
	imp4.secSpaceHtSupply_PrimEnergyFactor=secSpaceHtSupply_PrimEnergyFactor;
	imp4.domesticHotWaterSupply_PrimEnergyFactor=domesticHotWaterSupply_PrimEnergyFactor;
	imp4.auxillaryElectricity_PrimEnergyFactor=auxillaryElectricity_PrimEnergyFactor;
	imp4.lightElectricity_PrimEnergyFactor=lightElectricity_PrimEnergyFactor;
	imp4.totalSpaceCoolingSupply_PrimEnergyFactor = totalSpaceCoolingSupply_PrimEnergyFactor;

	imp4.totalSpaceHtSupply_Disp		= totalSpaceHtSupply_Disp;
	imp4.totalSpaceCoolingSupply_Disp	=  totalSpaceCoolingSupply_Disp;
	imp4.domesticHotWaterSupply_Disp	= domesticHotWaterSupply_Disp;
	imp4.lightElectricity_Disp			= lightElectricity_Disp;
	imp4.auxillaryElectricity_Disp		= auxillaryElectricity_Disp;
	imp4.totalElectricalSupply_Disp		= totalElectricalSupply_Disp;
	imp4.mainSpaceHtSupply_Disp			= mainSpaceHtSupply_Disp;
	imp4.secSpaceHtSupply_Disp			= secSpaceHtSupply_Disp;
	imp4.LZCTelecSold_Disp				= LZCTelecSold_Disp;
	imp4.LZCTelecDisp_Disp				= LZCTelecDisp_Disp;
	
	imp4.primaryFuelUsed_Disp		= primaryFuelUsed_Disp;
	imp4.secFuelUsed_Disp			= secFuelUsed_Disp;
	imp4.primaryFuelUsed			= primaryFuelUsed;	
	imp4.secFuelUsed				= secFuelUsed;
	imp4.primaryFuelUsed_fuelCost   = primaryFuelUsed_fuelCost;	
	imp4.secFuelUsed_fuelCost       = secFuelUsed_fuelCost;
	imp4.primaryFuelUsed_Emm        = primaryFuelUsed_Emm;
	imp4.secFuelUsed_Emm            = secFuelUsed_Emm;
	//---------------------------------------------
	// GLOBAL VARIABLES FOR TC ID
	//---------------------------------------------
	// Create index number to read data from frdb.csv file
	imp4.X_exposure=X_exposure;
	imp4.I_insulation=I_insulation;
	imp4.I_insulation1=I_insulation1;
	imp4.I_insulation2=I_insulation2;
	imp4.A_ach=A_ach;
	imp4.A_ach_MVHR1=A_ach_MVHR1;
	imp4.A_ach_MVHR2=A_ach_MVHR2;
	imp4.C_capacity=C_capacity;
	imp4.S_solarGains = S_solarGains;
	imp4.O_occupantDensity=O_occupantDensity;
	imp4.L_livingAreaFraction =L_livingAreaFraction;
	imp4.XIACSOL_string  = XIACSOL_string;
	imp4.XIACSOL_string1 = XIACSOL_string1;
	imp4.XIACSOL_string2 = XIACSOL_string2;
	imp4.x_1 = x_1;
	imp4.x_2 = x_2;
	imp4.y_1 = y_1;
	imp4.y_2 = y_2;

	// String for user display
	imp4.XIACSOL_string_disp = XIACSOL_string_disp;
	imp4.XIACSOL_string_disp1 = XIACSOL_string_disp1;
	imp4.XIACSOL_string_disp2 = XIACSOL_string_disp2;

	

	//---------------------------------
	// Misc variables used in ach calc
	imp4.numOfChimneys_multip = numOfChimneys_multip;
	imp4.numOfFlues_multip =numOfFlues_multip ;
	imp4.numOfFansPassVents_multip =numOfFansPassVents_multip;
	imp4.numOfFluelessGasFires_multip=numOfFluelessGasFires_multip;
	imp4.total_solarGains=total_solarGains;

	imp4.numOfChimneys_m3perh = numOfChimneys_m3perh ;
	imp4.numOfFlues_m3perh =numOfFlues_m3perh;
	imp4.numOfFansPassVents_m3perh=numOfFansPassVents_m3perh;
	imp4.numOfFluelessGasFires_m3perh =numOfFluelessGasFires_m3perh ;
}

void CopyCurrentToImprovement5()
{
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	imp5.JobDetRefNum     = JobDetRefNum;
	imp5.assessorName     = assessorName;
	imp5.JobDetComments   = JobDetComments;
	imp5.propertyFlatNameorNum = propertyFlatNameorNum;
	imp5.propertyLetter   = propertyLetter;
	imp5.propertyHouseNum = propertyHouseNum;
	imp5.propertyStreet   = propertyStreet;
	imp5.propertyLocality = propertyLocality;
	imp5.propertyDistrict = propertyDistrict;
	imp5.propertyTown     = propertyTown;
	imp5.propertyCounty   = propertyCounty;
	imp5.propertyPostCode = propertyPostCode;
	imp5.clientFlatNameorNum = clientFlatNameorNum;
	imp5.clientLetter     = clientLetter;
	imp5.clientHouseorBlockNum = clientHouseorBlockNum;
	imp5.clientStreet     = clientStreet;
	imp5.clientLocality   = clientLocality;
	imp5.clientDistrict   = clientDistrict;
	imp5.clientTown       = clientTown;
	imp5.clientCounty     = clientCounty;
	imp5.clientPostCode   = clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	imp5.locationString = locationString;

	imp5.dwellingType = dwellingType;
	imp5.builtForm = builtForm;
	imp5.Detachment = Detachment;
	imp5.FlatPosition =FlatPosition;
	imp5.dwellingTerrain =dwellingTerrain;

	imp5.storey1Level = storey1Level;
	imp5.storey2Level = storey2Level;
	imp5.storey3Level = storey3Level;
	imp5.storey4Level = storey4Level;
	imp5.storey5Level = storey5Level;
	imp5.storey6Level = storey6Level;
	imp5.dwellingShelteredSides = dwellingShelteredSides;
	imp5.yearPropertBuilt =yearPropertBuilt; 

	imp5.storey1 = storey1;
	imp5.storey2 = storey2;
	imp5.storey3 = storey3;
	imp5.storey4 = storey4;
	imp5.storey5 = storey5;
	imp5.storey6 = storey6;

	imp5.storey1Basement = storey1Basement;
	imp5.storey2Basement = storey2Basement;
	imp5.storey3Basement = storey3Basement;
	imp5.storey4Basement = storey4Basement;
	imp5.storey5Basement = storey5Basement;
	imp5.storey6Basement = storey6Basement;

	imp5.storey1Area = storey1Area;
	imp5.storey2Area = storey2Area;
	imp5.storey3Area = storey3Area;
	imp5.storey4Area = storey4Area;
	imp5.storey5Area = storey5Area;
	imp5.storey6Area = storey6Area;

	imp5.storey1Height = storey1Height;
	imp5.storey2Height = storey2Height;
	imp5.storey3Height = storey3Height;
	imp5.storey4Height = storey4Height;
	imp5.storey5Height = storey5Height;
	imp5.storey6Height = storey6Height;
	imp5.TFAfromHEM = TFAfromHEM;

	imp5.multipleLinearRegCoeff = multipleLinearRegCoeff;
	imp5.multipleLinearRegCoeff1= multipleLinearRegCoeff1;
	imp5.multipleLinearRegCoeff2= multipleLinearRegCoeff2;
	
	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	imp5.winOvershading = winOvershading;
	imp5.winGlazing     = winGlazing;

	imp5.totalGlzArea = totalGlzArea;
	imp5.winNArea	= winNArea;
	imp5.winNEArea	= winNEArea;
	imp5.winEArea	= winEArea;
	imp5.winSEArea	= winSEArea;
	imp5.winSArea	= winSArea;
	imp5.winSWArea	= winSWArea;
	imp5.winWArea	= winWArea;
	imp5.winNWArea	= winNWArea;
	imp5.rooflightsArea = rooflightsArea;

	imp5.winNSolTrans	= winNSolTrans;
	imp5.winNESolTrans	= winNESolTrans;
	imp5.winESolTrans	= winESolTrans;
	imp5.winSESolTrans	= winSESolTrans;
	imp5.winSSolTrans	= winSSolTrans;
	imp5.winSWSolTrans	= winSWSolTrans;
	imp5.winWSolTrans	= winWSolTrans;
	imp5.winNWSolTrans	= winNWSolTrans;
	imp5.rooflightsSolTrans = rooflightsSolTrans;

	imp5.winNFrameFactor	= winNFrameFactor;
	imp5.winNEFrameFactor	= winNEFrameFactor;
	imp5.winEFrameFactor	= winEFrameFactor;
	imp5.winSEFrameFactor	= winSEFrameFactor;
	imp5.winSFrameFactor	= winSFrameFactor;
	imp5.winSWFrameFactor	= winSWFrameFactor;
	imp5.winWFrameFactor	= winWFrameFactor;
	imp5.winNWFrameFactor	= winNWFrameFactor;
	imp5.rooflightsFrameFactor = rooflightsFrameFactor;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	imp5.grossAreaWall1 = grossAreaWall1;
	imp5.groosAreaRoof1 = groosAreaRoof1;
	imp5.netAreaDoors = netAreaDoors;
	imp5.netAreaWindows = netAreaWindows;
	imp5.netAreaRoofLights = netAreaRoofLights;
	imp5.netAreaGF = netAreaGF;
	imp5.netAreaExFloor = netAreaExFloor;
	imp5.netAreaWallType1 = netAreaWallType1;
	imp5.netAreaWallType2 = netAreaWallType2;
	imp5.netAreaRoofType1 = netAreaRoofType1;
	imp5.netAreaRoofType2 = netAreaRoofType2;
	imp5.netAreaPartyWall = netAreaPartyWall;
	imp5.netAreaPartyFloor = netAreaPartyFloor;
	imp5.netAreaPartyCeiling = netAreaPartyCeiling;
	imp5.netAreaInternalWall = netAreaInternalWall;
	imp5.netAreaInternalFloor = netAreaInternalFloor;
	imp5.netAreaInternalCeiling = netAreaInternalCeiling;

	imp5.UvalueDoors = UvalueDoors;
	imp5.UvalueWindows =UvalueWindows;
	imp5.UvalueRooflights = UvalueRooflights;
	imp5.UvalueGF = UvalueGF;
	imp5.UvalueExposedFloor = UvalueExposedFloor;
	imp5.UvalueWallType1 = UvalueWallType1;
	imp5.UvalueWallType2 = UvalueWallType2;
	imp5.UvalueRoofTYpe1 = UvalueRoofTYpe1;
	imp5.UvalueRoofType2 = UvalueRoofType2;
	imp5.UvaluePartyWall = UvaluePartyWall;

	imp5.kValueGF = kValueGF;
	imp5.kValueExpFloor = kValueExpFloor;
	imp5.kValueWallType1 = kValueWallType1;
	imp5.kValueWallType2 = kValueWallType2;
	imp5.kValueRoofType1 = kValueRoofType1;
	imp5.kValueRoofType2 = kValueRoofType2;
	imp5.kValuePartyWall = kValuePartyWall;
	imp5.kValuePartyFloor = kValuePartyFloor;
	imp5.kValuePartyCeiling = kValuePartyCeiling;
	imp5.kValueIntWall = kValueIntWall;
	imp5.kValueIntFloor = kValueIntFloor;
	imp5.kValueIntCeiling = kValueIntCeiling;

	imp5.thermalMassParameter = thermalMassParameter;
	imp5.livingRoomFraction = livingRoomFraction;
	imp5.extAreaSum = extAreaSum;
	imp5.exposureValue = exposureValue;
	imp5.extInsulationValue = extInsulationValue;
	imp5.extUvalueXareaSum = extUvalueXareaSum;
	imp5.hem_extInsulationValue = hem_extInsulationValue;

	imp5.hem_extAreaSum = hem_extAreaSum;
	imp5.hem_extUvalueXareaSum = hem_extUvalueXareaSum;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	imp5.ThermBGFPerimeter = ThermBGFPerimeter;
	imp5.ThermBFloorWithingDwellinPerimeter = ThermBFloorWithingDwellinPerimeter;
	imp5.ThermBFloorBetweenDwellinPerimeter = ThermBFloorBetweenDwellinPerimeter;
	imp5.ThermBBalconyWithingDwellingLength = ThermBBalconyWithingDwellingLength;
	imp5.ThermBBalconyBetweenDwellingLength = ThermBBalconyBetweenDwellingLength;
	imp5.ThermBEavesAtCeiling = ThermBEavesAtCeiling;
	imp5.ThermBEavesAtRafter = ThermBEavesAtRafter;
	imp5.ThermBGableAtCeiling = ThermBGableAtCeiling;
	imp5.ThermBGableAtRafter = ThermBGableAtRafter;
	imp5.ThermBLengthNormalCorners = ThermBLengthNormalCorners;
	imp5.ThermBLengthInvertedCorners = ThermBLengthInvertedCorners;
	imp5.ThermBPartWallBetweenDwelling = ThermBPartWallBetweenDwelling;
	imp5.yValueEntry = yValueEntry;

	imp5.ThermBMetalBoxLintelUserDef = ThermBMetalBoxLintelUserDef;
	imp5.ThermBOtherLintelUserDef =ThermBOtherLintelUserDef;
	imp5.ThermBSillUserDef = ThermBSillUserDef;
	imp5.ThermBJambUserDef =ThermBJambUserDef;
	imp5.ThermBGFPerimeterUserDef = ThermBGFPerimeterUserDef;
	imp5.ThermBFloorWithinDwellingUserDef = ThermBFloorWithinDwellingUserDef;
	imp5.ThermBFloorBwDwellingUserDef =  ThermBFloorBwDwellingUserDef;
	imp5.ThermBBalcWithinDwellingLengthUserDef =ThermBBalcWithinDwellingLengthUserDef;
	imp5.ThermBBalcBwDwellingLengthUserDef = ThermBBalcBwDwellingLengthUserDef;
	imp5.ThermBEavesInsAtCeilingUserDef =ThermBEavesInsAtCeilingUserDef;
	imp5.ThermBEavesInsAtRafterUserDef = ThermBEavesInsAtRafterUserDef;
	imp5.ThermBGableInsAtCeilingUserDef = ThermBGableInsAtCeilingUserDef;
	imp5.ThermBGableInsAtRafetUserDef = ThermBGableInsAtRafetUserDef;
	imp5.ThermBLengthOfNormalCornersUserDef = ThermBLengthOfNormalCornersUserDef;
	imp5.ThermBLengthOfInvertedCornersUserDef =ThermBLengthOfInvertedCornersUserDef;
	imp5.ThermBPartWallBetweenDwellingUserDef = ThermBPartWallBetweenDwellingUserDef;

	imp5.ThermBMetalBoxLintelSiValue = ThermBMetalBoxLintelSiValue;
	imp5.ThermBOtherLintelsSiValue =ThermBOtherLintelsSiValue;
	imp5.ThermBSillSiValue = ThermBSillSiValue;
	imp5.ThermBJambSiValue = ThermBJambSiValue;
	imp5.ThermBGFPerimeterSiValue = ThermBGFPerimeterSiValue;
	imp5. ThermBFloorWithinDwellingSiValue =  ThermBFloorWithinDwellingSiValue;
	imp5.ThermBFloorBetweenDwellingSiValue  =ThermBFloorBetweenDwellingSiValue;
	imp5.ThermBBalconyWithinDwellingSiValue =ThermBBalconyWithinDwellingSiValue;
	imp5.ThermBBalconyBwDwellingSiValue =ThermBBalconyBwDwellingSiValue;
	imp5.ThermBEavesInsAtCelingSiValue =ThermBEavesInsAtCelingSiValue;
	imp5. ThermBEavesInsAtRafterSiValue =ThermBEavesInsAtRafterSiValue;
	imp5.ThermBGableInsAtCeilingSiValue =ThermBGableInsAtCeilingSiValue;
	imp5.ThermBGableInsAtRafterSiValue = ThermBGableInsAtRafterSiValue;
	imp5.ThermBLengthOfNormalCornersSiValue =ThermBLengthOfNormalCornersSiValue;
	imp5.ThermBLengthOfInvertedCornersSiValue =ThermBLengthOfInvertedCornersSiValue;
	imp5.ThermBPartBwDwellingLengthSiValue =ThermBPartBwDwellingLengthSiValue;

	imp5.ThermBMetalBoxLintelResult = ThermBMetalBoxLintelResult;
	imp5.ThermBOtherLintelsResult   = ThermBOtherLintelsResult;
	imp5.ThermBSillResult  =ThermBSillResult;
	imp5.ThermBJambResult =ThermBJambResult;
	imp5.ThermBGFPerimeterResult =ThermBGFPerimeterResult;
	imp5.ThermBFloorWithinDwellingPerimeterResult =ThermBFloorWithinDwellingPerimeterResult;
	imp5.ThermBFloorBetweenDwellingPerimeterResult  =ThermBFloorBetweenDwellingPerimeterResult;
	imp5.ThermBBalcWithDwellingLengthResult =ThermBBalcWithDwellingLengthResult;
	imp5.ThermBBalconyBwDwellingLengthResult = ThermBBalconyBwDwellingLengthResult;
	imp5.ThermBEavesInsCeilingResult  =ThermBEavesInsCeilingResult;
	imp5.ThermBEavesInsRafterResult = ThermBEavesInsRafterResult;
	imp5.ThermBGableInsCeilingResult = ThermBGableInsCeilingResult;
	imp5.ThermBGableInsRafterResult = ThermBGableInsRafterResult;
	imp5.ThermBLengthNormalCornersResult = ThermBLengthNormalCornersResult;
	imp5.ThermBLengthInvertedCornersResult = ThermBLengthInvertedCornersResult;
	imp5.ThermBPartyWallBwDwellingResult = ThermBPartyWallBwDwellingResult;

	imp5.thermBridgeYvalue_grossArea = thermBridgeYvalue_grossArea ;
	imp5.hem_yValueEntry = hem_yValueEntry;

	imp5.versionText = versionText;
	imp5.titleBarText = titleBarText;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	imp5.mechVentType = mechVentType;
	imp5.pressureTestYN = pressureTestYN ;
	imp5.structInf = structInf;
	imp5.floorInf =floorInf;
	imp5.draughtLobby = draughtLobby;
	imp5.perWindowDraughtStripped = perWindowDraughtStripped;
	imp5.designAirPermeability = designAirPermeability;
	imp5.pressureTestScotland= pressureTestScotland;
	imp5.accreditedDetailsScotland = accreditedDetailsScotland;
	imp5.seekExemptionForLT3Dwellings = seekExemptionForLT3Dwellings;

	imp5.designAirPermRate = designAirPermRate;
	imp5.asBuiltAirPermRate = asBuiltAirPermRate;

	imp5.airPermMeasuredInDwelling = airPermMeasuredInDwelling;
	imp5.asBuiltRef = asBuiltRef;
	imp5.asBuiltTestDate = asBuiltTestDate;

	imp5.MVHRThermalEff = MVHRThermalEff;
	imp5.mechVentValuesFrom = mechVentValuesFrom;
	imp5.numsWetRooms = numsWetRooms;
	imp5.ductInsulation = ductInsulation;
	imp5.numsOpenFirePlaces = numsOpenFirePlaces ;
	imp5.numsOpenFlues =numsOpenFlues ;
	imp5.numsFluelessGasFires = numsFluelessGasFires;

	imp5.numsExtractFans = numsExtractFans;
	imp5.numsPassiveVents = numsPassiveVents;
	imp5.isACPresent = isACPresent;
	imp5.ACEnergyUse = ACEnergyUse;
	imp5.measuredQ50 = measuredQ50;
	imp5.numOfStoreys = numOfStoreys;

	imp5.dewllingVolume = dewllingVolume;
	imp5.infiltration_rate  = infiltration_rate;
	imp5.infiltration_rate18 = infiltration_rate18;
	imp5.shelterFactor = shelterFactor;
	imp5.infiltrationRateWithshelterFactor = infiltrationRateWithshelterFactor;
	imp5.infliltrationOpenings = infliltrationOpenings;
	imp5.additionalInfiltration = additionalInfiltration;
	imp5.windowInfiltration = windowInfiltration;
	imp5.numOfShelteredSides = numOfShelteredSides;
	imp5.totalWindSpeed = totalWindSpeed;
	imp5.totalWindFactor = totalWindFactor;
	imp5.effInfiltrationRate = effInfiltrationRate;

	imp5.achThrougSystem = achThrougSystem;
	imp5.valueIfExhaustAirHP = valueIfExhaustAirHP;
	imp5.valueIfBalancedHR = valueIfBalancedHR;

	imp5.effectiveACH = effectiveACH;
	imp5.effectiveACH_MVHR = effectiveACH_MVHR;
	imp5.achMVHR1 = achMVHR1;
	imp5.achMVHR2 = achMVHR2;

	imp5.spaceHeatingDemandMVHR1 = spaceHeatingDemandMVHR1;
	imp5.spaceHeatingDemandMVHR2 = spaceHeatingDemandMVHR2;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	imp5.primaryFuelUsed = primaryFuelUsed;
    imp5.secFuelUsed     = secFuelUsed;
	imp5.primaryFuelUsedString = primaryFuelUsedString;
	imp5.secFuelUsedString     = secFuelUsedString;
	imp5.mainFuel = mainFuel;
	imp5.electricityTarrif = electricityTarrif;
	imp5.mainHtType =mainHtType;
	imp5.mainHtEffFrom = mainHtEffFrom;
	imp5.boilerType = boilerType;
	imp5.isFanFluePresent = isFanFluePresent;
	imp5.mainHtControls = mainHtControls;
	imp5.mainHtEmitter =mainHtEmitter;
	imp5.isIterlockPresent = isIterlockPresent;
	imp5.isPumpInHeatedSpace = isPumpInHeatedSpace;
	imp5.mainHtSystem = mainHtSystem;

	imp5.boilerRef =boilerRef;
	imp5.boilerModel = boilerModel;
	imp5.isSecBoilerFuelPresent= isSecBoilerFuelPresent;
	imp5.mainHtCompensator = mainHtCompensator;
	imp5.mainHtManufacturerDesc =mainHtManufacturerDesc;
	imp5.mainHtTestMethod = mainHtTestMethod;

	//imp5.mainHtEff = mainHtEff;
	imp5.mainHtEffNominal = mainHtEffNominal;//@min

	imp5.mainHtEffAdj = mainHtEffAdj;
	imp5.mainHtTempAdj = mainHtTempAdj;
	imp5.mainHtFractionSupplied = mainHtFractionSupplied;

	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	imp5.oilPumpInHeatedSpace = oilPumpInHeatedSpace;
	imp5.oilBoilerInstalled   = oilBoilerInstalled;

	imp5.isThereCHP = isThereCHP;
	imp5.CHPfuel = CHPfuel;
	imp5.CPSUoperatingTemp = CPSUoperatingTemp;

	imp5.heatEmmFromCase = heatEmmFromCase;
	imp5.heatTransferredToWater = heatTransferredToWater;
	imp5.smokeControlledArea = smokeControlledArea;

	imp5.fractOfHtFromCHP = fractOfHtFromCHP;
	imp5.elecEffOfCHP = elecEffOfCHP;
	imp5.heatingEffOfCHP = heatingEffOfCHP;

	imp5.secComBoilerFuel = secComBoilerFuel;
	imp5.secComBoilerSystem = secComBoilerSystem;
	imp5.secComBoilerEff = secComBoilerEff;
	imp5.secComBoilerFractOfHtFromBoiler2 = secComBoilerFractOfHtFromBoiler2;
	imp5.secComBoilerManufactDesc = secComBoilerManufactDesc;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	imp5.isThereSecHeating = isThereSecHeating;
	imp5.secHtEffFrom = secHtEffFrom;
	imp5.secHtFuel = secHtFuel;

	imp5.secHtOpenFlueChimney = secHtOpenFlueChimney;
	imp5.secHtUnconnectedGasPoint = secHtUnconnectedGasPoint;
	imp5.secHtSystem = secHtSystem;
	imp5.secHtManufactDesc =secHtManufactDesc;
	imp5.secHtTestMethod = secHtTestMethod;
	imp5.secHtEff = secHtEff;
	imp5.secHtFraction = secHtFraction;

	imp5.spaceHeatingEffAdj = spaceHeatingEffAdj;
	imp5.waterHeatingEffAdj = waterHeatingEffAdj;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	imp5.btnWaterHtFromMainState = btnWaterHtFromMainState;
	imp5.WHtype = WHtype;
	imp5.WHtCylinderWithinDwelling = WHtCylinderWithinDwelling ;
	imp5.WHtFuel = WHtFuel;
	imp5.WHtWaterSepTimed = WHtWaterSepTimed;

	imp5.WHtCylManufactLossFactor = WHtCylManufactLossFactor;
	imp5.WHtCylInsType = WHtCylInsType;

	imp5.WHtCylThermostat = WHtCylThermostat;
	imp5.WHtCylInHeatedSpace = WHtCylInHeatedSpace;
	imp5.WHtCylPrimaryPipeworkInsulated = WHtCylPrimaryPipeworkInsulated;
	imp5.WHtCylPumpedPrimarySystem = WHtCylPumpedPrimarySystem;

	imp5.WHtTSnCPSUinSingleUnit = WHtTSnCPSUinSingleUnit;
	imp5.WHtTSnCPSUPrimaryPipeworkLT1_5m = WHtTSnCPSUPrimaryPipeworkLT1_5m;
	imp5.WHtTSnCPSUstoreInAirCupbrd = WHtTSnCPSUstoreInAirCupbrd;

	imp5.WHtCombiKeepHotYN = WHtCombiKeepHotYN;
	imp5.DHWfromCommunityScheme =DHWfromCommunityScheme;
	imp5.DHWComSchemeSystem = DHWComSchemeSystem;
	imp5.WHtHeatPumpUsesImmer = WHtHeatPumpUsesImmer;

	imp5.WHtUsesSummerImmer = WHtUsesSummerImmer;

	imp5.WHtCylDeclaredFactor =WHtCylDeclaredFactor;
	imp5.WHtCylVolume = WHtCylVolume;
	imp5.WHtCylInsThickness =  WHtCylInsThickness;

	imp5.WHtEff = WHtEff;
	imp5.WHtEffAdj = WHtEffAdj;

	imp5.WHtCombiKeepHotUsesElec = WHtCombiKeepHotUsesElec;
	imp5.WHtCombiPowerRating = WHtCombiPowerRating;

	imp5.DHWComSchemeProvidedFrom = DHWComSchemeProvidedFrom;
	imp5.DHWComSchemeCHP2PowerRatio = DHWComSchemeCHP2PowerRatio;
	imp5.DHWComSchemeEff = DHWComSchemeEff;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	imp5.isSHWPresent = isSHWPresent;
	imp5.isPVPresent  = isPVPresent;
	imp5.isWTPresent  = isWTPresent;
	imp5.uHydroyn = uHydroyn;
	imp5.uCHPyn = uCHPyn;
	imp5.MVHRyn = MVHRyn;

	imp5.SHWCollectorType = SHWCollectorType;
	imp5.SHWCollectorOrientation = SHWCollectorOrientation;
	imp5.SHWCollectorTilt = SHWCollectorTilt;
	imp5.SHWOvershading = SHWOvershading;
	imp5.isSHWAreaGross = isSHWAreaGross;
	imp5.isSHWSolarStoreCombined = isSHWSolarStoreCombined;
	imp5.SHWSolarCircPump = SHWSolarCircPump;
	imp5.SHWApertureArea = SHWApertureArea;
	imp5.SHW_ZLCE = SHW_ZLCE;
	imp5.SHW_HeatLossCoefficient =SHW_HeatLossCoefficient;
	imp5.SHW_dedicatedSolarStorageVolumeFactor =SHW_dedicatedSolarStorageVolumeFactor;

	imp5.PVCollectorOrientation = PVCollectorOrientation;
	imp5.PVCollectorTilt = PVCollectorTilt;
	imp5.PVOvershading = PVOvershading;
	imp5.dwellingExposure = dwellingExposure;
	imp5.CHPFuel = CHPFuel;

	imp5.SHW_overshadingFactor = SHW_overshadingFactor;
	imp5.SHW_annualSolarRadiation_pm2 = SHW_annualSolarRadiation_pm2 ;
	imp5.SHW_collectorPerformanceRatio = SHW_collectorPerformanceRatio;
	imp5.SHW_solarEnergyAvailable =SHW_solarEnergyAvailable;
	imp5.SHW_apertureArea =SHW_apertureArea;

	imp5.SHW_solarToLoadRatio = SHW_solarToLoadRatio;
	imp5.SHW_collectorPerformanceFactor =SHW_collectorPerformanceFactor;
	imp5.SHW_effectiveSolarVolume =SHW_effectiveSolarVolume;
	imp5.SHW_utilizationFactor = SHW_utilizationFactor;
	imp5.N_OCC = N_OCC;
	imp5.SHW_annualHotWaterUsage = SHW_annualHotWaterUsage;
	imp5.SHW_dailyHotWaterDemand_litres = SHW_dailyHotWaterDemand_litres;
	imp5.SHW_volumeRatio = SHW_volumeRatio;
	imp5.SHW_annualSolarInput = SHW_annualSolarInput;
	imp5.SHWDedSolStoreVol =SHWDedSolStoreVol;

	imp5.isRENAdditionalElectGenerated = isRENAdditionalElectGenerated;
	imp5.RENAddiationalElecGenerated = RENAddiationalElecGenerated ;
	imp5.REN_TFA = REN_TFA;

	imp5.installedPVPeakPower = installedPVPeakPower;
	imp5.PV_overshadingFactor = PV_overshadingFactor;
	imp5.PV_annualSolarRadiation_pm2 = PV_annualSolarRadiation_pm2 ;

	imp5.WTNumOf = WTNumOf;
	imp5.WTDiameter = WTDiameter;
	imp5.WTHeight =WTHeight;
	imp5.WTs3 = WTs3;

	//---------------------------------------------------------
	// RENEWABLES 2
	//---------------------------------------------------------
	imp5.uHydroAnnualAvgHead = uHydroAnnualAvgHead;
	imp5.uHydroAnnualAvgFlow = uHydroAnnualAvgFlow;
	imp5.uHydroEff = uHydroEff;
	imp5.uHydroAnnualEnergy = uHydroAnnualEnergy;

	imp5.uCHPheatToPowerRatio = uCHPheatToPowerRatio;
	imp5.uCHPElectricEff = uCHPElectricEff;
	imp5.uCHPHeatingEff = uCHPHeatingEff;
	imp5.uCHPHeatingFraction= uCHPHeatingFraction;
	imp5.uCHPAnnualElectricity = uCHPAnnualElectricity;
	imp5.MVHRThermalEff = MVHRThermalEff;
	imp5.lambda = lambda;

	imp5.FGHRSpresent           = FGHRSpresent;
	imp5.FGHRSstore           = FGHRSstore;
	imp5.FGHRSstoreVolume     = FGHRSstoreVolume;
	imp5.FGHRSusefulFracHtRec_kf1 = FGHRSusefulFracHtRec_kf1;
	imp5.FGHRSfittedMain      = FGHRSfittedMain;
	imp5.FGHRSfittedSec       = FGHRSfittedSec;
	imp5.FGHRStype            = FGHRStype;
	imp5.determineFGHRStype   = determineFGHRStype;
	imp5.FGHRStotFracHeatRec_kf2  = FGHRStotFracHeatRec_kf2;
	imp5.FGHRSauxelec   = FGHRSauxelec;
	imp5.FGHRSpvPoweredHt     = FGHRSpvPoweredHt;
	imp5.FGHRSpvPkPower       = FGHRSpvPkPower;
	imp5.FGHRSpvOrientation = FGHRSpvOrientation;
	imp5.FGHRSpvTilt          = FGHRSpvTilt;
	imp5.FGHRSpvOvershading   = FGHRSpvOvershading;
	imp5.FGHRScableLoss       = FGHRScableLoss;

	imp5.WWHRSpresent    = WWHRSpresent;
	imp5.WWHRSnumOfRooms = WWHRSnumOfRooms;
	imp5.WWHRS1Make      = WWHRS1Make;
	imp5.WWHRSnumMixerShowersWithBath1    = WWHRSnumMixerShowersWithBath1;
	imp5.WWHRSnumMixerShowersWithoutBath1 = WWHRSnumMixerShowersWithoutBath1;
	imp5.WWHRS1Model = WWHRS1Model;
	imp5.WWHRS1ModelQualifier = WWHRS1ModelQualifier;
	imp5.WWHRS2Make                       = WWHRS2Make;
	imp5.WWHRSnumMixerShowersWithBath2    = WWHRSnumMixerShowersWithBath2;
	imp5.WWHRSnumMixerShowersWithoutBath2 = WWHRSnumMixerShowersWithoutBath2;
	imp5.WWHRS2Model                      = WWHRS2Model;
	imp5.WWHRS2ModelQualifier             = WWHRS2ModelQualifier;

	//---------------------------------------------------------
	// Factor for LZCT
	//---------------------------------------------------------
	imp5.B_PV = B_PV;
	imp5.B_WT = B_WT;
	imp5.B_uHydro = B_uHydro;
	imp5.B_uCHP = B_uCHP;
	imp5.annualEnergy_PV = annualEnergy_PV;
	imp5.WTsupplyInput = WTsupplyInput;
	imp5.uHydrosupplyInput =uHydrosupplyInput;
	imp5.uCHPsupplyInput = uCHPsupplyInput;

	imp5.LZCT_elecDisplaced = LZCT_elecDisplaced;
	imp5.LZCT_elecSold =LZCT_elecSold;
	imp5.totalElectricalSupply = totalElectricalSupply;

	//-------------------------------------------------------
	// LIGHTS GLOBAL VARIABLES
	//-------------------------------------------------------
	imp5.fractionLEL =fractionLEL;

	//---------------------------------------------
	// SUMMER OVER HEATING GLOBAL VARIABLES
	//---------------------------------------------
	imp5.isTMPUserDef = isTMPUserDef;
	imp5.TMPvalue =  TMPvalue;
	imp5.TMPIntPartConstruction=TMPIntPartConstruction;
	imp5.TMPPartyWallConstruction=TMPPartyWallConstruction;
	imp5.isVentUserDefined=isVentUserDefined;
	imp5.airChangeRate=airChangeRate;
	imp5.isCrossVentOnMostFloors=isCrossVentOnMostFloors;
	imp5.windowVentilation=windowVentilation;
	imp5.areCurtainsClosedDuringDay=areCurtainsClosedDuringDay;
	imp5.fractCurtainsClosed=fractCurtainsClosed;
	imp5.blindCurtainType=blindCurtainType;
	imp5.sourceUserDefValues=sourceUserDefValues;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	imp5.chkInsulation  = chkInsulation;
	imp5.chkAirtightness = chkAirtightness;
	imp5.chkCapacity = chkCapacity;
	imp5.chkSolarIngress =chkSolarIngress;
	imp5.chkOccupancy = chkOccupancy;
	imp5.chkControlledSpace= chkControlledSpace;
	imp5.chkSDHW=chkSDHW;
	imp5.chkPV=chkPV;
	imp5.chkWT=chkWT;
	imp5.chkuCHP=chkuCHP;
	imp5.chkuHydro=chkuHydro;
	imp5.chkPCM=chkPCM;
	imp5.chkMVHR=chkMVHR;
	imp5.chkFGHRS = chkFGHRS;
	imp5.chkWWHRS = chkWWHRS;

	imp5.hemHouseType=hemHouseType;
	imp5.hemYearOfBuild=hemYearOfBuild;
	imp5.hemCoolingFuel=hemCoolingFuel;
	imp5.hemCoolingEff=hemCoolingEff;

	imp5.hemX_exposure=hemX_exposure;
	imp5.hemI_insulation=hemI_insulation;
	imp5.hemI_insulation1=hemI_insulation1;
	imp5.hemI_insulation2=hemI_insulation2;
	imp5.hemA_ach=hemA_ach;
	imp5.hemC_capacity=hemC_capacity;
	imp5.hemS_solarGains=hemS_solarGains;
	imp5.hemO_occupantDensity=hemO_occupantDensity;
	imp5.hemL_livingAreaFraction=hemL_livingAreaFraction;
	imp5.hemXIACSOL_string=hemXIACSOL_string;
	imp5.hemXIACSOL_string1=hemXIACSOL_string1;
	imp5.hemXIACSOL_string2=hemXIACSOL_string2;
	imp5.hemx_1 =hemx_1;
	imp5.hemx_2 =hemx_2;
	imp5.hemy_1 = hemy_1;
	imp5.hemy_2 =hemy_2;
	imp5.hemTFA =hemTFA;

	imp5.hemI_insulationSliderPos = hemI_insulationSliderPos;
	imp5.hemA_achSliderPos = hemA_achSliderPos;
	imp5.hemC_capacitySliderPos =hemC_capacitySliderPos;
	imp5.hemS_solarGainsSliderPos = hemS_solarGainsSliderPos;
	imp5.hemO_OCCDensitySliderPos=hemO_OCCDensitySliderPos;
	imp5.hemL_LAFracSliderPos=hemL_LAFracSliderPos;

	imp5.iStat=iStat;
	imp5.dwellingVoulme=dwellingVoulme;
	imp5.SFP=SFP;
	imp5.auxillaryElectricity=auxillaryElectricity;

	imp5.numOfOccupants=numOfOccupants;
	imp5.TFA=TFA;
	imp5.TFAfromHEM=TFAfromHEM;
	imp5.EB=EB;
	imp5.C1=C1;
	imp5.ZL=ZL;
	imp5.gL=gL;
	imp5.GL_total=GL_total;
	imp5.C2=C2;
	imp5.lightElectricity=lightElectricity;

	imp5.Vd_avg=Vd_avg;
	imp5.DHW_energy=DHW_energy;
	imp5.distributionLoss=distributionLoss;
	imp5.winterOpTemp=winterOpTemp;
	imp5.tempFactor=tempFactor;
	imp5.storageLoss=storageLoss;
	imp5.lossFactor=lossFactor;
	imp5.tankVolume=tankVolume;
	imp5.volumeFacor=volumeFacor;
	imp5.heatLossFactor=heatLossFactor;
	imp5.srorageLoss=srorageLoss;
	imp5.primaryCircuitLoss=primaryCircuitLoss;
	imp5.F_u=F_u;
	imp5.combiLoss=combiLoss;
	imp5.solarDHWInput=solarDHWInput;

	imp5.pvSupplyInput=pvSupplyInput;

	imp5.domesticHotWaterSupply=domesticHotWaterSupply;
	imp5.spaceHeatingDemand=spaceHeatingDemand;
	imp5.totalRenElecSupply=totalRenElecSupply;
	imp5.totalRenElecSupply_fuelCost = totalRenElecSupply_fuelCost;
	imp5.totalRenElecSupply_Emm=totalRenElecSupply_Emm;
	imp5.totalRenElecSupply_PrimEnergyFactor=totalRenElecSupply_PrimEnergyFactor;

	imp5.enterYValue=enterYValue;
	imp5.mainSpaceHtSupply=mainSpaceHtSupply;
	imp5.secSpaceHtSupply=secSpaceHtSupply;
	imp5.totalSpaceHtSupply=totalSpaceHtSupply;
	imp5.totalSpaceCoolingSupply=totalSpaceCoolingSupply;

	imp5.totalEnergy=totalEnergy;
	imp5.totalCost=totalCost;
	imp5.totalEmissions=totalEmissions;
	imp5.totalPrimaryEnergy=totalPrimaryEnergy;

	imp5.mainSpaceHtSupply_fuelCost=mainSpaceHtSupply_fuelCost;
	imp5.secSpaceHtSupply_fuelCost=secSpaceHtSupply_fuelCost;
	imp5.domesticHotWaterSupply_fuelCost=domesticHotWaterSupply_fuelCost;
	imp5.auxillaryElectricity_fuelCost=auxillaryElectricity_fuelCost;
	imp5.lightElectricity_fuelCost=lightElectricity_fuelCost;
	imp5.totalSpaceCoolingSupply_fuelCost=totalSpaceCoolingSupply_fuelCost;

	imp5.mainSpaceHtSupply_Emm=mainSpaceHtSupply_Emm;
	imp5.secSpaceHtSupply_Emm=secSpaceHtSupply_Emm;
	imp5.domesticHotWaterSupply_Emm=domesticHotWaterSupply_Emm;
	imp5.auxillaryElectricity_Emm=auxillaryElectricity_Emm;
	imp5.lightElectricity_Emm=lightElectricity_Emm;
	imp5.totalSpaceCoolingSupply_Emm=totalSpaceCoolingSupply_Emm;

	imp5.mainSpaceHtSupply_PrimEnergyFactor=mainSpaceHtSupply_PrimEnergyFactor;
	imp5.secSpaceHtSupply_PrimEnergyFactor=secSpaceHtSupply_PrimEnergyFactor;
	imp5.domesticHotWaterSupply_PrimEnergyFactor=domesticHotWaterSupply_PrimEnergyFactor;
	imp5.auxillaryElectricity_PrimEnergyFactor=auxillaryElectricity_PrimEnergyFactor;
	imp5.lightElectricity_PrimEnergyFactor=lightElectricity_PrimEnergyFactor;
	imp5.totalSpaceCoolingSupply_PrimEnergyFactor = totalSpaceCoolingSupply_PrimEnergyFactor;

	imp5.totalSpaceHtSupply_Disp		= totalSpaceHtSupply_Disp;
	imp5.totalSpaceCoolingSupply_Disp	=  totalSpaceCoolingSupply_Disp;
	imp5.domesticHotWaterSupply_Disp	= domesticHotWaterSupply_Disp;
	imp5.lightElectricity_Disp			= lightElectricity_Disp;
	imp5.auxillaryElectricity_Disp		= auxillaryElectricity_Disp;
	imp5.totalElectricalSupply_Disp		= totalElectricalSupply_Disp;
	imp5.mainSpaceHtSupply_Disp			= mainSpaceHtSupply_Disp;
	imp5.secSpaceHtSupply_Disp			= secSpaceHtSupply_Disp;
	imp5.LZCTelecSold_Disp				= LZCTelecSold_Disp;
	imp5.LZCTelecDisp_Disp				= LZCTelecDisp_Disp;
	
	imp5.primaryFuelUsed_Disp		= primaryFuelUsed_Disp;
	imp5.secFuelUsed_Disp			= secFuelUsed_Disp;
	imp5.primaryFuelUsed			= primaryFuelUsed;	
	imp5.secFuelUsed				= secFuelUsed;
	imp5.primaryFuelUsed_fuelCost   = primaryFuelUsed_fuelCost;	
	imp5.secFuelUsed_fuelCost       = secFuelUsed_fuelCost;
	imp5.primaryFuelUsed_Emm        = primaryFuelUsed_Emm;
	imp5.secFuelUsed_Emm            = secFuelUsed_Emm;


	//---------------------------------------------
	// GLOBAL VARIABLES FOR TC ID
	//---------------------------------------------
	// Create index number to read data from frdb.csv file
	imp5.X_exposure=X_exposure;
	imp5.I_insulation=I_insulation;
	imp5.I_insulation1=I_insulation1;
	imp5.I_insulation2=I_insulation2;
	imp5.A_ach=A_ach;
	imp5.A_ach_MVHR1=A_ach_MVHR1;
	imp5.A_ach_MVHR2=A_ach_MVHR2;
	imp5.C_capacity=C_capacity;
	imp5.S_solarGains = S_solarGains;
	imp5.O_occupantDensity=O_occupantDensity;
	imp5.L_livingAreaFraction =L_livingAreaFraction;
	imp5.XIACSOL_string  = XIACSOL_string;
	imp5.XIACSOL_string1 = XIACSOL_string1;
	imp5.XIACSOL_string2 = XIACSOL_string2;
	imp5.x_1 = x_1;
	imp5.x_2 = x_2;
	imp5.y_1 = y_1;
	imp5.y_2 = y_2;

	// String for user display
	imp5.XIACSOL_string_disp = XIACSOL_string_disp;
	imp5.XIACSOL_string_disp1 = XIACSOL_string_disp1;
	imp5.XIACSOL_string_disp2 = XIACSOL_string_disp2;

	

	//---------------------------------
	// Misc variables used in ach calc
	imp5.numOfChimneys_multip = numOfChimneys_multip;
	imp5.numOfFlues_multip =numOfFlues_multip ;
	imp5.numOfFansPassVents_multip =numOfFansPassVents_multip;
	imp5.numOfFluelessGasFires_multip=numOfFluelessGasFires_multip;
	imp5.total_solarGains=total_solarGains;

	imp5.numOfChimneys_m3perh = numOfChimneys_m3perh ;
	imp5.numOfFlues_m3perh =numOfFlues_m3perh;
	imp5.numOfFansPassVents_m3perh=numOfFansPassVents_m3perh;
	imp5.numOfFluelessGasFires_m3perh =numOfFluelessGasFires_m3perh ;
}



void CopyBaseToCurrent()
{	
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	JobDetRefNum   = base.JobDetRefNum;
	assessorName   = base.assessorName;
	JobDetComments = base.JobDetComments;
	propertyFlatNameorNum = base.propertyFlatNameorNum ;
	propertyLetter = base.propertyLetter;
	propertyHouseNum  = base.propertyHouseNum;
	propertyStreet = base.propertyStreet;
	propertyLocality = base.propertyLocality;
	propertyDistrict = base.propertyDistrict;
	propertyTown = base.propertyTown ;
	propertyCounty = base.propertyCounty;
	propertyPostCode = base.propertyPostCode;
	clientFlatNameorNum = base.clientFlatNameorNum;
	clientLetter = base.clientLetter;
	clientHouseorBlockNum = base.clientHouseorBlockNum;
	clientStreet = base.clientStreet;
	clientLocality = base.clientLocality;
	clientDistrict = base.clientDistrict;
	clientTown = base.clientTown ;
	clientCounty = base.clientCounty ;
	clientPostCode = base.clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	locationString = base.locationString;

	dwellingType = base.dwellingType;
	builtForm = base.builtForm;
	Detachment = base.Detachment;
	FlatPosition  = base.FlatPosition;
	yearPropertBuilt = base.yearPropertBuilt;
	dwellingShelteredSides = base.dwellingShelteredSides;
	dwellingExposure = base.dwellingExposure;

	dwellingTerrain = base.dwellingTerrain;

	storey1Level = base.storey1Level;
	storey2Level = base.storey2Level;
	storey3Level = base.storey3Level;
	storey4Level = base.storey4Level;
	storey5Level = base.storey5Level;
	storey6Level = base.storey6Level;
	
	storey1 = base.storey1;
	storey2 = base.storey2;
	storey3 = base.storey3;
	storey4 = base.storey4;
	storey5 = base.storey5;
	storey6 = base.storey6;

	storey1Basement = base.storey1Basement;
	storey2Basement = base.storey2Basement;
	storey3Basement = base.storey3Basement;
	storey4Basement = base.storey4Basement;
	storey5Basement = base.storey5Basement;
	storey6Basement = base.storey6Basement;

	storey1Area = base.storey1Area;
	storey2Area = base.storey2Area;
	storey3Area = base.storey3Area;
	storey4Area = base.storey4Area;
	storey5Area = base.storey5Area;
	storey6Area = base.storey6Area;

	storey1Height = base.storey1Height;
	storey2Height = base.storey2Height;
	storey3Height = base.storey3Height;
	storey4Height = base.storey4Height;
	storey5Height = base.storey5Height;
	storey6Height = base.storey6Height;
	TFAfromHEM    = base.TFAfromHEM;

	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	winNArea  = base.winNArea;
	winNEArea = base.winNEArea;
	winEArea  = base.winEArea;
	winSEArea = base.winSEArea;
	winSArea  = base.winSArea;
	winSWArea = base.winSWArea;
	winWArea  = base.winWArea;
	winNWArea = base.winNWArea;
	rooflightsArea = base.rooflightsArea;

	winNSolTrans  = base.winNSolTrans;
	winNESolTrans = base.winNESolTrans;
	winESolTrans  = base.winESolTrans;
	winSESolTrans = base.winSESolTrans;
	winSSolTrans  = base.winSSolTrans;
	winSWSolTrans = base.winSWSolTrans;
	winWSolTrans  = base.winWSolTrans;
	winNWSolTrans = base.winNWSolTrans;
	rooflightsSolTrans = base.rooflightsSolTrans;

	winNFrameFactor  = base.winNFrameFactor;
	winNEFrameFactor = base.winNEFrameFactor;
	winEFrameFactor  = base.winEFrameFactor;
	winSEFrameFactor = base.winSEFrameFactor;
	winSFrameFactor  = base.winSFrameFactor;
	winSWFrameFactor = base.winSWFrameFactor;
	winWFrameFactor  = base.winWFrameFactor;
	winNWFrameFactor = base.winNWFrameFactor;
	rooflightsFrameFactor = base.rooflightsFrameFactor;

	winOvershading = base.winOvershading;
	winGlazing     = base.winGlazing;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	grossAreaWall1 = base.grossAreaWall1;
	groosAreaRoof1 = base.groosAreaRoof1;
	netAreaDoors = base.netAreaDoors;;
	netAreaWindows = base.netAreaWindows;
	netAreaRoofLights = base.netAreaRoofLights ;
	netAreaGF = base.netAreaGF;
	netAreaExFloor = base.netAreaExFloor ;
	netAreaWallType1 = base.netAreaWallType1;
	netAreaWallType2 = base.netAreaWallType2;
	netAreaRoofType1= base.netAreaRoofType1;
	netAreaRoofType2 = base.netAreaRoofType2;
	netAreaPartyWall = base.netAreaPartyWall;
	netAreaPartyFloor = base.netAreaPartyFloor;
	netAreaPartyCeiling = base.netAreaPartyCeiling;
	netAreaInternalWall = base.netAreaInternalWall; ;
	netAreaInternalFloor = base.netAreaInternalFloor;
	netAreaInternalCeiling = base.netAreaInternalCeiling; ;

	UvalueDoors = base.UvalueDoors ;
	UvalueWindows = base.UvalueWindows;
	UvalueRooflights = base.UvalueRooflights;
	UvalueGF = base.UvalueGF;
	UvalueExposedFloor = base.UvalueExposedFloor;
	UvalueWallType1 = base.UvalueWallType1;
	UvalueWallType2 = base.UvalueWallType2;
	UvalueRoofTYpe1 = base.UvalueRoofTYpe1;
	UvalueRoofType2 = base.UvalueRoofType2;
	UvaluePartyWall = base.UvaluePartyWall;

	kValueGF = base.kValueGF;;
	kValueExpFloor = base.kValueExpFloor;
	kValueWallType1 = base.kValueWallType1;
	kValueWallType2 = base.kValueWallType2;
	kValueRoofType1 = base.kValueRoofType1;
	kValueRoofType2 = base.kValueRoofType2;
	kValuePartyWall = base.kValuePartyWall;
	kValuePartyFloor = base.kValuePartyFloor;
	kValuePartyCeiling = base.kValuePartyCeiling;
	kValueIntWall = base.kValueIntWall;
	kValueIntFloor	 = base.kValueIntFloor;
	kValueIntCeiling = base.kValueIntCeiling;

	livingRoomFraction	 = base.livingRoomFraction;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	enterYValue = base.enterYValue;
	yValueEntry = base.yValueEntry;

	ThermBGFPerimeter = base.ThermBGFPerimeter;
	ThermBFloorWithingDwellinPerimeter = base.ThermBFloorWithingDwellinPerimeter;
	ThermBFloorBetweenDwellinPerimeter = base.ThermBFloorBetweenDwellinPerimeter;
	ThermBBalconyWithingDwellingLength = base.ThermBBalconyWithingDwellingLength; 
	ThermBBalconyBetweenDwellingLength	 = base.ThermBBalconyBetweenDwellingLength;
	ThermBEavesAtCeiling = base.ThermBEavesAtCeiling;
	ThermBEavesAtRafter = base.ThermBEavesAtRafter;
	ThermBGableAtCeiling = base.ThermBGableAtCeiling;
	ThermBGableAtRafter = base.ThermBGableAtRafter;
	ThermBLengthNormalCorners = base.ThermBLengthNormalCorners;
	ThermBLengthInvertedCorners = base.ThermBLengthInvertedCorners;
	ThermBPartWallBetweenDwelling = base.ThermBPartWallBetweenDwelling;
	
	ThermBMetalBoxLintelUserDef = base.ThermBMetalBoxLintelUserDef;
	ThermBOtherLintelUserDef = base.ThermBOtherLintelUserDef;
	ThermBSillUserDef = base.ThermBSillUserDef;
	ThermBJambUserDef = base.ThermBJambUserDef;
	ThermBGFPerimeterUserDef = base.ThermBGFPerimeterUserDef;
	ThermBFloorWithinDwellingUserDef = base.ThermBFloorWithinDwellingUserDef;
	ThermBFloorBwDwellingUserDef = base.ThermBFloorBwDwellingUserDef;
	ThermBBalcWithinDwellingLengthUserDef = base.ThermBBalcWithinDwellingLengthUserDef;
	ThermBBalcBwDwellingLengthUserDef = base.ThermBBalcBwDwellingLengthUserDef;
	ThermBEavesInsAtCeilingUserDef = base.ThermBEavesInsAtCeilingUserDef;
	ThermBEavesInsAtRafterUserDef= base.ThermBEavesInsAtRafterUserDef;
	ThermBGableInsAtCeilingUserDef = base.ThermBGableInsAtCeilingUserDef;
	ThermBGableInsAtRafetUserDef = base.ThermBGableInsAtRafetUserDef;
	ThermBLengthOfNormalCornersUserDef = base.ThermBLengthOfNormalCornersUserDef;
	ThermBLengthOfInvertedCornersUserDef = base.ThermBLengthOfInvertedCornersUserDef;
	ThermBPartWallBetweenDwellingUserDef = base.ThermBPartWallBetweenDwellingUserDef;

	ThermBMetalBoxLintelSiValue = base.ThermBMetalBoxLintelSiValue;
	ThermBOtherLintelsSiValue = base.ThermBOtherLintelsSiValue;
	ThermBSillSiValue = base.ThermBSillSiValue;
	ThermBJambSiValue = base.ThermBJambSiValue;
	ThermBGFPerimeterSiValue = base.ThermBGFPerimeterSiValue;
	ThermBFloorWithinDwellingSiValue = base. ThermBFloorWithinDwellingSiValue;
	ThermBFloorBetweenDwellingSiValue = base.ThermBFloorBetweenDwellingSiValue;
	ThermBBalconyWithinDwellingSiValue = base.ThermBBalconyWithinDwellingSiValue;
	ThermBBalconyBwDwellingSiValue = base.ThermBBalconyBwDwellingSiValue ;
	ThermBEavesInsAtCelingSiValue = base.ThermBEavesInsAtCelingSiValue;
	ThermBEavesInsAtRafterSiValue = base. ThermBEavesInsAtRafterSiValue;
	ThermBGableInsAtCeilingSiValue= base.ThermBGableInsAtCeilingSiValue;
	ThermBGableInsAtRafterSiValue = base.ThermBGableInsAtRafterSiValue;
	ThermBLengthOfNormalCornersSiValue = base.ThermBLengthOfNormalCornersSiValue;
	ThermBLengthOfInvertedCornersSiValue = base.ThermBLengthOfInvertedCornersSiValue;
	ThermBPartBwDwellingLengthSiValue = base.ThermBPartBwDwellingLengthSiValue;

	ThermBMetalBoxLintelResult = base.ThermBMetalBoxLintelResult;
	ThermBOtherLintelsResult = base.ThermBOtherLintelsResult;
	ThermBSillResult = base.ThermBSillResult;
	ThermBJambResult= base.ThermBJambResult;
	ThermBGFPerimeterResult = base.ThermBGFPerimeterResult;
	ThermBFloorWithinDwellingPerimeterResult = base.ThermBFloorWithinDwellingPerimeterResult;
	ThermBFloorBetweenDwellingPerimeterResult = base.ThermBFloorBetweenDwellingPerimeterResult;
	ThermBBalcWithDwellingLengthResult = base.ThermBBalcWithDwellingLengthResult;
	ThermBBalconyBwDwellingLengthResult = base.ThermBBalconyBwDwellingLengthResult;
	ThermBEavesInsCeilingResult = base.ThermBEavesInsCeilingResult;
	ThermBEavesInsRafterResult = base.ThermBEavesInsRafterResult;
	ThermBGableInsCeilingResult = base.ThermBGableInsCeilingResult;
	ThermBGableInsRafterResult = base.ThermBGableInsRafterResult;
	ThermBLengthNormalCornersResult = base.ThermBLengthNormalCornersResult;
	ThermBLengthInvertedCornersResult = base.ThermBLengthInvertedCornersResult;
	ThermBPartyWallBwDwellingResult = base.ThermBPartyWallBwDwellingResult;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	numsOpenFirePlaces	 = base.numsOpenFirePlaces;
	numsOpenFlues		 = base.numsOpenFlues;
	numsFluelessGasFires = base.numsFluelessGasFires;
	numsExtractFans		 = base.numsExtractFans;
	numsPassiveVents     = base.numsPassiveVents;

	mechVentType = base.mechVentType;
	MVHRThermalEff  = base.MVHRThermalEff;
	SFP = base.SFP;

	pressureTestYN  = base.pressureTestYN;
	measuredQ50     = base.measuredQ50;
	numOfStoreys    = base.numOfStoreys;
	structInf		= base.structInf;
	floorInf		= base.floorInf;
	draughtLobby	= base.draughtLobby;
	perWindowDraughtStripped = base.perWindowDraughtStripped;
	numOfShelteredSides      = base.numOfShelteredSides;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	primaryFuelUsed = base.primaryFuelUsed;
    secFuelUsed     = base.secFuelUsed;
	primaryFuelUsedString = base.primaryFuelUsedString;
	secFuelUsedString     = base.secFuelUsedString;
	electricityTarrif = base.electricityTarrif;
	mainHtType		  = base.mainHtType;
	mainHtEffFrom     = base.mainHtEffFrom;
	boilerType		  = base.boilerType;
	mainFuel		  = base.mainFuel;
	isFanFluePresent  = base.isFanFluePresent;
	mainHtSystem      = base.mainHtSystem;
	mainHtControls    = base.mainHtControls;
	mainHtEmitter     = base.mainHtEmitter;
	isIterlockPresent = base.isIterlockPresent;
	mainHtCompensator = base.mainHtCompensator;
	isPumpInHeatedSpace= base.isPumpInHeatedSpace;
	mainHtManufacturerDesc = base.mainHtManufacturerDesc;
	mainHtTestMethod       = base.mainHtTestMethod ;
	
	//mainHtEff              = base.mainHtEff;
	mainHtEffNominal              = base.mainHtEffNominal;  //@min

	mainHtFractionSupplied = base.mainHtFractionSupplied;
	
	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	oilPumpInHeatedSpace = base.oilPumpInHeatedSpace;
	oilBoilerInstalled   = base.oilBoilerInstalled;
	CPSUoperatingTemp    = base.CPSUoperatingTemp;
	heatEmmFromCase      = base.heatEmmFromCase;
	heatTransferredToWater = base.heatTransferredToWater;

	isThereCHP		 = base.isThereCHP;
	CHPfuel			 = base.CHPfuel;
	fractOfHtFromCHP = base.fractOfHtFromCHP;
	elecEffOfCHP     = base.elecEffOfCHP;
	heatingEffOfCHP  = base.heatingEffOfCHP;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	isThereSecHeating		= base.isThereSecHeating;
	secHtOpenFlueChimney	= base.secHtOpenFlueChimney;
	secHtUnconnectedGasPoint= base.secHtUnconnectedGasPoint;
	secHtEffFrom			= base.secHtEffFrom;
	secHtFuel				= base.secHtFuel;
	secHtSystem				= base.secHtSystem;
	secHtManufactDesc		= base.secHtManufactDesc;
	secHtTestMethod			= base.secHtTestMethod;
	secHtEff				= base.secHtEff;
	secHtFraction			= base.secHtFraction;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	btnWaterHtFromMainState   = base.btnWaterHtFromMainState;
	WHtype					  = base.WHtype;
	WHtCylinderWithinDwelling = base.WHtCylinderWithinDwelling;
	WHtFuel					  = base.WHtFuel;
	WHtWaterSepTimed		  = base.WHtWaterSepTimed ;

	WHtCylManufactLossFactor = base.WHtCylManufactLossFactor;
	WHtCylDeclaredFactor	 = base.WHtCylDeclaredFactor ;
	WHtCylVolume			 = base.WHtCylVolume;
	WHtCylInsType			 = base.WHtCylInsType;
	WHtCylInsThickness		 = base.WHtCylInsThickness;
	WHtCylThermostat		 = base.WHtCylThermostat;
	WHtCylInHeatedSpace		 = base.WHtCylInHeatedSpace;
	WHtCylPrimaryPipeworkInsulated = base.WHtCylPrimaryPipeworkInsulated;
	WHtCylPumpedPrimarySystem = base.WHtCylPumpedPrimarySystem;
	WHtEff = base.WHtEff;

	WHtTSnCPSUinSingleUnit			= base.WHtTSnCPSUinSingleUnit;
	WHtTSnCPSUPrimaryPipeworkLT1_5m = base.WHtTSnCPSUPrimaryPipeworkLT1_5m;;
	WHtTSnCPSUstoreInAirCupbrd	    = base.WHtTSnCPSUstoreInAirCupbrd;

	WHtCombiKeepHotYN	   = base.WHtCombiKeepHotYN;
	DHWfromCommunityScheme = base.DHWfromCommunityScheme;
	WHtHeatPumpUsesImmer   = base.WHtHeatPumpUsesImmer;
	WHtUsesSummerImmer     = base.WHtUsesSummerImmer ;
	
	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	isSHWPresent     = base.isSHWPresent;	
	SHWCollectorType = base.SHWCollectorType;
	SHWCollectorOrientation = base.SHWCollectorOrientation;
	SHWCollectorTilt = base.SHWCollectorTilt;
	SHWOvershading   = base.SHWOvershading;
	isSHWAreaGross   = base.isSHWAreaGross;
	SHWApertureArea     = base.SHWApertureArea;
	SHW_ZLCE         = base.SHW_ZLCE;
	SHW_HeatLossCoefficient = base.SHW_HeatLossCoefficient;
	isSHWSolarStoreCombined = base.isSHWSolarStoreCombined;
	SHWSolarCircPump  = base.SHWSolarCircPump;
	SHWDedSolStoreVol = base.SHWDedSolStoreVol;
	 
	isPVPresent			   = base.isPVPresent;
	installedPVPeakPower   = base.installedPVPeakPower;
	PVCollectorOrientation = base.PVCollectorOrientation;
	PVCollectorTilt        = base.PVCollectorTilt;
	PVOvershading          = base.PVOvershading ;

	isWTPresent = base.isWTPresent;
	WTNumOf		= base.WTNumOf;
	WTDiameter  = base.WTDiameter;
	WTHeight	= base.WTHeight;

	uHydroyn = base.uHydroyn;
	uHydroAnnualAvgHead = base.uHydroAnnualAvgHead;
	uHydroAnnualAvgFlow = base.uHydroAnnualAvgFlow;
	uHydroEff = base.uHydroEff;
	
	uCHPyn               = base.uCHPyn; 
	uCHPheatToPowerRatio = base.uCHPheatToPowerRatio;
	uCHPElectricEff      = base.uCHPElectricEff;
	CHPFuel				 = base.CHPFuel;
	uCHPHeatingEff		 = base.uCHPHeatingEff;
	uCHPHeatingFraction  = base.uCHPHeatingFraction;

	FGHRSpresent           = base.FGHRSpresent;
	FGHRSstore           = base.FGHRSstore;
	FGHRSstoreVolume     = base.FGHRSstoreVolume;
	FGHRSusefulFracHtRec_kf1 = base.FGHRSusefulFracHtRec_kf1;
	FGHRSfittedMain      = base.FGHRSfittedMain;
	FGHRSfittedSec       = base.FGHRSfittedSec;
	FGHRStype            = base.FGHRStype;
	determineFGHRStype   = base.determineFGHRStype;
	FGHRStotFracHeatRec_kf2  = base.FGHRStotFracHeatRec_kf2;
	FGHRSauxelec   = base.FGHRSauxelec;
	FGHRSpvPoweredHt     = base.FGHRSpvPoweredHt;
	FGHRSpvPkPower       = base.FGHRSpvPkPower;
	FGHRSpvOrientation = base.FGHRSpvOrientation;
	FGHRSpvTilt          = base.FGHRSpvTilt;
	FGHRSpvOvershading   = base.FGHRSpvOvershading;
	FGHRScableLoss       = base.FGHRScableLoss;


	WWHRSpresent    = base.WWHRSpresent;
	WWHRSnumOfRooms = base.WWHRSnumOfRooms;
	WWHRS1Make      = base.WWHRS1Make;
	WWHRSnumMixerShowersWithBath1    = base.WWHRSnumMixerShowersWithBath1;
	WWHRSnumMixerShowersWithoutBath1 = base.WWHRSnumMixerShowersWithoutBath1;
	WWHRS1Model = base.WWHRS1Model;
	WWHRS1ModelQualifier = base.WWHRS1ModelQualifier;
	WWHRS2Make                       = base.WWHRS2Make;
	WWHRSnumMixerShowersWithBath2    = base.WWHRSnumMixerShowersWithBath2;
	WWHRSnumMixerShowersWithoutBath2 = base.WWHRSnumMixerShowersWithoutBath2;
	WWHRS2Model                      = base.WWHRS2Model;
	WWHRS2ModelQualifier             = base.WWHRS2ModelQualifier;

	MVHRyn		   = base.MVHRyn;
	MVHRThermalEff = base.MVHRThermalEff;

	// ------------------------------------------------------
	//	LIGHTS
	//------------------------------------------------------
	fractionLEL = base.fractionLEL;

	// ------------------------------------------------------
	// HEM
	// ------------------------------------------------------
	hemHouseType   = base.hemHouseType;
	hemYearOfBuild = base.hemYearOfBuild;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	chkInsulation = base.chkInsulation;
	hemI_insulationSliderPos = base.hemI_insulationSliderPos;

	chkAirtightness = base.chkAirtightness;
	hemA_achSliderPos = base.hemA_achSliderPos;

	chkCapacity= base.chkCapacity;
	hemC_capacitySliderPos = base.hemC_capacitySliderPos;

	chkSolarIngress = base.chkSolarIngress;
	hemS_solarGainsSliderPos = base.hemS_solarGainsSliderPos;

	chkOccupancy = base.chkOccupancy;
	hemO_OCCDensitySliderPos = base.hemO_OCCDensitySliderPos;

	chkControlledSpace = base.chkControlledSpace;
	hemL_LAFracSliderPos = base.hemL_LAFracSliderPos;

	chkSDHW = base.chkSDHW;
	chkPV   = base.chkPV;
	chkWT   = base.chkWT;
	chkuCHP = base.chkuCHP;
	chkuHydro = base.chkuHydro;
	chkPCM    = base.chkPCM;
	chkMVHR   = base.chkMVHR;	
	chkFGHRS  = base.chkFGHRS;
	chkWWHRS  = base.chkWWHRS;

}

void CopyImprovement1ToCurrent()
{	
	//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	JobDetRefNum   = imp1.JobDetRefNum;
	assessorName   = imp1.assessorName;
	JobDetComments = imp1.JobDetComments;
	propertyFlatNameorNum = imp1.propertyFlatNameorNum ;
	propertyLetter = imp1.propertyLetter;
	propertyHouseNum  = imp1.propertyHouseNum;
	propertyStreet = imp1.propertyStreet;
	propertyLocality = imp1.propertyLocality;
	propertyDistrict = imp1.propertyDistrict;
	propertyTown = imp1.propertyTown ;
	propertyCounty = imp1.propertyCounty;
	propertyPostCode = imp1.propertyPostCode;
	clientFlatNameorNum = imp1.clientFlatNameorNum;
	clientLetter = imp1.clientLetter;
	clientHouseorBlockNum = imp1.clientHouseorBlockNum;
	clientStreet = imp1.clientStreet;
	clientLocality = imp1.clientLocality;
	clientDistrict = imp1.clientDistrict;
	clientTown = imp1.clientTown ;
	clientCounty = imp1.clientCounty ;
	clientPostCode = imp1.clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	locationString = imp1.locationString;

	dwellingType = imp1.dwellingType;
	builtForm = imp1.builtForm;
	Detachment = imp1.Detachment;
	FlatPosition  = imp1.FlatPosition;
	yearPropertBuilt = imp1.yearPropertBuilt;
	dwellingShelteredSides = imp1.dwellingShelteredSides;
	dwellingExposure = imp1.dwellingExposure;

	dwellingTerrain = imp1.dwellingTerrain;

	storey1Level = imp1.storey1Level;
	storey2Level = imp1.storey2Level;
	storey3Level = imp1.storey3Level;
	storey4Level = imp1.storey4Level;
	storey5Level = imp1.storey5Level;
	storey6Level = imp1.storey6Level;
	
	storey1 = imp1.storey1;
	storey2 = imp1.storey2;
	storey3 = imp1.storey3;
	storey4 = imp1.storey4;
	storey5 = imp1.storey5;
	storey6 = imp1.storey6;

	storey1Basement = imp1.storey1Basement;
	storey2Basement = imp1.storey2Basement;
	storey3Basement = imp1.storey3Basement;
	storey4Basement = imp1.storey4Basement;
	storey5Basement = imp1.storey5Basement;
	storey6Basement = imp1.storey6Basement;

	storey1Area = imp1.storey1Area;
	storey2Area = imp1.storey2Area;
	storey3Area = imp1.storey3Area;
	storey4Area = imp1.storey4Area;
	storey5Area = imp1.storey5Area;
	storey6Area = imp1.storey6Area;

	storey1Height = imp1.storey1Height;
	storey2Height = imp1.storey2Height;
	storey3Height = imp1.storey3Height;
	storey4Height = imp1.storey4Height;
	storey5Height = imp1.storey5Height;
	storey6Height = imp1.storey6Height;
	TFAfromHEM = imp1.TFAfromHEM;

	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	winNArea  = imp1.winNArea;
	winNEArea = imp1.winNEArea;
	winEArea  = imp1.winEArea;
	winSEArea = imp1.winSEArea;
	winSArea  = imp1.winSArea;
	winSWArea = imp1.winSWArea;
	winWArea  = imp1.winWArea;
	winNWArea = imp1.winNWArea;
	rooflightsArea = imp1.rooflightsArea;

	winNSolTrans  = imp1.winNSolTrans;
	winNESolTrans = imp1.winNESolTrans;
	winESolTrans  = imp1.winESolTrans;
	winSESolTrans = imp1.winSESolTrans;
	winSSolTrans  = imp1.winSSolTrans;
	winSWSolTrans = imp1.winSWSolTrans;
	winWSolTrans  = imp1.winWSolTrans;
	winNWSolTrans = imp1.winNWSolTrans;
	rooflightsSolTrans = imp1.rooflightsSolTrans;

	winNFrameFactor  = imp1.winNFrameFactor;
	winNEFrameFactor = imp1.winNEFrameFactor;
	winEFrameFactor  = imp1.winEFrameFactor;
	winSEFrameFactor = imp1.winSEFrameFactor;
	winSFrameFactor  = imp1.winSFrameFactor;
	winSWFrameFactor = imp1.winSWFrameFactor;
	winWFrameFactor  = imp1.winWFrameFactor;
	winNWFrameFactor = imp1.winNWFrameFactor;
	rooflightsFrameFactor = imp1.rooflightsFrameFactor;

	winOvershading = imp1.winOvershading;
	winGlazing     = imp1.winGlazing;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	grossAreaWall1 = imp1.grossAreaWall1;
	groosAreaRoof1 = imp1.groosAreaRoof1;
	netAreaDoors = imp1.netAreaDoors;;
	netAreaWindows = imp1.netAreaWindows;
	netAreaRoofLights = imp1.netAreaRoofLights ;
	netAreaGF = imp1.netAreaGF;
	netAreaExFloor = imp1.netAreaExFloor ;
	netAreaWallType1 = imp1.netAreaWallType1;
	netAreaWallType2 = imp1.netAreaWallType2;
	netAreaRoofType1= imp1.netAreaRoofType1;
	netAreaRoofType2 = imp1.netAreaRoofType2;
	netAreaPartyWall = imp1.netAreaPartyWall;
	netAreaPartyFloor = imp1.netAreaPartyFloor;
	netAreaPartyCeiling = imp1.netAreaPartyCeiling;
	netAreaInternalWall = imp1.netAreaInternalWall; ;
	netAreaInternalFloor = imp1.netAreaInternalFloor;
	netAreaInternalCeiling = imp1.netAreaInternalCeiling; ;

	UvalueDoors = imp1.UvalueDoors ;
	UvalueWindows = imp1.UvalueWindows;
	UvalueRooflights = imp1.UvalueRooflights;
	UvalueGF = imp1.UvalueGF;
	UvalueExposedFloor = imp1.UvalueExposedFloor;
	UvalueWallType1 = imp1.UvalueWallType1;
	UvalueWallType2 = imp1.UvalueWallType2;
	UvalueRoofTYpe1 = imp1.UvalueRoofTYpe1;
	UvalueRoofType2 = imp1.UvalueRoofType2;
	UvaluePartyWall = imp1.UvaluePartyWall;

	kValueGF = imp1.kValueGF;;
	kValueExpFloor = imp1.kValueExpFloor;
	kValueWallType1 = imp1.kValueWallType1;
	kValueWallType2 = imp1.kValueWallType2;
	kValueRoofType1 = imp1.kValueRoofType1;
	kValueRoofType2 = imp1.kValueRoofType2;
	kValuePartyWall = imp1.kValuePartyWall;
	kValuePartyFloor = imp1.kValuePartyFloor;
	kValuePartyCeiling = imp1.kValuePartyCeiling;
	kValueIntWall = imp1.kValueIntWall;
	kValueIntFloor	 = imp1.kValueIntFloor;
	kValueIntCeiling = imp1.kValueIntCeiling;

	livingRoomFraction	 = imp1.livingRoomFraction;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	enterYValue = imp1.enterYValue;
	yValueEntry = imp1.yValueEntry;

	ThermBGFPerimeter = imp1.ThermBGFPerimeter;
	ThermBFloorWithingDwellinPerimeter = imp1.ThermBFloorWithingDwellinPerimeter;
	ThermBFloorBetweenDwellinPerimeter = imp1.ThermBFloorBetweenDwellinPerimeter;
	ThermBBalconyWithingDwellingLength = imp1.ThermBBalconyWithingDwellingLength; 
	ThermBBalconyBetweenDwellingLength	 = imp1.ThermBBalconyBetweenDwellingLength;
	ThermBEavesAtCeiling = imp1.ThermBEavesAtCeiling;
	ThermBEavesAtRafter = imp1.ThermBEavesAtRafter;
	ThermBGableAtCeiling = imp1.ThermBGableAtCeiling;
	ThermBGableAtRafter = imp1.ThermBGableAtRafter;
	ThermBLengthNormalCorners = imp1.ThermBLengthNormalCorners;
	ThermBLengthInvertedCorners = imp1.ThermBLengthInvertedCorners;
	ThermBPartWallBetweenDwelling = imp1.ThermBPartWallBetweenDwelling;
	
	ThermBMetalBoxLintelUserDef = imp1.ThermBMetalBoxLintelUserDef;
	ThermBOtherLintelUserDef = imp1.ThermBOtherLintelUserDef;
	ThermBSillUserDef = imp1.ThermBSillUserDef;
	ThermBJambUserDef = imp1.ThermBJambUserDef;
	ThermBGFPerimeterUserDef = imp1.ThermBGFPerimeterUserDef;
	ThermBFloorWithinDwellingUserDef = imp1.ThermBFloorWithinDwellingUserDef;
	ThermBFloorBwDwellingUserDef = imp1.ThermBFloorBwDwellingUserDef;
	ThermBBalcWithinDwellingLengthUserDef = imp1.ThermBBalcWithinDwellingLengthUserDef;
	ThermBBalcBwDwellingLengthUserDef = imp1.ThermBBalcBwDwellingLengthUserDef;
	ThermBEavesInsAtCeilingUserDef = imp1.ThermBEavesInsAtCeilingUserDef;
	ThermBEavesInsAtRafterUserDef= imp1.ThermBEavesInsAtRafterUserDef;
	ThermBGableInsAtCeilingUserDef = imp1.ThermBGableInsAtCeilingUserDef;
	ThermBGableInsAtRafetUserDef = imp1.ThermBGableInsAtRafetUserDef;
	ThermBLengthOfNormalCornersUserDef = imp1.ThermBLengthOfNormalCornersUserDef;
	ThermBLengthOfInvertedCornersUserDef = imp1.ThermBLengthOfInvertedCornersUserDef;
	ThermBPartWallBetweenDwellingUserDef = imp1.ThermBPartWallBetweenDwellingUserDef;

	ThermBMetalBoxLintelSiValue = imp1.ThermBMetalBoxLintelSiValue;
	ThermBOtherLintelsSiValue = imp1.ThermBOtherLintelsSiValue;
	ThermBSillSiValue = imp1.ThermBSillSiValue;
	ThermBJambSiValue = imp1.ThermBJambSiValue;
	ThermBGFPerimeterSiValue = imp1.ThermBGFPerimeterSiValue;
	ThermBFloorWithinDwellingSiValue = imp1. ThermBFloorWithinDwellingSiValue;
	ThermBFloorBetweenDwellingSiValue = imp1.ThermBFloorBetweenDwellingSiValue;
	ThermBBalconyWithinDwellingSiValue = imp1.ThermBBalconyWithinDwellingSiValue;
	ThermBBalconyBwDwellingSiValue = imp1.ThermBBalconyBwDwellingSiValue ;
	ThermBEavesInsAtCelingSiValue = imp1.ThermBEavesInsAtCelingSiValue;
	ThermBEavesInsAtRafterSiValue = imp1. ThermBEavesInsAtRafterSiValue;
	ThermBGableInsAtCeilingSiValue= imp1.ThermBGableInsAtCeilingSiValue;
	ThermBGableInsAtRafterSiValue = imp1.ThermBGableInsAtRafterSiValue;
	ThermBLengthOfNormalCornersSiValue = imp1.ThermBLengthOfNormalCornersSiValue;
	ThermBLengthOfInvertedCornersSiValue = imp1.ThermBLengthOfInvertedCornersSiValue;
	ThermBPartBwDwellingLengthSiValue = imp1.ThermBPartBwDwellingLengthSiValue;

	ThermBMetalBoxLintelResult = imp1.ThermBMetalBoxLintelResult;
	ThermBOtherLintelsResult = imp1.ThermBOtherLintelsResult;
	ThermBSillResult = imp1.ThermBSillResult;
	ThermBJambResult= imp1.ThermBJambResult;
	ThermBGFPerimeterResult = imp1.ThermBGFPerimeterResult;
	ThermBFloorWithinDwellingPerimeterResult = imp1.ThermBFloorWithinDwellingPerimeterResult;
	ThermBFloorBetweenDwellingPerimeterResult = imp1.ThermBFloorBetweenDwellingPerimeterResult;
	ThermBBalcWithDwellingLengthResult = imp1.ThermBBalcWithDwellingLengthResult;
	ThermBBalconyBwDwellingLengthResult = imp1.ThermBBalconyBwDwellingLengthResult;
	ThermBEavesInsCeilingResult = imp1.ThermBEavesInsCeilingResult;
	ThermBEavesInsRafterResult = imp1.ThermBEavesInsRafterResult;
	ThermBGableInsCeilingResult = imp1.ThermBGableInsCeilingResult;
	ThermBGableInsRafterResult = imp1.ThermBGableInsRafterResult;
	ThermBLengthNormalCornersResult = imp1.ThermBLengthNormalCornersResult;
	ThermBLengthInvertedCornersResult = imp1.ThermBLengthInvertedCornersResult;
	ThermBPartyWallBwDwellingResult = imp1.ThermBPartyWallBwDwellingResult;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	numsOpenFirePlaces	 = imp1.numsOpenFirePlaces;
	numsOpenFlues		 = imp1.numsOpenFlues;
	numsFluelessGasFires = imp1.numsFluelessGasFires;
	numsExtractFans		 = imp1.numsExtractFans;
	numsPassiveVents     = imp1.numsPassiveVents;

	mechVentType = imp1.mechVentType;
	MVHRThermalEff  = imp1.MVHRThermalEff;
	SFP = imp1.SFP;

	pressureTestYN  = imp1.pressureTestYN;
	measuredQ50     = imp1.measuredQ50;
	numOfStoreys    = imp1.numOfStoreys;
	structInf		= imp1.structInf;
	floorInf		= imp1.floorInf;
	draughtLobby	= imp1.draughtLobby;
	perWindowDraughtStripped = imp1.perWindowDraughtStripped;
	numOfShelteredSides      = imp1.numOfShelteredSides;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	primaryFuelUsed   = imp1.primaryFuelUsed;
    secFuelUsed       = imp1.secFuelUsed;
	primaryFuelUsedString = imp1.primaryFuelUsedString;
	secFuelUsedString     = imp1.secFuelUsedString;
	electricityTarrif = imp1.electricityTarrif;
	mainHtType		  = imp1.mainHtType;
	mainHtEffFrom     = imp1.mainHtEffFrom;
	boilerType		  = imp1.boilerType;
	mainFuel		  = imp1.mainFuel;
	isFanFluePresent  = imp1.isFanFluePresent;
	mainHtSystem      = imp1.mainHtSystem;
	mainHtControls    = imp1.mainHtControls;
	mainHtEmitter     = imp1.mainHtEmitter;
	isIterlockPresent = imp1.isIterlockPresent;
	mainHtCompensator = imp1.mainHtCompensator;
	isPumpInHeatedSpace= imp1.isPumpInHeatedSpace;
	mainHtManufacturerDesc = imp1.mainHtManufacturerDesc;
	mainHtTestMethod       = imp1.mainHtTestMethod ;
	
	//mainHtEff              = imp1.mainHtEff;
	mainHtEffNominal              = imp1.mainHtEffNominal; //@min

	mainHtFractionSupplied = imp1.mainHtFractionSupplied;
	
	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	oilPumpInHeatedSpace = imp1.oilPumpInHeatedSpace;
	oilBoilerInstalled   = imp1.oilBoilerInstalled;
	CPSUoperatingTemp    = imp1.CPSUoperatingTemp;
	heatEmmFromCase      = imp1.heatEmmFromCase;
	heatTransferredToWater = imp1.heatTransferredToWater;

	isThereCHP		 = imp1.isThereCHP;
	CHPfuel			 = imp1.CHPfuel;
	fractOfHtFromCHP = imp1.fractOfHtFromCHP;
	elecEffOfCHP     = imp1.elecEffOfCHP;
	heatingEffOfCHP  = imp1.heatingEffOfCHP;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	isThereSecHeating		= imp1.isThereSecHeating;
	secHtOpenFlueChimney	= imp1.secHtOpenFlueChimney;
	secHtUnconnectedGasPoint= imp1.secHtUnconnectedGasPoint;
	secHtEffFrom			= imp1.secHtEffFrom;
	secHtFuel				= imp1.secHtFuel;
	secHtSystem				= imp1.secHtSystem;
	secHtManufactDesc		= imp1.secHtManufactDesc;
	secHtTestMethod			= imp1.secHtTestMethod;
	secHtEff				= imp1.secHtEff;
	secHtFraction			= imp1.secHtFraction;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	btnWaterHtFromMainState   = imp1.btnWaterHtFromMainState;
	WHtype					  = imp1.WHtype;
	WHtCylinderWithinDwelling = imp1.WHtCylinderWithinDwelling;
	WHtFuel					  = imp1.WHtFuel;
	WHtWaterSepTimed		  = imp1.WHtWaterSepTimed ;

	WHtCylManufactLossFactor = imp1.WHtCylManufactLossFactor;
	WHtCylDeclaredFactor	 = imp1.WHtCylDeclaredFactor ;
	WHtCylVolume			 = imp1.WHtCylVolume;
	WHtCylInsType			 = imp1.WHtCylInsType;
	WHtCylInsThickness		 = imp1.WHtCylInsThickness;
	WHtCylThermostat		 = imp1.WHtCylThermostat;
	WHtCylInHeatedSpace		 = imp1.WHtCylInHeatedSpace;
	WHtCylPrimaryPipeworkInsulated = imp1.WHtCylPrimaryPipeworkInsulated;
	WHtCylPumpedPrimarySystem = imp1.WHtCylPumpedPrimarySystem;
	WHtEff = imp1.WHtEff;

	WHtTSnCPSUinSingleUnit			= imp1.WHtTSnCPSUinSingleUnit;
	WHtTSnCPSUPrimaryPipeworkLT1_5m = imp1.WHtTSnCPSUPrimaryPipeworkLT1_5m;;
	WHtTSnCPSUstoreInAirCupbrd	    = imp1.WHtTSnCPSUstoreInAirCupbrd;

	WHtCombiKeepHotYN	   = imp1.WHtCombiKeepHotYN;
	DHWfromCommunityScheme = imp1.DHWfromCommunityScheme;
	WHtHeatPumpUsesImmer   = imp1.WHtHeatPumpUsesImmer;
	WHtUsesSummerImmer     = imp1.WHtUsesSummerImmer ;
	
	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	isSHWPresent     = imp1.isSHWPresent;	
	SHWCollectorType = imp1.SHWCollectorType;
	SHWCollectorOrientation = imp1.SHWCollectorOrientation;
	SHWCollectorTilt = imp1.SHWCollectorTilt;
	SHWOvershading   = imp1.SHWOvershading;
	isSHWAreaGross   = imp1.isSHWAreaGross;
	SHWApertureArea     = imp1.SHWApertureArea;
	SHW_ZLCE         = imp1.SHW_ZLCE;
	SHW_HeatLossCoefficient = imp1.SHW_HeatLossCoefficient;
	isSHWSolarStoreCombined = imp1.isSHWSolarStoreCombined;
	SHWSolarCircPump  = imp1.SHWSolarCircPump;
	SHWDedSolStoreVol = imp1.SHWDedSolStoreVol;
	 
	isPVPresent			   = imp1.isPVPresent;
	installedPVPeakPower   = imp1.installedPVPeakPower;
	PVCollectorOrientation = imp1.PVCollectorOrientation;
	PVCollectorTilt        = imp1.PVCollectorTilt;
	PVOvershading          = imp1.PVOvershading ;

	isWTPresent = imp1.isWTPresent;
	WTNumOf		= imp1.WTNumOf;
	WTDiameter  = imp1.WTDiameter;
	WTHeight	= imp1.WTHeight;

	uHydroyn = imp1.uHydroyn;
	uHydroAnnualAvgHead = imp1.uHydroAnnualAvgHead;
	uHydroAnnualAvgFlow = imp1.uHydroAnnualAvgFlow;
	uHydroEff = imp1.uHydroEff;
	
	uCHPyn               = imp1.uCHPyn; 
	uCHPheatToPowerRatio = imp1.uCHPheatToPowerRatio;
	uCHPElectricEff      = imp1.uCHPElectricEff;
	CHPFuel				 = imp1.CHPFuel;
	uCHPHeatingEff		 = imp1.uCHPHeatingEff;
	uCHPHeatingFraction  = imp1.uCHPHeatingFraction;

	MVHRyn		   = imp1.MVHRyn;
	MVHRThermalEff = imp1.MVHRThermalEff;

	FGHRSpresent           = imp1.FGHRSpresent;
	FGHRSstore           = imp1.FGHRSstore;
	FGHRSstoreVolume     = imp1.FGHRSstoreVolume;
	FGHRSusefulFracHtRec_kf1 = imp1.FGHRSusefulFracHtRec_kf1;
	FGHRSfittedMain      = imp1.FGHRSfittedMain;
	FGHRSfittedSec       = imp1.FGHRSfittedSec;
	FGHRStype            = imp1.FGHRStype;
	determineFGHRStype   = imp1.determineFGHRStype;
	FGHRStotFracHeatRec_kf2  = imp1.FGHRStotFracHeatRec_kf2;
	FGHRSauxelec   = imp1.FGHRSauxelec;
	FGHRSpvPoweredHt     = imp1.FGHRSpvPoweredHt;
	FGHRSpvPkPower       = imp1.FGHRSpvPkPower;
	FGHRSpvOrientation = imp1.FGHRSpvOrientation;
	FGHRSpvTilt          = imp1.FGHRSpvTilt;
	FGHRSpvOvershading   = imp1.FGHRSpvOvershading;
	FGHRScableLoss       = imp1.FGHRScableLoss;

	WWHRSpresent    = imp1.WWHRSpresent;
	WWHRSnumOfRooms = imp1.WWHRSnumOfRooms;
	WWHRS1Make      = imp1.WWHRS1Make;
	WWHRSnumMixerShowersWithBath1    = imp1.WWHRSnumMixerShowersWithBath1;
	WWHRSnumMixerShowersWithoutBath1 = imp1.WWHRSnumMixerShowersWithoutBath1;
	WWHRS1Model = imp1.WWHRS1Model;
	WWHRS1ModelQualifier = imp1.WWHRS1ModelQualifier;
	WWHRS2Make                       = imp1.WWHRS2Make;
	WWHRSnumMixerShowersWithBath2    = imp1.WWHRSnumMixerShowersWithBath2;
	WWHRSnumMixerShowersWithoutBath2 = imp1.WWHRSnumMixerShowersWithoutBath2;
	WWHRS2Model                      = imp1.WWHRS2Model;
	WWHRS2ModelQualifier             = imp1.WWHRS2ModelQualifier;

	// ------------------------------------------------------
	//	LIGHTS
	//------------------------------------------------------
	fractionLEL = imp1.fractionLEL;

	// ------------------------------------------------------
	// HEM
	// ------------------------------------------------------
	hemHouseType   = imp1.hemHouseType;
	hemYearOfBuild = imp1.hemYearOfBuild;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	chkInsulation = imp1.chkInsulation;
	hemI_insulationSliderPos = imp1.hemI_insulationSliderPos;

	chkAirtightness = imp1.chkAirtightness;
	hemA_achSliderPos = imp1.hemA_achSliderPos;

	chkCapacity= imp1.chkCapacity;
	hemC_capacitySliderPos = imp1.hemC_capacitySliderPos;

	chkSolarIngress = imp1.chkSolarIngress;
	hemS_solarGainsSliderPos = imp1.hemS_solarGainsSliderPos;

	chkOccupancy = imp1.chkOccupancy;
	hemO_OCCDensitySliderPos = imp1.hemO_OCCDensitySliderPos;

	chkControlledSpace = imp1.chkControlledSpace;
	hemL_LAFracSliderPos = imp1.hemL_LAFracSliderPos;

	chkSDHW = imp1.chkSDHW;
	chkPV   = imp1.chkPV;
	chkWT   = imp1.chkWT;
	chkuCHP = imp1.chkuCHP;
	chkuHydro = imp1.chkuHydro;
	chkPCM    = imp1.chkPCM;
	chkMVHR   = imp1.chkMVHR;
	chkFGHRS  = imp1.chkFGHRS;
	chkWWHRS  = imp1.chkWWHRS;

}


void CopyImprovement2ToCurrent()
{	
//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	JobDetRefNum   = imp2.JobDetRefNum;
	assessorName   = imp2.assessorName;
	JobDetComments = imp2.JobDetComments;
	propertyFlatNameorNum = imp2.propertyFlatNameorNum ;
	propertyLetter = imp2.propertyLetter;
	propertyHouseNum  = imp2.propertyHouseNum;
	propertyStreet = imp2.propertyStreet;
	propertyLocality = imp2.propertyLocality;
	propertyDistrict = imp2.propertyDistrict;
	propertyTown = imp2.propertyTown ;
	propertyCounty = imp2.propertyCounty;
	propertyPostCode = imp2.propertyPostCode;
	clientFlatNameorNum = imp2.clientFlatNameorNum;
	clientLetter = imp2.clientLetter;
	clientHouseorBlockNum = imp2.clientHouseorBlockNum;
	clientStreet = imp2.clientStreet;
	clientLocality = imp2.clientLocality;
	clientDistrict = imp2.clientDistrict;
	clientTown = imp2.clientTown ;
	clientCounty = imp2.clientCounty ;
	clientPostCode = imp2.clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	locationString = imp2.locationString;

	dwellingType = imp2.dwellingType;
	builtForm = imp2.builtForm;
	Detachment = imp2.Detachment;
	FlatPosition  = imp2.FlatPosition;
	yearPropertBuilt = imp2.yearPropertBuilt;
	dwellingShelteredSides = imp2.dwellingShelteredSides;
	dwellingExposure = imp2.dwellingExposure;

	dwellingTerrain = imp2.dwellingTerrain;

	storey1Level = imp2.storey1Level;
	storey2Level = imp2.storey2Level;
	storey3Level = imp2.storey3Level;
	storey4Level = imp2.storey4Level;
	storey5Level = imp2.storey5Level;
	storey6Level = imp2.storey6Level;
	
	storey1 = imp2.storey1;
	storey2 = imp2.storey2;
	storey3 = imp2.storey3;
	storey4 = imp2.storey4;
	storey5 = imp2.storey5;
	storey6 = imp2.storey6;

	storey1Basement = imp2.storey1Basement;
	storey2Basement = imp2.storey2Basement;
	storey3Basement = imp2.storey3Basement;
	storey4Basement = imp2.storey4Basement;
	storey5Basement = imp2.storey5Basement;
	storey6Basement = imp2.storey6Basement;

	storey1Area = imp2.storey1Area;
	storey2Area = imp2.storey2Area;
	storey3Area = imp2.storey3Area;
	storey4Area = imp2.storey4Area;
	storey5Area = imp2.storey5Area;
	storey6Area = imp2.storey6Area;

	storey1Height = imp2.storey1Height;
	storey2Height = imp2.storey2Height;
	storey3Height = imp2.storey3Height;
	storey4Height = imp2.storey4Height;
	storey5Height = imp2.storey5Height;
	storey6Height = imp2.storey6Height;
	TFAfromHEM = imp2.TFAfromHEM;

	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	winNArea  = imp2.winNArea;
	winNEArea = imp2.winNEArea;
	winEArea  = imp2.winEArea;
	winSEArea = imp2.winSEArea;
	winSArea  = imp2.winSArea;
	winSWArea = imp2.winSWArea;
	winWArea  = imp2.winWArea;
	winNWArea = imp2.winNWArea;
	rooflightsArea = imp2.rooflightsArea;

	winNSolTrans  = imp2.winNSolTrans;
	winNESolTrans = imp2.winNESolTrans;
	winESolTrans  = imp2.winESolTrans;
	winSESolTrans = imp2.winSESolTrans;
	winSSolTrans  = imp2.winSSolTrans;
	winSWSolTrans = imp2.winSWSolTrans;
	winWSolTrans  = imp2.winWSolTrans;
	winNWSolTrans = imp2.winNWSolTrans;
	rooflightsSolTrans = imp2.rooflightsSolTrans;

	winNFrameFactor  = imp2.winNFrameFactor;
	winNEFrameFactor = imp2.winNEFrameFactor;
	winEFrameFactor  = imp2.winEFrameFactor;
	winSEFrameFactor = imp2.winSEFrameFactor;
	winSFrameFactor  = imp2.winSFrameFactor;
	winSWFrameFactor = imp2.winSWFrameFactor;
	winWFrameFactor  = imp2.winWFrameFactor;
	winNWFrameFactor = imp2.winNWFrameFactor;
	rooflightsFrameFactor = imp2.rooflightsFrameFactor;

	winOvershading = imp2.winOvershading;
	winGlazing     = imp2.winGlazing;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	grossAreaWall1 = imp2.grossAreaWall1;
	groosAreaRoof1 = imp2.groosAreaRoof1;
	netAreaDoors = imp2.netAreaDoors;;
	netAreaWindows = imp2.netAreaWindows;
	netAreaRoofLights = imp2.netAreaRoofLights ;
	netAreaGF = imp2.netAreaGF;
	netAreaExFloor = imp2.netAreaExFloor ;
	netAreaWallType1 = imp2.netAreaWallType1;
	netAreaWallType2 = imp2.netAreaWallType2;
	netAreaRoofType1= imp2.netAreaRoofType1;
	netAreaRoofType2 = imp2.netAreaRoofType2;
	netAreaPartyWall = imp2.netAreaPartyWall;
	netAreaPartyFloor = imp2.netAreaPartyFloor;
	netAreaPartyCeiling = imp2.netAreaPartyCeiling;
	netAreaInternalWall = imp2.netAreaInternalWall; ;
	netAreaInternalFloor = imp2.netAreaInternalFloor;
	netAreaInternalCeiling = imp2.netAreaInternalCeiling; ;

	UvalueDoors = imp2.UvalueDoors ;
	UvalueWindows = imp2.UvalueWindows;
	UvalueRooflights = imp2.UvalueRooflights;
	UvalueGF = imp2.UvalueGF;
	UvalueExposedFloor = imp2.UvalueExposedFloor;
	UvalueWallType1 = imp2.UvalueWallType1;
	UvalueWallType2 = imp2.UvalueWallType2;
	UvalueRoofTYpe1 = imp2.UvalueRoofTYpe1;
	UvalueRoofType2 = imp2.UvalueRoofType2;
	UvaluePartyWall = imp2.UvaluePartyWall;

	kValueGF = imp2.kValueGF;;
	kValueExpFloor = imp2.kValueExpFloor;
	kValueWallType1 = imp2.kValueWallType1;
	kValueWallType2 = imp2.kValueWallType2;
	kValueRoofType1 = imp2.kValueRoofType1;
	kValueRoofType2 = imp2.kValueRoofType2;
	kValuePartyWall = imp2.kValuePartyWall;
	kValuePartyFloor = imp2.kValuePartyFloor;
	kValuePartyCeiling = imp2.kValuePartyCeiling;
	kValueIntWall = imp2.kValueIntWall;
	kValueIntFloor	 = imp2.kValueIntFloor;
	kValueIntCeiling = imp2.kValueIntCeiling;

	livingRoomFraction	 = imp2.livingRoomFraction;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	enterYValue = imp2.enterYValue;
	yValueEntry = imp2.yValueEntry;

	ThermBGFPerimeter = imp2.ThermBGFPerimeter;
	ThermBFloorWithingDwellinPerimeter = imp2.ThermBFloorWithingDwellinPerimeter;
	ThermBFloorBetweenDwellinPerimeter = imp2.ThermBFloorBetweenDwellinPerimeter;
	ThermBBalconyWithingDwellingLength = imp2.ThermBBalconyWithingDwellingLength; 
	ThermBBalconyBetweenDwellingLength	 = imp2.ThermBBalconyBetweenDwellingLength;
	ThermBEavesAtCeiling = imp2.ThermBEavesAtCeiling;
	ThermBEavesAtRafter = imp2.ThermBEavesAtRafter;
	ThermBGableAtCeiling = imp2.ThermBGableAtCeiling;
	ThermBGableAtRafter = imp2.ThermBGableAtRafter;
	ThermBLengthNormalCorners = imp2.ThermBLengthNormalCorners;
	ThermBLengthInvertedCorners = imp2.ThermBLengthInvertedCorners;
	ThermBPartWallBetweenDwelling = imp2.ThermBPartWallBetweenDwelling;
	
	ThermBMetalBoxLintelUserDef = imp2.ThermBMetalBoxLintelUserDef;
	ThermBOtherLintelUserDef = imp2.ThermBOtherLintelUserDef;
	ThermBSillUserDef = imp2.ThermBSillUserDef;
	ThermBJambUserDef = imp2.ThermBJambUserDef;
	ThermBGFPerimeterUserDef = imp2.ThermBGFPerimeterUserDef;
	ThermBFloorWithinDwellingUserDef = imp2.ThermBFloorWithinDwellingUserDef;
	ThermBFloorBwDwellingUserDef = imp2.ThermBFloorBwDwellingUserDef;
	ThermBBalcWithinDwellingLengthUserDef = imp2.ThermBBalcWithinDwellingLengthUserDef;
	ThermBBalcBwDwellingLengthUserDef = imp2.ThermBBalcBwDwellingLengthUserDef;
	ThermBEavesInsAtCeilingUserDef = imp2.ThermBEavesInsAtCeilingUserDef;
	ThermBEavesInsAtRafterUserDef= imp2.ThermBEavesInsAtRafterUserDef;
	ThermBGableInsAtCeilingUserDef = imp2.ThermBGableInsAtCeilingUserDef;
	ThermBGableInsAtRafetUserDef = imp2.ThermBGableInsAtRafetUserDef;
	ThermBLengthOfNormalCornersUserDef = imp2.ThermBLengthOfNormalCornersUserDef;
	ThermBLengthOfInvertedCornersUserDef = imp2.ThermBLengthOfInvertedCornersUserDef;
	ThermBPartWallBetweenDwellingUserDef = imp2.ThermBPartWallBetweenDwellingUserDef;

	ThermBMetalBoxLintelSiValue = imp2.ThermBMetalBoxLintelSiValue;
	ThermBOtherLintelsSiValue = imp2.ThermBOtherLintelsSiValue;
	ThermBSillSiValue = imp2.ThermBSillSiValue;
	ThermBJambSiValue = imp2.ThermBJambSiValue;
	ThermBGFPerimeterSiValue = imp2.ThermBGFPerimeterSiValue;
	ThermBFloorWithinDwellingSiValue = imp2. ThermBFloorWithinDwellingSiValue;
	ThermBFloorBetweenDwellingSiValue = imp2.ThermBFloorBetweenDwellingSiValue;
	ThermBBalconyWithinDwellingSiValue = imp2.ThermBBalconyWithinDwellingSiValue;
	ThermBBalconyBwDwellingSiValue = imp2.ThermBBalconyBwDwellingSiValue ;
	ThermBEavesInsAtCelingSiValue = imp2.ThermBEavesInsAtCelingSiValue;
	ThermBEavesInsAtRafterSiValue = imp2. ThermBEavesInsAtRafterSiValue;
	ThermBGableInsAtCeilingSiValue= imp2.ThermBGableInsAtCeilingSiValue;
	ThermBGableInsAtRafterSiValue = imp2.ThermBGableInsAtRafterSiValue;
	ThermBLengthOfNormalCornersSiValue = imp2.ThermBLengthOfNormalCornersSiValue;
	ThermBLengthOfInvertedCornersSiValue = imp2.ThermBLengthOfInvertedCornersSiValue;
	ThermBPartBwDwellingLengthSiValue = imp2.ThermBPartBwDwellingLengthSiValue;

	ThermBMetalBoxLintelResult = imp2.ThermBMetalBoxLintelResult;
	ThermBOtherLintelsResult = imp2.ThermBOtherLintelsResult;
	ThermBSillResult = imp2.ThermBSillResult;
	ThermBJambResult= imp2.ThermBJambResult;
	ThermBGFPerimeterResult = imp2.ThermBGFPerimeterResult;
	ThermBFloorWithinDwellingPerimeterResult = imp2.ThermBFloorWithinDwellingPerimeterResult;
	ThermBFloorBetweenDwellingPerimeterResult = imp2.ThermBFloorBetweenDwellingPerimeterResult;
	ThermBBalcWithDwellingLengthResult = imp2.ThermBBalcWithDwellingLengthResult;
	ThermBBalconyBwDwellingLengthResult = imp2.ThermBBalconyBwDwellingLengthResult;
	ThermBEavesInsCeilingResult = imp2.ThermBEavesInsCeilingResult;
	ThermBEavesInsRafterResult = imp2.ThermBEavesInsRafterResult;
	ThermBGableInsCeilingResult = imp2.ThermBGableInsCeilingResult;
	ThermBGableInsRafterResult = imp2.ThermBGableInsRafterResult;
	ThermBLengthNormalCornersResult = imp2.ThermBLengthNormalCornersResult;
	ThermBLengthInvertedCornersResult = imp2.ThermBLengthInvertedCornersResult;
	ThermBPartyWallBwDwellingResult = imp2.ThermBPartyWallBwDwellingResult;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	numsOpenFirePlaces	 = imp2.numsOpenFirePlaces;
	numsOpenFlues		 = imp2.numsOpenFlues;
	numsFluelessGasFires = imp2.numsFluelessGasFires;
	numsExtractFans		 = imp2.numsExtractFans;
	numsPassiveVents     = imp2.numsPassiveVents;

	mechVentType = imp2.mechVentType;
	MVHRThermalEff  = imp2.MVHRThermalEff;
	SFP = imp2.SFP;

	pressureTestYN  = imp2.pressureTestYN;
	measuredQ50     = imp2.measuredQ50;
	numOfStoreys    = imp2.numOfStoreys;
	structInf		= imp2.structInf;
	floorInf		= imp2.floorInf;
	draughtLobby	= imp2.draughtLobby;
	perWindowDraughtStripped = imp2.perWindowDraughtStripped;
	numOfShelteredSides      = imp2.numOfShelteredSides;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	primaryFuelUsed   = imp2.primaryFuelUsed;
    secFuelUsed       = imp2.secFuelUsed;
	primaryFuelUsedString = imp2.primaryFuelUsedString;
	secFuelUsedString     = imp2.secFuelUsedString;
	electricityTarrif = imp2.electricityTarrif;
	mainHtType		  = imp2.mainHtType;
	mainHtEffFrom     = imp2.mainHtEffFrom;
	boilerType		  = imp2.boilerType;
	mainFuel		  = imp2.mainFuel;
	isFanFluePresent  = imp2.isFanFluePresent;
	mainHtSystem      = imp2.mainHtSystem;
	mainHtControls    = imp2.mainHtControls;
	mainHtEmitter     = imp2.mainHtEmitter;
	isIterlockPresent = imp2.isIterlockPresent;
	mainHtCompensator = imp2.mainHtCompensator;
	isPumpInHeatedSpace= imp2.isPumpInHeatedSpace;
	mainHtManufacturerDesc = imp2.mainHtManufacturerDesc;
	mainHtTestMethod       = imp2.mainHtTestMethod ;
//	mainHtEff              = imp2.mainHtEff;
	mainHtEffNominal              = imp2.mainHtEffNominal; //@min

	mainHtFractionSupplied = imp2.mainHtFractionSupplied;
	
	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	oilPumpInHeatedSpace = imp2.oilPumpInHeatedSpace;
	oilBoilerInstalled   = imp2.oilBoilerInstalled;
	CPSUoperatingTemp    = imp2.CPSUoperatingTemp;
	heatEmmFromCase      = imp2.heatEmmFromCase;
	heatTransferredToWater = imp2.heatTransferredToWater;

	isThereCHP		 = imp2.isThereCHP;
	CHPfuel			 = imp2.CHPfuel;
	fractOfHtFromCHP = imp2.fractOfHtFromCHP;
	elecEffOfCHP     = imp2.elecEffOfCHP;
	heatingEffOfCHP  = imp2.heatingEffOfCHP;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	isThereSecHeating		= imp2.isThereSecHeating;
	secHtOpenFlueChimney	= imp2.secHtOpenFlueChimney;
	secHtUnconnectedGasPoint= imp2.secHtUnconnectedGasPoint;
	secHtEffFrom			= imp2.secHtEffFrom;
	secHtFuel				= imp2.secHtFuel;
	secHtSystem				= imp2.secHtSystem;
	secHtManufactDesc		= imp2.secHtManufactDesc;
	secHtTestMethod			= imp2.secHtTestMethod;
	secHtEff				= imp2.secHtEff;
	secHtFraction			= imp2.secHtFraction;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	btnWaterHtFromMainState   = imp2.btnWaterHtFromMainState;
	WHtype					  = imp2.WHtype;
	WHtCylinderWithinDwelling = imp2.WHtCylinderWithinDwelling;
	WHtFuel					  = imp2.WHtFuel;
	WHtWaterSepTimed		  = imp2.WHtWaterSepTimed ;

	WHtCylManufactLossFactor = imp2.WHtCylManufactLossFactor;
	WHtCylDeclaredFactor	 = imp2.WHtCylDeclaredFactor ;
	WHtCylVolume			 = imp2.WHtCylVolume;
	WHtCylInsType			 = imp2.WHtCylInsType;
	WHtCylInsThickness		 = imp2.WHtCylInsThickness;
	WHtCylThermostat		 = imp2.WHtCylThermostat;
	WHtCylInHeatedSpace		 = imp2.WHtCylInHeatedSpace;
	WHtCylPrimaryPipeworkInsulated = imp2.WHtCylPrimaryPipeworkInsulated;
	WHtCylPumpedPrimarySystem = imp2.WHtCylPumpedPrimarySystem;
	WHtEff = imp2.WHtEff;

	WHtTSnCPSUinSingleUnit			= imp2.WHtTSnCPSUinSingleUnit;
	WHtTSnCPSUPrimaryPipeworkLT1_5m = imp2.WHtTSnCPSUPrimaryPipeworkLT1_5m;;
	WHtTSnCPSUstoreInAirCupbrd	    = imp2.WHtTSnCPSUstoreInAirCupbrd;

	WHtCombiKeepHotYN	   = imp2.WHtCombiKeepHotYN;
	DHWfromCommunityScheme = imp2.DHWfromCommunityScheme;
	WHtHeatPumpUsesImmer   = imp2.WHtHeatPumpUsesImmer;
	WHtUsesSummerImmer     = imp2.WHtUsesSummerImmer ;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	isSHWPresent     = imp2.isSHWPresent;	
	SHWCollectorType = imp2.SHWCollectorType;
	SHWCollectorOrientation = imp2.SHWCollectorOrientation;
	SHWCollectorTilt = imp2.SHWCollectorTilt;
	SHWOvershading   = imp2.SHWOvershading;
	isSHWAreaGross   = imp2.isSHWAreaGross;
	SHWApertureArea     = imp2.SHWApertureArea;
	SHW_ZLCE         = imp2.SHW_ZLCE;
	SHW_HeatLossCoefficient = imp2.SHW_HeatLossCoefficient;
	isSHWSolarStoreCombined = imp2.isSHWSolarStoreCombined;
	SHWSolarCircPump  = imp2.SHWSolarCircPump;
	SHWDedSolStoreVol = imp2.SHWDedSolStoreVol;
	 
	isPVPresent			   = imp2.isPVPresent;
	installedPVPeakPower   = imp2.installedPVPeakPower;
	PVCollectorOrientation = imp2.PVCollectorOrientation;
	PVCollectorTilt        = imp2.PVCollectorTilt;
	PVOvershading          = imp2.PVOvershading ;

	isWTPresent = imp2.isWTPresent;
	WTNumOf		= imp2.WTNumOf;
	WTDiameter  = imp2.WTDiameter;
	WTHeight	= imp2.WTHeight;

	uHydroyn = imp2.uHydroyn;
	uHydroAnnualAvgHead = imp2.uHydroAnnualAvgHead;
	uHydroAnnualAvgFlow = imp2.uHydroAnnualAvgFlow;
	uHydroEff = imp2.uHydroEff;

	uCHPyn               = imp2.uCHPyn; 
	uCHPheatToPowerRatio = imp2.uCHPheatToPowerRatio;
	uCHPElectricEff      = imp2.uCHPElectricEff;
	CHPFuel				 = imp2.CHPFuel;
	uCHPHeatingEff		 = imp2.uCHPHeatingEff;
	uCHPHeatingFraction  = imp2.uCHPHeatingFraction;

	MVHRyn		   = imp2.MVHRyn;
	MVHRThermalEff = imp2.MVHRThermalEff;

	FGHRSpresent           = imp2.FGHRSpresent;
	FGHRSstore           = imp2.FGHRSstore;
	FGHRSstoreVolume     = imp2.FGHRSstoreVolume;
	FGHRSusefulFracHtRec_kf1 = imp2.FGHRSusefulFracHtRec_kf1;
	FGHRSfittedMain      = imp2.FGHRSfittedMain;
	FGHRSfittedSec       = imp2.FGHRSfittedSec;
	FGHRStype            = imp2.FGHRStype;
	determineFGHRStype   = imp2.determineFGHRStype;
	FGHRStotFracHeatRec_kf2  = imp2.FGHRStotFracHeatRec_kf2;
	FGHRSauxelec   = imp2.FGHRSauxelec;
	FGHRSpvPoweredHt     = imp2.FGHRSpvPoweredHt;
	FGHRSpvPkPower       = imp2.FGHRSpvPkPower;
	FGHRSpvOrientation = imp2.FGHRSpvOrientation;
	FGHRSpvTilt          = imp2.FGHRSpvTilt;
	FGHRSpvOvershading   = imp2.FGHRSpvOvershading;
	FGHRScableLoss       = imp2.FGHRScableLoss;

	WWHRSpresent    = imp2.WWHRSpresent;
	WWHRSnumOfRooms = imp2.WWHRSnumOfRooms;
	WWHRS1Make      = imp2.WWHRS1Make;
	WWHRSnumMixerShowersWithBath1    = imp2.WWHRSnumMixerShowersWithBath1;
	WWHRSnumMixerShowersWithoutBath1 = imp2.WWHRSnumMixerShowersWithoutBath1;
	WWHRS1Model = imp2.WWHRS1Model;
	WWHRS1ModelQualifier = imp2.WWHRS1ModelQualifier;
	WWHRS2Make                       = imp2.WWHRS2Make;
	WWHRSnumMixerShowersWithBath2    = imp2.WWHRSnumMixerShowersWithBath2;
	WWHRSnumMixerShowersWithoutBath2 = imp2.WWHRSnumMixerShowersWithoutBath2;
	WWHRS2Model                      = imp2.WWHRS2Model;
	WWHRS2ModelQualifier             = imp2.WWHRS2ModelQualifier;
	// ------------------------------------------------------
	//	LIGHTS
	//------------------------------------------------------
	fractionLEL = imp2.fractionLEL;

	// ------------------------------------------------------
	// HEM
	// ------------------------------------------------------
	hemHouseType   = imp2.hemHouseType;
	hemYearOfBuild = imp2.hemYearOfBuild;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	chkInsulation = imp2.chkInsulation;
	hemI_insulationSliderPos = imp2.hemI_insulationSliderPos;

	chkAirtightness = imp2.chkAirtightness;
	hemA_achSliderPos = imp2.hemA_achSliderPos;

	chkCapacity= imp2.chkCapacity;
	hemC_capacitySliderPos = imp2.hemC_capacitySliderPos;

	chkSolarIngress = imp2.chkSolarIngress;
	hemS_solarGainsSliderPos = imp2.hemS_solarGainsSliderPos;

	chkOccupancy = imp2.chkOccupancy;
	hemO_OCCDensitySliderPos = imp2.hemO_OCCDensitySliderPos;

	chkControlledSpace = imp2.chkControlledSpace;
	hemL_LAFracSliderPos = imp2.hemL_LAFracSliderPos;

	chkSDHW = imp2.chkSDHW;
	chkPV   = imp2.chkPV;
	chkWT   = imp2.chkWT;
	chkuCHP = imp2.chkuCHP;
	chkuHydro = imp2.chkuHydro;
	chkPCM    = imp2.chkPCM;
	chkMVHR   = imp2.chkMVHR;
	chkFGHRS  = imp2.chkFGHRS;
	chkWWHRS  = imp2.chkWWHRS;

	
}


void CopyImprovement3ToCurrent()
{	
//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	JobDetRefNum   = imp3.JobDetRefNum;
	assessorName   = imp3.assessorName;
	JobDetComments = imp3.JobDetComments;
	propertyFlatNameorNum = imp3.propertyFlatNameorNum ;
	propertyLetter = imp3.propertyLetter;
	propertyHouseNum  = imp3.propertyHouseNum;
	propertyStreet = imp3.propertyStreet;
	propertyLocality = imp3.propertyLocality;
	propertyDistrict = imp3.propertyDistrict;
	propertyTown = imp3.propertyTown ;
	propertyCounty = imp3.propertyCounty;
	propertyPostCode = imp3.propertyPostCode;
	clientFlatNameorNum = imp3.clientFlatNameorNum;
	clientLetter = imp3.clientLetter;
	clientHouseorBlockNum = imp3.clientHouseorBlockNum;
	clientStreet = imp3.clientStreet;
	clientLocality = imp3.clientLocality;
	clientDistrict = imp3.clientDistrict;
	clientTown = imp3.clientTown ;
	clientCounty = imp3.clientCounty ;
	clientPostCode = imp3.clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	locationString = imp3.locationString;

	dwellingType = imp3.dwellingType;
	builtForm = imp3.builtForm;
	Detachment = imp3.Detachment;
	FlatPosition  = imp3.FlatPosition;
	yearPropertBuilt = imp3.yearPropertBuilt;
	dwellingShelteredSides = imp3.dwellingShelteredSides;
	dwellingExposure = imp3.dwellingExposure;

	dwellingTerrain = imp3.dwellingTerrain;

	storey1Level = imp3.storey1Level;
	storey2Level = imp3.storey2Level;
	storey3Level = imp3.storey3Level;
	storey4Level = imp3.storey4Level;
	storey5Level = imp3.storey5Level;
	storey6Level = imp3.storey6Level;
	
	storey1 = imp3.storey1;
	storey2 = imp3.storey2;
	storey3 = imp3.storey3;
	storey4 = imp3.storey4;
	storey5 = imp3.storey5;
	storey6 = imp3.storey6;

	storey1Basement = imp3.storey1Basement;
	storey2Basement = imp3.storey2Basement;
	storey3Basement = imp3.storey3Basement;
	storey4Basement = imp3.storey4Basement;
	storey5Basement = imp3.storey5Basement;
	storey6Basement = imp3.storey6Basement;

	storey1Area = imp3.storey1Area;
	storey2Area = imp3.storey2Area;
	storey3Area = imp3.storey3Area;
	storey4Area = imp3.storey4Area;
	storey5Area = imp3.storey5Area;
	storey6Area = imp3.storey6Area;

	storey1Height = imp3.storey1Height;
	storey2Height = imp3.storey2Height;
	storey3Height = imp3.storey3Height;
	storey4Height = imp3.storey4Height;
	storey5Height = imp3.storey5Height;
	storey6Height = imp3.storey6Height;
	TFAfromHEM = imp3.TFAfromHEM;

	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	winNArea  = imp3.winNArea;
	winNEArea = imp3.winNEArea;
	winEArea  = imp3.winEArea;
	winSEArea = imp3.winSEArea;
	winSArea  = imp3.winSArea;
	winSWArea = imp3.winSWArea;
	winWArea  = imp3.winWArea;
	winNWArea = imp3.winNWArea;
	rooflightsArea = imp3.rooflightsArea;

	winNSolTrans  = imp3.winNSolTrans;
	winNESolTrans = imp3.winNESolTrans;
	winESolTrans  = imp3.winESolTrans;
	winSESolTrans = imp3.winSESolTrans;
	winSSolTrans  = imp3.winSSolTrans;
	winSWSolTrans = imp3.winSWSolTrans;
	winWSolTrans  = imp3.winWSolTrans;
	winNWSolTrans = imp3.winNWSolTrans;
	rooflightsSolTrans = imp3.rooflightsSolTrans;

	winNFrameFactor  = imp3.winNFrameFactor;
	winNEFrameFactor = imp3.winNEFrameFactor;
	winEFrameFactor  = imp3.winEFrameFactor;
	winSEFrameFactor = imp3.winSEFrameFactor;
	winSFrameFactor  = imp3.winSFrameFactor;
	winSWFrameFactor = imp3.winSWFrameFactor;
	winWFrameFactor  = imp3.winWFrameFactor;
	winNWFrameFactor = imp3.winNWFrameFactor;
	rooflightsFrameFactor = imp3.rooflightsFrameFactor;

	winOvershading = imp3.winOvershading;
	winGlazing     = imp3.winGlazing;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	grossAreaWall1 = imp3.grossAreaWall1;
	groosAreaRoof1 = imp3.groosAreaRoof1;
	netAreaDoors = imp3.netAreaDoors;;
	netAreaWindows = imp3.netAreaWindows;
	netAreaRoofLights = imp3.netAreaRoofLights ;
	netAreaGF = imp3.netAreaGF;
	netAreaExFloor = imp3.netAreaExFloor ;
	netAreaWallType1 = imp3.netAreaWallType1;
	netAreaWallType2 = imp3.netAreaWallType2;
	netAreaRoofType1= imp3.netAreaRoofType1;
	netAreaRoofType2 = imp3.netAreaRoofType2;
	netAreaPartyWall = imp3.netAreaPartyWall;
	netAreaPartyFloor = imp3.netAreaPartyFloor;
	netAreaPartyCeiling = imp3.netAreaPartyCeiling;
	netAreaInternalWall = imp3.netAreaInternalWall; ;
	netAreaInternalFloor = imp3.netAreaInternalFloor;
	netAreaInternalCeiling = imp3.netAreaInternalCeiling; ;

	UvalueDoors = imp3.UvalueDoors ;
	UvalueWindows = imp3.UvalueWindows;
	UvalueRooflights = imp3.UvalueRooflights;
	UvalueGF = imp3.UvalueGF;
	UvalueExposedFloor = imp3.UvalueExposedFloor;
	UvalueWallType1 = imp3.UvalueWallType1;
	UvalueWallType2 = imp3.UvalueWallType2;
	UvalueRoofTYpe1 = imp3.UvalueRoofTYpe1;
	UvalueRoofType2 = imp3.UvalueRoofType2;
	UvaluePartyWall = imp3.UvaluePartyWall;

	kValueGF = imp3.kValueGF;;
	kValueExpFloor = imp3.kValueExpFloor;
	kValueWallType1 = imp3.kValueWallType1;
	kValueWallType2 = imp3.kValueWallType2;
	kValueRoofType1 = imp3.kValueRoofType1;
	kValueRoofType2 = imp3.kValueRoofType2;
	kValuePartyWall = imp3.kValuePartyWall;
	kValuePartyFloor = imp3.kValuePartyFloor;
	kValuePartyCeiling = imp3.kValuePartyCeiling;
	kValueIntWall = imp3.kValueIntWall;
	kValueIntFloor	 = imp3.kValueIntFloor;
	kValueIntCeiling = imp3.kValueIntCeiling;

	livingRoomFraction	 = imp3.livingRoomFraction;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	enterYValue = imp3.enterYValue;
	yValueEntry = imp3.yValueEntry;

	ThermBGFPerimeter = imp3.ThermBGFPerimeter;
	ThermBFloorWithingDwellinPerimeter = imp3.ThermBFloorWithingDwellinPerimeter;
	ThermBFloorBetweenDwellinPerimeter = imp3.ThermBFloorBetweenDwellinPerimeter;
	ThermBBalconyWithingDwellingLength = imp3.ThermBBalconyWithingDwellingLength; 
	ThermBBalconyBetweenDwellingLength	 = imp3.ThermBBalconyBetweenDwellingLength;
	ThermBEavesAtCeiling = imp3.ThermBEavesAtCeiling;
	ThermBEavesAtRafter = imp3.ThermBEavesAtRafter;
	ThermBGableAtCeiling = imp3.ThermBGableAtCeiling;
	ThermBGableAtRafter = imp3.ThermBGableAtRafter;
	ThermBLengthNormalCorners = imp3.ThermBLengthNormalCorners;
	ThermBLengthInvertedCorners = imp3.ThermBLengthInvertedCorners;
	ThermBPartWallBetweenDwelling = imp3.ThermBPartWallBetweenDwelling;
	
	ThermBMetalBoxLintelUserDef = imp3.ThermBMetalBoxLintelUserDef;
	ThermBOtherLintelUserDef = imp3.ThermBOtherLintelUserDef;
	ThermBSillUserDef = imp3.ThermBSillUserDef;
	ThermBJambUserDef = imp3.ThermBJambUserDef;
	ThermBGFPerimeterUserDef = imp3.ThermBGFPerimeterUserDef;
	ThermBFloorWithinDwellingUserDef = imp3.ThermBFloorWithinDwellingUserDef;
	ThermBFloorBwDwellingUserDef = imp3.ThermBFloorBwDwellingUserDef;
	ThermBBalcWithinDwellingLengthUserDef = imp3.ThermBBalcWithinDwellingLengthUserDef;
	ThermBBalcBwDwellingLengthUserDef = imp3.ThermBBalcBwDwellingLengthUserDef;
	ThermBEavesInsAtCeilingUserDef = imp3.ThermBEavesInsAtCeilingUserDef;
	ThermBEavesInsAtRafterUserDef= imp3.ThermBEavesInsAtRafterUserDef;
	ThermBGableInsAtCeilingUserDef = imp3.ThermBGableInsAtCeilingUserDef;
	ThermBGableInsAtRafetUserDef = imp3.ThermBGableInsAtRafetUserDef;
	ThermBLengthOfNormalCornersUserDef = imp3.ThermBLengthOfNormalCornersUserDef;
	ThermBLengthOfInvertedCornersUserDef = imp3.ThermBLengthOfInvertedCornersUserDef;
	ThermBPartWallBetweenDwellingUserDef = imp3.ThermBPartWallBetweenDwellingUserDef;

	ThermBMetalBoxLintelSiValue = imp3.ThermBMetalBoxLintelSiValue;
	ThermBOtherLintelsSiValue = imp3.ThermBOtherLintelsSiValue;
	ThermBSillSiValue = imp3.ThermBSillSiValue;
	ThermBJambSiValue = imp3.ThermBJambSiValue;
	ThermBGFPerimeterSiValue = imp3.ThermBGFPerimeterSiValue;
	ThermBFloorWithinDwellingSiValue = imp3. ThermBFloorWithinDwellingSiValue;
	ThermBFloorBetweenDwellingSiValue = imp3.ThermBFloorBetweenDwellingSiValue;
	ThermBBalconyWithinDwellingSiValue = imp3.ThermBBalconyWithinDwellingSiValue;
	ThermBBalconyBwDwellingSiValue = imp3.ThermBBalconyBwDwellingSiValue ;
	ThermBEavesInsAtCelingSiValue = imp3.ThermBEavesInsAtCelingSiValue;
	ThermBEavesInsAtRafterSiValue = imp3. ThermBEavesInsAtRafterSiValue;
	ThermBGableInsAtCeilingSiValue= imp3.ThermBGableInsAtCeilingSiValue;
	ThermBGableInsAtRafterSiValue = imp3.ThermBGableInsAtRafterSiValue;
	ThermBLengthOfNormalCornersSiValue = imp3.ThermBLengthOfNormalCornersSiValue;
	ThermBLengthOfInvertedCornersSiValue = imp3.ThermBLengthOfInvertedCornersSiValue;
	ThermBPartBwDwellingLengthSiValue = imp3.ThermBPartBwDwellingLengthSiValue;

	ThermBMetalBoxLintelResult = imp3.ThermBMetalBoxLintelResult;
	ThermBOtherLintelsResult = imp3.ThermBOtherLintelsResult;
	ThermBSillResult = imp3.ThermBSillResult;
	ThermBJambResult= imp3.ThermBJambResult;
	ThermBGFPerimeterResult = imp3.ThermBGFPerimeterResult;
	ThermBFloorWithinDwellingPerimeterResult = imp3.ThermBFloorWithinDwellingPerimeterResult;
	ThermBFloorBetweenDwellingPerimeterResult = imp3.ThermBFloorBetweenDwellingPerimeterResult;
	ThermBBalcWithDwellingLengthResult = imp3.ThermBBalcWithDwellingLengthResult;
	ThermBBalconyBwDwellingLengthResult = imp3.ThermBBalconyBwDwellingLengthResult;
	ThermBEavesInsCeilingResult = imp3.ThermBEavesInsCeilingResult;
	ThermBEavesInsRafterResult = imp3.ThermBEavesInsRafterResult;
	ThermBGableInsCeilingResult = imp3.ThermBGableInsCeilingResult;
	ThermBGableInsRafterResult = imp3.ThermBGableInsRafterResult;
	ThermBLengthNormalCornersResult = imp3.ThermBLengthNormalCornersResult;
	ThermBLengthInvertedCornersResult = imp3.ThermBLengthInvertedCornersResult;
	ThermBPartyWallBwDwellingResult = imp3.ThermBPartyWallBwDwellingResult;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	numsOpenFirePlaces	 = imp3.numsOpenFirePlaces;
	numsOpenFlues		 = imp3.numsOpenFlues;
	numsFluelessGasFires = imp3.numsFluelessGasFires;
	numsExtractFans		 = imp3.numsExtractFans;
	numsPassiveVents     = imp3.numsPassiveVents;

	mechVentType = imp3.mechVentType;
	MVHRThermalEff  = imp3.MVHRThermalEff;
	SFP = imp3.SFP;

	pressureTestYN  = imp3.pressureTestYN;
	measuredQ50     = imp3.measuredQ50;
	numOfStoreys    = imp3.numOfStoreys;
	structInf		= imp3.structInf;
	floorInf		= imp3.floorInf;
	draughtLobby	= imp3.draughtLobby;
	perWindowDraughtStripped = imp3.perWindowDraughtStripped;
	numOfShelteredSides      = imp3.numOfShelteredSides;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	primaryFuelUsed   = imp3.primaryFuelUsed;
    secFuelUsed       = imp3.secFuelUsed;
	primaryFuelUsedString = imp3.primaryFuelUsedString;
	secFuelUsedString     = imp3.secFuelUsedString;
	electricityTarrif = imp3.electricityTarrif;
	mainHtType		  = imp3.mainHtType;
	mainHtEffFrom     = imp3.mainHtEffFrom;
	boilerType		  = imp3.boilerType;
	mainFuel		  = imp3.mainFuel;
	isFanFluePresent  = imp3.isFanFluePresent;
	mainHtSystem      = imp3.mainHtSystem;
	mainHtControls    = imp3.mainHtControls;
	mainHtEmitter     = imp3.mainHtEmitter;
	isIterlockPresent = imp3.isIterlockPresent;
	mainHtCompensator = imp3.mainHtCompensator;
	isPumpInHeatedSpace= imp3.isPumpInHeatedSpace;
	mainHtManufacturerDesc = imp3.mainHtManufacturerDesc;
	mainHtTestMethod       = imp3.mainHtTestMethod ;
	
	//mainHtEff              = imp3.mainHtEff;
	mainHtEffNominal              = imp3.mainHtEffNominal; //@min
	
		mainHtFractionSupplied = imp3.mainHtFractionSupplied;
	
	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	oilPumpInHeatedSpace = imp3.oilPumpInHeatedSpace;
	oilBoilerInstalled   = imp3.oilBoilerInstalled;
	CPSUoperatingTemp    = imp3.CPSUoperatingTemp;
	heatEmmFromCase      = imp3.heatEmmFromCase;
	heatTransferredToWater = imp3.heatTransferredToWater;

	isThereCHP		 = imp3.isThereCHP;
	CHPfuel			 = imp3.CHPfuel;
	fractOfHtFromCHP = imp3.fractOfHtFromCHP;
	elecEffOfCHP     = imp3.elecEffOfCHP;
	heatingEffOfCHP  = imp3.heatingEffOfCHP;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	isThereSecHeating		= imp3.isThereSecHeating;
	secHtOpenFlueChimney	= imp3.secHtOpenFlueChimney;
	secHtUnconnectedGasPoint= imp3.secHtUnconnectedGasPoint;
	secHtEffFrom			= imp3.secHtEffFrom;
	secHtFuel				= imp3.secHtFuel;
	secHtSystem				= imp3.secHtSystem;
	secHtManufactDesc		= imp3.secHtManufactDesc;
	secHtTestMethod			= imp3.secHtTestMethod;
	secHtEff				= imp3.secHtEff;
	secHtFraction			= imp3.secHtFraction;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	btnWaterHtFromMainState   = imp3.btnWaterHtFromMainState;
	WHtype					  = imp3.WHtype;
	WHtCylinderWithinDwelling = imp3.WHtCylinderWithinDwelling;
	WHtFuel					  = imp3.WHtFuel;
	WHtWaterSepTimed		  = imp3.WHtWaterSepTimed ;

	WHtCylManufactLossFactor = imp3.WHtCylManufactLossFactor;
	WHtCylDeclaredFactor	 = imp3.WHtCylDeclaredFactor ;
	WHtCylVolume			 = imp3.WHtCylVolume;
	WHtCylInsType			 = imp3.WHtCylInsType;
	WHtCylInsThickness		 = imp3.WHtCylInsThickness;
	WHtCylThermostat		 = imp3.WHtCylThermostat;
	WHtCylInHeatedSpace		 = imp3.WHtCylInHeatedSpace;
	WHtCylPrimaryPipeworkInsulated = imp3.WHtCylPrimaryPipeworkInsulated;
	WHtCylPumpedPrimarySystem = imp3.WHtCylPumpedPrimarySystem;
	WHtEff = imp3.WHtEff;

	WHtTSnCPSUinSingleUnit			= imp3.WHtTSnCPSUinSingleUnit;
	WHtTSnCPSUPrimaryPipeworkLT1_5m = imp3.WHtTSnCPSUPrimaryPipeworkLT1_5m;;
	WHtTSnCPSUstoreInAirCupbrd	    = imp3.WHtTSnCPSUstoreInAirCupbrd;

	WHtCombiKeepHotYN	   = imp3.WHtCombiKeepHotYN;
	DHWfromCommunityScheme = imp3.DHWfromCommunityScheme;
	WHtHeatPumpUsesImmer   = imp3.WHtHeatPumpUsesImmer;
	WHtUsesSummerImmer     = imp3.WHtUsesSummerImmer ;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	isSHWPresent     = imp3.isSHWPresent;	
	SHWCollectorType = imp3.SHWCollectorType;
	SHWCollectorOrientation = imp3.SHWCollectorOrientation;
	SHWCollectorTilt = imp3.SHWCollectorTilt;
	SHWOvershading   = imp3.SHWOvershading;
	isSHWAreaGross   = imp3.isSHWAreaGross;
	SHWApertureArea     = imp3.SHWApertureArea;
	SHW_ZLCE         = imp3.SHW_ZLCE;
	SHW_HeatLossCoefficient = imp3.SHW_HeatLossCoefficient;
	isSHWSolarStoreCombined = imp3.isSHWSolarStoreCombined;
	SHWSolarCircPump  = imp3.SHWSolarCircPump;
	SHWDedSolStoreVol = imp3.SHWDedSolStoreVol;
	 
	isPVPresent			   = imp3.isPVPresent;
	installedPVPeakPower   = imp3.installedPVPeakPower;
	PVCollectorOrientation = imp3.PVCollectorOrientation;
	PVCollectorTilt        = imp3.PVCollectorTilt;
	PVOvershading          = imp3.PVOvershading ;

	isWTPresent = imp3.isWTPresent;
	WTNumOf		= imp3.WTNumOf;
	WTDiameter  = imp3.WTDiameter;
	WTHeight	= imp3.WTHeight;

	uHydroyn = imp3.uHydroyn;
	uHydroAnnualAvgHead = imp3.uHydroAnnualAvgHead;
	uHydroAnnualAvgFlow = imp3.uHydroAnnualAvgFlow;
	uHydroEff = imp3.uHydroEff;
	
	uCHPyn               = imp3.uCHPyn; 
	uCHPheatToPowerRatio = imp3.uCHPheatToPowerRatio;
	uCHPElectricEff      = imp3.uCHPElectricEff;
	CHPFuel				 = imp3.CHPFuel;
	uCHPHeatingEff		 = imp3.uCHPHeatingEff;
	uCHPHeatingFraction  = imp3.uCHPHeatingFraction;

	MVHRyn		   = imp3.MVHRyn;
	MVHRThermalEff = imp3.MVHRThermalEff;

	FGHRSpresent           = imp3.FGHRSpresent;
	FGHRSstore           = imp3.FGHRSstore;
	FGHRSstoreVolume     = imp3.FGHRSstoreVolume;
	FGHRSusefulFracHtRec_kf1 = imp3.FGHRSusefulFracHtRec_kf1;
	FGHRSfittedMain      = imp3.FGHRSfittedMain;
	FGHRSfittedSec       = imp3.FGHRSfittedSec;
	FGHRStype            = imp3.FGHRStype;
	determineFGHRStype   = imp3.determineFGHRStype;
	FGHRStotFracHeatRec_kf2  = imp3.FGHRStotFracHeatRec_kf2;
	FGHRSauxelec   = imp3.FGHRSauxelec;
	FGHRSpvPoweredHt     = imp3.FGHRSpvPoweredHt;
	FGHRSpvPkPower       = imp3.FGHRSpvPkPower;
	FGHRSpvOrientation = imp3.FGHRSpvOrientation;
	FGHRSpvTilt          = imp3.FGHRSpvTilt;
	FGHRSpvOvershading   = imp3.FGHRSpvOvershading;
	FGHRScableLoss       = imp3.FGHRScableLoss;

	WWHRSpresent    = imp3.WWHRSpresent;
	WWHRSnumOfRooms = imp3.WWHRSnumOfRooms;
	WWHRS1Make      = imp3.WWHRS1Make;
	WWHRSnumMixerShowersWithBath1    = imp3.WWHRSnumMixerShowersWithBath1;
	WWHRSnumMixerShowersWithoutBath1 = imp3.WWHRSnumMixerShowersWithoutBath1;
	WWHRS1Model = imp3.WWHRS1Model;
	WWHRS1ModelQualifier = imp3.WWHRS1ModelQualifier;
	WWHRS2Make                       = imp3.WWHRS2Make;
	WWHRSnumMixerShowersWithBath2    = imp3.WWHRSnumMixerShowersWithBath2;
	WWHRSnumMixerShowersWithoutBath2 = imp3.WWHRSnumMixerShowersWithoutBath2;
	WWHRS2Model                      = imp3.WWHRS2Model;
	WWHRS2ModelQualifier             = imp3.WWHRS2ModelQualifier;
	// ------------------------------------------------------
	//	LIGHTS
	//------------------------------------------------------
	fractionLEL = imp3.fractionLEL;

	// ------------------------------------------------------
	// HEM
	// ------------------------------------------------------
	hemHouseType   = imp3.hemHouseType;
	hemYearOfBuild = imp3.hemYearOfBuild;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	chkInsulation = imp3.chkInsulation;
	hemI_insulationSliderPos = imp3.hemI_insulationSliderPos;

	chkAirtightness = imp3.chkAirtightness;
	hemA_achSliderPos = imp3.hemA_achSliderPos;

	chkCapacity= imp3.chkCapacity;
	hemC_capacitySliderPos = imp3.hemC_capacitySliderPos;

	chkSolarIngress = imp3.chkSolarIngress;
	hemS_solarGainsSliderPos = imp3.hemS_solarGainsSliderPos;

	chkOccupancy = imp3.chkOccupancy;
	hemO_OCCDensitySliderPos = imp3.hemO_OCCDensitySliderPos;

	chkControlledSpace = imp3.chkControlledSpace;
	hemL_LAFracSliderPos = imp3.hemL_LAFracSliderPos;

	chkSDHW = imp3.chkSDHW;
	chkPV   = imp3.chkPV;
	chkWT   = imp3.chkWT;
	chkuCHP = imp3.chkuCHP;
	chkuHydro = imp3.chkuHydro;
	chkPCM    = imp3.chkPCM;
	chkMVHR   = imp3.chkMVHR;	
	chkFGHRS  = imp3.chkFGHRS;
	chkWWHRS  = imp3.chkWWHRS;	
}


void CopyImprovement4ToCurrent()
{	
//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	JobDetRefNum   = imp4.JobDetRefNum;
	assessorName   = imp4.assessorName;
	JobDetComments = imp4.JobDetComments;
	propertyFlatNameorNum = imp4.propertyFlatNameorNum ;
	propertyLetter = imp4.propertyLetter;
	propertyHouseNum  = imp4.propertyHouseNum;
	propertyStreet = imp4.propertyStreet;
	propertyLocality = imp4.propertyLocality;
	propertyDistrict = imp4.propertyDistrict;
	propertyTown = imp4.propertyTown ;
	propertyCounty = imp4.propertyCounty;
	propertyPostCode = imp4.propertyPostCode;
	clientFlatNameorNum = imp4.clientFlatNameorNum;
	clientLetter = imp4.clientLetter;
	clientHouseorBlockNum = imp4.clientHouseorBlockNum;
	clientStreet = imp4.clientStreet;
	clientLocality = imp4.clientLocality;
	clientDistrict = imp4.clientDistrict;
	clientTown = imp4.clientTown ;
	clientCounty = imp4.clientCounty ;
	clientPostCode = imp4.clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	locationString = imp4.locationString;

	dwellingType = imp4.dwellingType;
	builtForm = imp4.builtForm;
	Detachment = imp4.Detachment;
	FlatPosition  = imp4.FlatPosition;
	yearPropertBuilt = imp4.yearPropertBuilt;
	dwellingShelteredSides = imp4.dwellingShelteredSides;
	dwellingExposure = imp4.dwellingExposure;

	dwellingTerrain = imp4.dwellingTerrain;

	storey1Level = imp4.storey1Level;
	storey2Level = imp4.storey2Level;
	storey3Level = imp4.storey3Level;
	storey4Level = imp4.storey4Level;
	storey5Level = imp4.storey5Level;
	storey6Level = imp4.storey6Level;
	
	storey1 = imp4.storey1;
	storey2 = imp4.storey2;
	storey3 = imp4.storey3;
	storey4 = imp4.storey4;
	storey5 = imp4.storey5;
	storey6 = imp4.storey6;

	storey1Basement = imp4.storey1Basement;
	storey2Basement = imp4.storey2Basement;
	storey3Basement = imp4.storey3Basement;
	storey4Basement = imp4.storey4Basement;
	storey5Basement = imp4.storey5Basement;
	storey6Basement = imp4.storey6Basement;

	storey1Area = imp4.storey1Area;
	storey2Area = imp4.storey2Area;
	storey3Area = imp4.storey3Area;
	storey4Area = imp4.storey4Area;
	storey5Area = imp4.storey5Area;
	storey6Area = imp4.storey6Area;

	storey1Height = imp4.storey1Height;
	storey2Height = imp4.storey2Height;
	storey3Height = imp4.storey3Height;
	storey4Height = imp4.storey4Height;
	storey5Height = imp4.storey5Height;
	storey6Height = imp4.storey6Height;
	TFAfromHEM = imp4.TFAfromHEM;

	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	winNArea  = imp4.winNArea;
	winNEArea = imp4.winNEArea;
	winEArea  = imp4.winEArea;
	winSEArea = imp4.winSEArea;
	winSArea  = imp4.winSArea;
	winSWArea = imp4.winSWArea;
	winWArea  = imp4.winWArea;
	winNWArea = imp4.winNWArea;
	rooflightsArea = imp4.rooflightsArea;

	winNSolTrans  = imp4.winNSolTrans;
	winNESolTrans = imp4.winNESolTrans;
	winESolTrans  = imp4.winESolTrans;
	winSESolTrans = imp4.winSESolTrans;
	winSSolTrans  = imp4.winSSolTrans;
	winSWSolTrans = imp4.winSWSolTrans;
	winWSolTrans  = imp4.winWSolTrans;
	winNWSolTrans = imp4.winNWSolTrans;
	rooflightsSolTrans = imp4.rooflightsSolTrans;

	winNFrameFactor  = imp4.winNFrameFactor;
	winNEFrameFactor = imp4.winNEFrameFactor;
	winEFrameFactor  = imp4.winEFrameFactor;
	winSEFrameFactor = imp4.winSEFrameFactor;
	winSFrameFactor  = imp4.winSFrameFactor;
	winSWFrameFactor = imp4.winSWFrameFactor;
	winWFrameFactor  = imp4.winWFrameFactor;
	winNWFrameFactor = imp4.winNWFrameFactor;
	rooflightsFrameFactor = imp4.rooflightsFrameFactor;

	winOvershading = imp4.winOvershading;
	winGlazing     = imp4.winGlazing;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	grossAreaWall1 = imp4.grossAreaWall1;
	groosAreaRoof1 = imp4.groosAreaRoof1;
	netAreaDoors = imp4.netAreaDoors;;
	netAreaWindows = imp4.netAreaWindows;
	netAreaRoofLights = imp4.netAreaRoofLights ;
	netAreaGF = imp4.netAreaGF;
	netAreaExFloor = imp4.netAreaExFloor ;
	netAreaWallType1 = imp4.netAreaWallType1;
	netAreaWallType2 = imp4.netAreaWallType2;
	netAreaRoofType1= imp4.netAreaRoofType1;
	netAreaRoofType2 = imp4.netAreaRoofType2;
	netAreaPartyWall = imp4.netAreaPartyWall;
	netAreaPartyFloor = imp4.netAreaPartyFloor;
	netAreaPartyCeiling = imp4.netAreaPartyCeiling;
	netAreaInternalWall = imp4.netAreaInternalWall; ;
	netAreaInternalFloor = imp4.netAreaInternalFloor;
	netAreaInternalCeiling = imp4.netAreaInternalCeiling; ;

	UvalueDoors = imp4.UvalueDoors ;
	UvalueWindows = imp4.UvalueWindows;
	UvalueRooflights = imp4.UvalueRooflights;
	UvalueGF = imp4.UvalueGF;
	UvalueExposedFloor = imp4.UvalueExposedFloor;
	UvalueWallType1 = imp4.UvalueWallType1;
	UvalueWallType2 = imp4.UvalueWallType2;
	UvalueRoofTYpe1 = imp4.UvalueRoofTYpe1;
	UvalueRoofType2 = imp4.UvalueRoofType2;
	UvaluePartyWall = imp4.UvaluePartyWall;

	kValueGF = imp4.kValueGF;;
	kValueExpFloor = imp4.kValueExpFloor;
	kValueWallType1 = imp4.kValueWallType1;
	kValueWallType2 = imp4.kValueWallType2;
	kValueRoofType1 = imp4.kValueRoofType1;
	kValueRoofType2 = imp4.kValueRoofType2;
	kValuePartyWall = imp4.kValuePartyWall;
	kValuePartyFloor = imp4.kValuePartyFloor;
	kValuePartyCeiling = imp4.kValuePartyCeiling;
	kValueIntWall = imp4.kValueIntWall;
	kValueIntFloor	 = imp4.kValueIntFloor;
	kValueIntCeiling = imp4.kValueIntCeiling;

	livingRoomFraction	 = imp4.livingRoomFraction;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	enterYValue = imp4.enterYValue;
	yValueEntry = imp4.yValueEntry;

	ThermBGFPerimeter = imp4.ThermBGFPerimeter;
	ThermBFloorWithingDwellinPerimeter = imp4.ThermBFloorWithingDwellinPerimeter;
	ThermBFloorBetweenDwellinPerimeter = imp4.ThermBFloorBetweenDwellinPerimeter;
	ThermBBalconyWithingDwellingLength = imp4.ThermBBalconyWithingDwellingLength; 
	ThermBBalconyBetweenDwellingLength	 = imp4.ThermBBalconyBetweenDwellingLength;
	ThermBEavesAtCeiling = imp4.ThermBEavesAtCeiling;
	ThermBEavesAtRafter = imp4.ThermBEavesAtRafter;
	ThermBGableAtCeiling = imp4.ThermBGableAtCeiling;
	ThermBGableAtRafter = imp4.ThermBGableAtRafter;
	ThermBLengthNormalCorners = imp4.ThermBLengthNormalCorners;
	ThermBLengthInvertedCorners = imp4.ThermBLengthInvertedCorners;
	ThermBPartWallBetweenDwelling = imp4.ThermBPartWallBetweenDwelling;
	
	ThermBMetalBoxLintelUserDef = imp4.ThermBMetalBoxLintelUserDef;
	ThermBOtherLintelUserDef = imp4.ThermBOtherLintelUserDef;
	ThermBSillUserDef = imp4.ThermBSillUserDef;
	ThermBJambUserDef = imp4.ThermBJambUserDef;
	ThermBGFPerimeterUserDef = imp4.ThermBGFPerimeterUserDef;
	ThermBFloorWithinDwellingUserDef = imp4.ThermBFloorWithinDwellingUserDef;
	ThermBFloorBwDwellingUserDef = imp4.ThermBFloorBwDwellingUserDef;
	ThermBBalcWithinDwellingLengthUserDef = imp4.ThermBBalcWithinDwellingLengthUserDef;
	ThermBBalcBwDwellingLengthUserDef = imp4.ThermBBalcBwDwellingLengthUserDef;
	ThermBEavesInsAtCeilingUserDef = imp4.ThermBEavesInsAtCeilingUserDef;
	ThermBEavesInsAtRafterUserDef= imp4.ThermBEavesInsAtRafterUserDef;
	ThermBGableInsAtCeilingUserDef = imp4.ThermBGableInsAtCeilingUserDef;
	ThermBGableInsAtRafetUserDef = imp4.ThermBGableInsAtRafetUserDef;
	ThermBLengthOfNormalCornersUserDef = imp4.ThermBLengthOfNormalCornersUserDef;
	ThermBLengthOfInvertedCornersUserDef = imp4.ThermBLengthOfInvertedCornersUserDef;
	ThermBPartWallBetweenDwellingUserDef = imp4.ThermBPartWallBetweenDwellingUserDef;

	ThermBMetalBoxLintelSiValue = imp4.ThermBMetalBoxLintelSiValue;
	ThermBOtherLintelsSiValue = imp4.ThermBOtherLintelsSiValue;
	ThermBSillSiValue = imp4.ThermBSillSiValue;
	ThermBJambSiValue = imp4.ThermBJambSiValue;
	ThermBGFPerimeterSiValue = imp4.ThermBGFPerimeterSiValue;
	ThermBFloorWithinDwellingSiValue = imp4. ThermBFloorWithinDwellingSiValue;
	ThermBFloorBetweenDwellingSiValue = imp4.ThermBFloorBetweenDwellingSiValue;
	ThermBBalconyWithinDwellingSiValue = imp4.ThermBBalconyWithinDwellingSiValue;
	ThermBBalconyBwDwellingSiValue = imp4.ThermBBalconyBwDwellingSiValue ;
	ThermBEavesInsAtCelingSiValue = imp4.ThermBEavesInsAtCelingSiValue;
	ThermBEavesInsAtRafterSiValue = imp4. ThermBEavesInsAtRafterSiValue;
	ThermBGableInsAtCeilingSiValue= imp4.ThermBGableInsAtCeilingSiValue;
	ThermBGableInsAtRafterSiValue = imp4.ThermBGableInsAtRafterSiValue;
	ThermBLengthOfNormalCornersSiValue = imp4.ThermBLengthOfNormalCornersSiValue;
	ThermBLengthOfInvertedCornersSiValue = imp4.ThermBLengthOfInvertedCornersSiValue;
	ThermBPartBwDwellingLengthSiValue = imp4.ThermBPartBwDwellingLengthSiValue;

	ThermBMetalBoxLintelResult = imp4.ThermBMetalBoxLintelResult;
	ThermBOtherLintelsResult = imp4.ThermBOtherLintelsResult;
	ThermBSillResult = imp4.ThermBSillResult;
	ThermBJambResult= imp4.ThermBJambResult;
	ThermBGFPerimeterResult = imp4.ThermBGFPerimeterResult;
	ThermBFloorWithinDwellingPerimeterResult = imp4.ThermBFloorWithinDwellingPerimeterResult;
	ThermBFloorBetweenDwellingPerimeterResult = imp4.ThermBFloorBetweenDwellingPerimeterResult;
	ThermBBalcWithDwellingLengthResult = imp4.ThermBBalcWithDwellingLengthResult;
	ThermBBalconyBwDwellingLengthResult = imp4.ThermBBalconyBwDwellingLengthResult;
	ThermBEavesInsCeilingResult = imp4.ThermBEavesInsCeilingResult;
	ThermBEavesInsRafterResult = imp4.ThermBEavesInsRafterResult;
	ThermBGableInsCeilingResult = imp4.ThermBGableInsCeilingResult;
	ThermBGableInsRafterResult = imp4.ThermBGableInsRafterResult;
	ThermBLengthNormalCornersResult = imp4.ThermBLengthNormalCornersResult;
	ThermBLengthInvertedCornersResult = imp4.ThermBLengthInvertedCornersResult;
	ThermBPartyWallBwDwellingResult = imp4.ThermBPartyWallBwDwellingResult;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	numsOpenFirePlaces	 = imp4.numsOpenFirePlaces;
	numsOpenFlues		 = imp4.numsOpenFlues;
	numsFluelessGasFires = imp4.numsFluelessGasFires;
	numsExtractFans		 = imp4.numsExtractFans;
	numsPassiveVents     = imp4.numsPassiveVents;

	mechVentType = imp4.mechVentType;
	MVHRThermalEff  = imp4.MVHRThermalEff;
	SFP = imp4.SFP;

	pressureTestYN  = imp4.pressureTestYN;
	measuredQ50     = imp4.measuredQ50;
	numOfStoreys    = imp4.numOfStoreys;
	structInf		= imp4.structInf;
	floorInf		= imp4.floorInf;
	draughtLobby	= imp4.draughtLobby;
	perWindowDraughtStripped = imp4.perWindowDraughtStripped;
	numOfShelteredSides      = imp4.numOfShelteredSides;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	primaryFuelUsed   = imp4.primaryFuelUsed;
    secFuelUsed       = imp4.secFuelUsed;
	primaryFuelUsedString = imp4.primaryFuelUsedString;
	secFuelUsedString     = imp4.secFuelUsedString;
	electricityTarrif = imp4.electricityTarrif;
	mainHtType		  = imp4.mainHtType;
	mainHtEffFrom     = imp4.mainHtEffFrom;
	boilerType		  = imp4.boilerType;
	mainFuel		  = imp4.mainFuel;
	isFanFluePresent  = imp4.isFanFluePresent;
	mainHtSystem      = imp4.mainHtSystem;
	mainHtControls    = imp4.mainHtControls;
	mainHtEmitter     = imp4.mainHtEmitter;
	isIterlockPresent = imp4.isIterlockPresent;
	mainHtCompensator = imp4.mainHtCompensator;
	isPumpInHeatedSpace= imp4.isPumpInHeatedSpace;
	mainHtManufacturerDesc = imp4.mainHtManufacturerDesc;
	mainHtTestMethod       = imp4.mainHtTestMethod ;
	
	//mainHtEff              = imp4.mainHtEff;
	mainHtEffNominal              = imp4.mainHtEffNominal; //@min
	
	mainHtFractionSupplied = imp4.mainHtFractionSupplied;
	
	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	oilPumpInHeatedSpace = imp4.oilPumpInHeatedSpace;
	oilBoilerInstalled   = imp4.oilBoilerInstalled;
	CPSUoperatingTemp    = imp4.CPSUoperatingTemp;
	heatEmmFromCase      = imp4.heatEmmFromCase;
	heatTransferredToWater = imp4.heatTransferredToWater;

	isThereCHP		 = imp4.isThereCHP;
	CHPfuel			 = imp4.CHPfuel;
	fractOfHtFromCHP = imp4.fractOfHtFromCHP;
	elecEffOfCHP     = imp4.elecEffOfCHP;
	heatingEffOfCHP  = imp4.heatingEffOfCHP;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	isThereSecHeating		= imp4.isThereSecHeating;
	secHtOpenFlueChimney	= imp4.secHtOpenFlueChimney;
	secHtUnconnectedGasPoint= imp4.secHtUnconnectedGasPoint;
	secHtEffFrom			= imp4.secHtEffFrom;
	secHtFuel				= imp4.secHtFuel;
	secHtSystem				= imp4.secHtSystem;
	secHtManufactDesc		= imp4.secHtManufactDesc;
	secHtTestMethod			= imp4.secHtTestMethod;
	secHtEff				= imp4.secHtEff;
	secHtFraction			= imp4.secHtFraction;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	btnWaterHtFromMainState   = imp4.btnWaterHtFromMainState;
	WHtype					  = imp4.WHtype;
	WHtCylinderWithinDwelling = imp4.WHtCylinderWithinDwelling;
	WHtFuel					  = imp4.WHtFuel;
	WHtWaterSepTimed		  = imp4.WHtWaterSepTimed ;

	WHtCylManufactLossFactor = imp4.WHtCylManufactLossFactor;
	WHtCylDeclaredFactor	 = imp4.WHtCylDeclaredFactor ;
	WHtCylVolume			 = imp4.WHtCylVolume;
	WHtCylInsType			 = imp4.WHtCylInsType;
	WHtCylInsThickness		 = imp4.WHtCylInsThickness;
	WHtCylThermostat		 = imp4.WHtCylThermostat;
	WHtCylInHeatedSpace		 = imp4.WHtCylInHeatedSpace;
	WHtCylPrimaryPipeworkInsulated = imp4.WHtCylPrimaryPipeworkInsulated;
	WHtCylPumpedPrimarySystem = imp4.WHtCylPumpedPrimarySystem;
	WHtEff = imp4.WHtEff;

	WHtTSnCPSUinSingleUnit			= imp4.WHtTSnCPSUinSingleUnit;
	WHtTSnCPSUPrimaryPipeworkLT1_5m = imp4.WHtTSnCPSUPrimaryPipeworkLT1_5m;;
	WHtTSnCPSUstoreInAirCupbrd	    = imp4.WHtTSnCPSUstoreInAirCupbrd;

	WHtCombiKeepHotYN	   = imp4.WHtCombiKeepHotYN;
	DHWfromCommunityScheme = imp4.DHWfromCommunityScheme;
	WHtHeatPumpUsesImmer   = imp4.WHtHeatPumpUsesImmer;
	WHtUsesSummerImmer     = imp4.WHtUsesSummerImmer ;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	isSHWPresent     = imp4.isSHWPresent;	
	SHWCollectorType = imp4.SHWCollectorType;
	SHWCollectorOrientation = imp4.SHWCollectorOrientation;
	SHWCollectorTilt = imp4.SHWCollectorTilt;
	SHWOvershading   = imp4.SHWOvershading;
	isSHWAreaGross   = imp4.isSHWAreaGross;
	SHWApertureArea     = imp4.SHWApertureArea;
	SHW_ZLCE         = imp4.SHW_ZLCE;
	SHW_HeatLossCoefficient = imp4.SHW_HeatLossCoefficient;
	isSHWSolarStoreCombined = imp4.isSHWSolarStoreCombined;
	SHWSolarCircPump  = imp4.SHWSolarCircPump;
	SHWDedSolStoreVol = imp4.SHWDedSolStoreVol;
	 
	isPVPresent			   = imp4.isPVPresent;
	installedPVPeakPower   = imp4.installedPVPeakPower;
	PVCollectorOrientation = imp4.PVCollectorOrientation;
	PVCollectorTilt        = imp4.PVCollectorTilt;
	PVOvershading          = imp4.PVOvershading ;

	isWTPresent = imp4.isWTPresent;
	WTNumOf		= imp4.WTNumOf;
	WTDiameter  = imp4.WTDiameter;
	WTHeight	= imp4.WTHeight;

	uHydroyn = imp4.uHydroyn;
	uHydroAnnualAvgHead = imp4.uHydroAnnualAvgHead;
	uHydroAnnualAvgFlow = imp4.uHydroAnnualAvgFlow;
	uHydroEff = imp4.uHydroEff;
	
	uCHPyn               = imp4.uCHPyn; 
	uCHPheatToPowerRatio = imp4.uCHPheatToPowerRatio;
	uCHPElectricEff      = imp4.uCHPElectricEff;
	CHPFuel				 = imp4.CHPFuel;
	uCHPHeatingEff		 = imp4.uCHPHeatingEff;
	uCHPHeatingFraction  = imp4.uCHPHeatingFraction;

	MVHRyn		   = imp4.MVHRyn;
	MVHRThermalEff = imp4.MVHRThermalEff;

	FGHRSpresent           = imp4.FGHRSpresent;
	FGHRSstore           = imp4.FGHRSstore;
	FGHRSstoreVolume     = imp4.FGHRSstoreVolume;
	FGHRSusefulFracHtRec_kf1 = imp4.FGHRSusefulFracHtRec_kf1;
	FGHRSfittedMain      = imp4.FGHRSfittedMain;
	FGHRSfittedSec       = imp4.FGHRSfittedSec;
	FGHRStype            = imp4.FGHRStype;
	determineFGHRStype   = imp4.determineFGHRStype;
	FGHRStotFracHeatRec_kf2  = imp4.FGHRStotFracHeatRec_kf2;
	FGHRSauxelec   = imp4.FGHRSauxelec;
	FGHRSpvPoweredHt     = imp4.FGHRSpvPoweredHt;
	FGHRSpvPkPower       = imp4.FGHRSpvPkPower;
	FGHRSpvOrientation = imp4.FGHRSpvOrientation;
	FGHRSpvTilt          = imp4.FGHRSpvTilt;
	FGHRSpvOvershading   = imp4.FGHRSpvOvershading;
	FGHRScableLoss       = imp4.FGHRScableLoss;

	WWHRSpresent    = imp4.WWHRSpresent;
	WWHRSnumOfRooms = imp4.WWHRSnumOfRooms;
	WWHRS1Make      = imp4.WWHRS1Make;
	WWHRSnumMixerShowersWithBath1    = imp4.WWHRSnumMixerShowersWithBath1;
	WWHRSnumMixerShowersWithoutBath1 = imp4.WWHRSnumMixerShowersWithoutBath1;
	WWHRS1Model = imp4.WWHRS1Model;
	WWHRS1ModelQualifier = imp4.WWHRS1ModelQualifier;
	WWHRS2Make                       = imp4.WWHRS2Make;
	WWHRSnumMixerShowersWithBath2    = imp4.WWHRSnumMixerShowersWithBath2;
	WWHRSnumMixerShowersWithoutBath2 = imp4.WWHRSnumMixerShowersWithoutBath2;
	WWHRS2Model                      = imp4.WWHRS2Model;
	WWHRS2ModelQualifier             = imp4.WWHRS2ModelQualifier;
	// ------------------------------------------------------
	//	LIGHTS
	//------------------------------------------------------
	fractionLEL = imp4.fractionLEL;

	// ------------------------------------------------------
	// HEM
	// ------------------------------------------------------
	hemHouseType   = imp4.hemHouseType;
	hemYearOfBuild = imp4.hemYearOfBuild;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	chkInsulation = imp4.chkInsulation;
	hemI_insulationSliderPos = imp4.hemI_insulationSliderPos;

	chkAirtightness = imp4.chkAirtightness;
	hemA_achSliderPos = imp4.hemA_achSliderPos;

	chkCapacity= imp4.chkCapacity;
	hemC_capacitySliderPos = imp4.hemC_capacitySliderPos;

	chkSolarIngress = imp4.chkSolarIngress;
	hemS_solarGainsSliderPos = imp4.hemS_solarGainsSliderPos;

	chkOccupancy = imp4.chkOccupancy;
	hemO_OCCDensitySliderPos = imp4.hemO_OCCDensitySliderPos;

	chkControlledSpace = imp4.chkControlledSpace;
	hemL_LAFracSliderPos = imp4.hemL_LAFracSliderPos;

	chkSDHW = imp4.chkSDHW;
	chkPV   = imp4.chkPV;
	chkWT   = imp4.chkWT;
	chkuCHP = imp4.chkuCHP;
	chkuHydro = imp4.chkuHydro;
	chkPCM    = imp4.chkPCM;
	chkMVHR   = imp4.chkMVHR;	
	chkFGHRS  = imp4.chkFGHRS;
	chkWWHRS  = imp4.chkWWHRS;	
}


void CopyImprovement5ToCurrent()
{	
//--------------------------------------------------------
	// JOB DETAILS GLOBAL VARIABLES
	//--------------------------------------------------------
	JobDetRefNum   = imp5.JobDetRefNum;
	assessorName   = imp5.assessorName;
	JobDetComments = imp5.JobDetComments;
	propertyFlatNameorNum = imp5.propertyFlatNameorNum ;
	propertyLetter = imp5.propertyLetter;
	propertyHouseNum  = imp5.propertyHouseNum;
	propertyStreet = imp5.propertyStreet;
	propertyLocality = imp5.propertyLocality;
	propertyDistrict = imp5.propertyDistrict;
	propertyTown = imp5.propertyTown ;
	propertyCounty = imp5.propertyCounty;
	propertyPostCode = imp5.propertyPostCode;
	clientFlatNameorNum = imp5.clientFlatNameorNum;
	clientLetter = imp5.clientLetter;
	clientHouseorBlockNum = imp5.clientHouseorBlockNum;
	clientStreet = imp5.clientStreet;
	clientLocality = imp5.clientLocality;
	clientDistrict = imp5.clientDistrict;
	clientTown = imp5.clientTown ;
	clientCounty = imp5.clientCounty ;
	clientPostCode = imp5.clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	locationString = imp5.locationString;

	dwellingType = imp5.dwellingType;
	builtForm = imp5.builtForm;
	Detachment = imp5.Detachment;
	FlatPosition  = imp5.FlatPosition;
	yearPropertBuilt = imp5.yearPropertBuilt;
	dwellingShelteredSides = imp5.dwellingShelteredSides;
	dwellingExposure = imp5.dwellingExposure;

	dwellingTerrain = imp5.dwellingTerrain;

	storey1Level = imp5.storey1Level;
	storey2Level = imp5.storey2Level;
	storey3Level = imp5.storey3Level;
	storey4Level = imp5.storey4Level;
	storey5Level = imp5.storey5Level;
	storey6Level = imp5.storey6Level;
	
	storey1 = imp5.storey1;
	storey2 = imp5.storey2;
	storey3 = imp5.storey3;
	storey4 = imp5.storey4;
	storey5 = imp5.storey5;
	storey6 = imp5.storey6;

	storey1Basement = imp5.storey1Basement;
	storey2Basement = imp5.storey2Basement;
	storey3Basement = imp5.storey3Basement;
	storey4Basement = imp5.storey4Basement;
	storey5Basement = imp5.storey5Basement;
	storey6Basement = imp5.storey6Basement;

	storey1Area = imp5.storey1Area;
	storey2Area = imp5.storey2Area;
	storey3Area = imp5.storey3Area;
	storey4Area = imp5.storey4Area;
	storey5Area = imp5.storey5Area;
	storey6Area = imp5.storey6Area;

	storey1Height = imp5.storey1Height;
	storey2Height = imp5.storey2Height;
	storey3Height = imp5.storey3Height;
	storey4Height = imp5.storey4Height;
	storey5Height = imp5.storey5Height;
	storey6Height = imp5.storey6Height;
	TFAfromHEM = imp5.TFAfromHEM;

	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	winNArea  = imp5.winNArea;
	winNEArea = imp5.winNEArea;
	winEArea  = imp5.winEArea;
	winSEArea = imp5.winSEArea;
	winSArea  = imp5.winSArea;
	winSWArea = imp5.winSWArea;
	winWArea  = imp5.winWArea;
	winNWArea = imp5.winNWArea;
	rooflightsArea = imp5.rooflightsArea;

	winNSolTrans  = imp5.winNSolTrans;
	winNESolTrans = imp5.winNESolTrans;
	winESolTrans  = imp5.winESolTrans;
	winSESolTrans = imp5.winSESolTrans;
	winSSolTrans  = imp5.winSSolTrans;
	winSWSolTrans = imp5.winSWSolTrans;
	winWSolTrans  = imp5.winWSolTrans;
	winNWSolTrans = imp5.winNWSolTrans;
	rooflightsSolTrans = imp5.rooflightsSolTrans;

	winNFrameFactor  = imp5.winNFrameFactor;
	winNEFrameFactor = imp5.winNEFrameFactor;
	winEFrameFactor  = imp5.winEFrameFactor;
	winSEFrameFactor = imp5.winSEFrameFactor;
	winSFrameFactor  = imp5.winSFrameFactor;
	winSWFrameFactor = imp5.winSWFrameFactor;
	winWFrameFactor  = imp5.winWFrameFactor;
	winNWFrameFactor = imp5.winNWFrameFactor;
	rooflightsFrameFactor = imp5.rooflightsFrameFactor;

	winOvershading = imp5.winOvershading;
	winGlazing     = imp5.winGlazing;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	grossAreaWall1 = imp5.grossAreaWall1;
	groosAreaRoof1 = imp5.groosAreaRoof1;
	netAreaDoors = imp5.netAreaDoors;;
	netAreaWindows = imp5.netAreaWindows;
	netAreaRoofLights = imp5.netAreaRoofLights ;
	netAreaGF = imp5.netAreaGF;
	netAreaExFloor = imp5.netAreaExFloor ;
	netAreaWallType1 = imp5.netAreaWallType1;
	netAreaWallType2 = imp5.netAreaWallType2;
	netAreaRoofType1= imp5.netAreaRoofType1;
	netAreaRoofType2 = imp5.netAreaRoofType2;
	netAreaPartyWall = imp5.netAreaPartyWall;
	netAreaPartyFloor = imp5.netAreaPartyFloor;
	netAreaPartyCeiling = imp5.netAreaPartyCeiling;
	netAreaInternalWall = imp5.netAreaInternalWall; ;
	netAreaInternalFloor = imp5.netAreaInternalFloor;
	netAreaInternalCeiling = imp5.netAreaInternalCeiling; ;

	UvalueDoors = imp5.UvalueDoors ;
	UvalueWindows = imp5.UvalueWindows;
	UvalueRooflights = imp5.UvalueRooflights;
	UvalueGF = imp5.UvalueGF;
	UvalueExposedFloor = imp5.UvalueExposedFloor;
	UvalueWallType1 = imp5.UvalueWallType1;
	UvalueWallType2 = imp5.UvalueWallType2;
	UvalueRoofTYpe1 = imp5.UvalueRoofTYpe1;
	UvalueRoofType2 = imp5.UvalueRoofType2;
	UvaluePartyWall = imp5.UvaluePartyWall;

	kValueGF = imp5.kValueGF;;
	kValueExpFloor = imp5.kValueExpFloor;
	kValueWallType1 = imp5.kValueWallType1;
	kValueWallType2 = imp5.kValueWallType2;
	kValueRoofType1 = imp5.kValueRoofType1;
	kValueRoofType2 = imp5.kValueRoofType2;
	kValuePartyWall = imp5.kValuePartyWall;
	kValuePartyFloor = imp5.kValuePartyFloor;
	kValuePartyCeiling = imp5.kValuePartyCeiling;
	kValueIntWall = imp5.kValueIntWall;
	kValueIntFloor	 = imp5.kValueIntFloor;
	kValueIntCeiling = imp5.kValueIntCeiling;

	livingRoomFraction	 = imp5.livingRoomFraction;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	enterYValue = imp5.enterYValue;
	yValueEntry = imp5.yValueEntry;

	ThermBGFPerimeter = imp5.ThermBGFPerimeter;
	ThermBFloorWithingDwellinPerimeter = imp5.ThermBFloorWithingDwellinPerimeter;
	ThermBFloorBetweenDwellinPerimeter = imp5.ThermBFloorBetweenDwellinPerimeter;
	ThermBBalconyWithingDwellingLength = imp5.ThermBBalconyWithingDwellingLength; 
	ThermBBalconyBetweenDwellingLength	 = imp5.ThermBBalconyBetweenDwellingLength;
	ThermBEavesAtCeiling = imp5.ThermBEavesAtCeiling;
	ThermBEavesAtRafter = imp5.ThermBEavesAtRafter;
	ThermBGableAtCeiling = imp5.ThermBGableAtCeiling;
	ThermBGableAtRafter = imp5.ThermBGableAtRafter;
	ThermBLengthNormalCorners = imp5.ThermBLengthNormalCorners;
	ThermBLengthInvertedCorners = imp5.ThermBLengthInvertedCorners;
	ThermBPartWallBetweenDwelling = imp5.ThermBPartWallBetweenDwelling;
	
	ThermBMetalBoxLintelUserDef = imp5.ThermBMetalBoxLintelUserDef;
	ThermBOtherLintelUserDef = imp5.ThermBOtherLintelUserDef;
	ThermBSillUserDef = imp5.ThermBSillUserDef;
	ThermBJambUserDef = imp5.ThermBJambUserDef;
	ThermBGFPerimeterUserDef = imp5.ThermBGFPerimeterUserDef;
	ThermBFloorWithinDwellingUserDef = imp5.ThermBFloorWithinDwellingUserDef;
	ThermBFloorBwDwellingUserDef = imp5.ThermBFloorBwDwellingUserDef;
	ThermBBalcWithinDwellingLengthUserDef = imp5.ThermBBalcWithinDwellingLengthUserDef;
	ThermBBalcBwDwellingLengthUserDef = imp5.ThermBBalcBwDwellingLengthUserDef;
	ThermBEavesInsAtCeilingUserDef = imp5.ThermBEavesInsAtCeilingUserDef;
	ThermBEavesInsAtRafterUserDef= imp5.ThermBEavesInsAtRafterUserDef;
	ThermBGableInsAtCeilingUserDef = imp5.ThermBGableInsAtCeilingUserDef;
	ThermBGableInsAtRafetUserDef = imp5.ThermBGableInsAtRafetUserDef;
	ThermBLengthOfNormalCornersUserDef = imp5.ThermBLengthOfNormalCornersUserDef;
	ThermBLengthOfInvertedCornersUserDef = imp5.ThermBLengthOfInvertedCornersUserDef;
	ThermBPartWallBetweenDwellingUserDef = imp5.ThermBPartWallBetweenDwellingUserDef;

	ThermBMetalBoxLintelSiValue = imp5.ThermBMetalBoxLintelSiValue;
	ThermBOtherLintelsSiValue = imp5.ThermBOtherLintelsSiValue;
	ThermBSillSiValue = imp5.ThermBSillSiValue;
	ThermBJambSiValue = imp5.ThermBJambSiValue;
	ThermBGFPerimeterSiValue = imp5.ThermBGFPerimeterSiValue;
	ThermBFloorWithinDwellingSiValue = imp5. ThermBFloorWithinDwellingSiValue;
	ThermBFloorBetweenDwellingSiValue = imp5.ThermBFloorBetweenDwellingSiValue;
	ThermBBalconyWithinDwellingSiValue = imp5.ThermBBalconyWithinDwellingSiValue;
	ThermBBalconyBwDwellingSiValue = imp5.ThermBBalconyBwDwellingSiValue ;
	ThermBEavesInsAtCelingSiValue = imp5.ThermBEavesInsAtCelingSiValue;
	ThermBEavesInsAtRafterSiValue = imp5. ThermBEavesInsAtRafterSiValue;
	ThermBGableInsAtCeilingSiValue= imp5.ThermBGableInsAtCeilingSiValue;
	ThermBGableInsAtRafterSiValue = imp5.ThermBGableInsAtRafterSiValue;
	ThermBLengthOfNormalCornersSiValue = imp5.ThermBLengthOfNormalCornersSiValue;
	ThermBLengthOfInvertedCornersSiValue = imp5.ThermBLengthOfInvertedCornersSiValue;
	ThermBPartBwDwellingLengthSiValue = imp5.ThermBPartBwDwellingLengthSiValue;

	ThermBMetalBoxLintelResult = imp5.ThermBMetalBoxLintelResult;
	ThermBOtherLintelsResult = imp5.ThermBOtherLintelsResult;
	ThermBSillResult = imp5.ThermBSillResult;
	ThermBJambResult= imp5.ThermBJambResult;
	ThermBGFPerimeterResult = imp5.ThermBGFPerimeterResult;
	ThermBFloorWithinDwellingPerimeterResult = imp5.ThermBFloorWithinDwellingPerimeterResult;
	ThermBFloorBetweenDwellingPerimeterResult = imp5.ThermBFloorBetweenDwellingPerimeterResult;
	ThermBBalcWithDwellingLengthResult = imp5.ThermBBalcWithDwellingLengthResult;
	ThermBBalconyBwDwellingLengthResult = imp5.ThermBBalconyBwDwellingLengthResult;
	ThermBEavesInsCeilingResult = imp5.ThermBEavesInsCeilingResult;
	ThermBEavesInsRafterResult = imp5.ThermBEavesInsRafterResult;
	ThermBGableInsCeilingResult = imp5.ThermBGableInsCeilingResult;
	ThermBGableInsRafterResult = imp5.ThermBGableInsRafterResult;
	ThermBLengthNormalCornersResult = imp5.ThermBLengthNormalCornersResult;
	ThermBLengthInvertedCornersResult = imp5.ThermBLengthInvertedCornersResult;
	ThermBPartyWallBwDwellingResult = imp5.ThermBPartyWallBwDwellingResult;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	numsOpenFirePlaces	 = imp5.numsOpenFirePlaces;
	numsOpenFlues		 = imp5.numsOpenFlues;
	numsFluelessGasFires = imp5.numsFluelessGasFires;
	numsExtractFans		 = imp5.numsExtractFans;
	numsPassiveVents     = imp5.numsPassiveVents;

	mechVentType = imp5.mechVentType;
	MVHRThermalEff  = imp5.MVHRThermalEff;
	SFP = imp5.SFP;

	pressureTestYN  = imp5.pressureTestYN;
	measuredQ50     = imp5.measuredQ50;
	numOfStoreys    = imp5.numOfStoreys;
	structInf		= imp5.structInf;
	floorInf		= imp5.floorInf;
	draughtLobby	= imp5.draughtLobby;
	perWindowDraughtStripped = imp5.perWindowDraughtStripped;
	numOfShelteredSides      = imp5.numOfShelteredSides;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	primaryFuelUsed   = imp5.primaryFuelUsed;
    secFuelUsed       = imp5.secFuelUsed;
	primaryFuelUsedString = imp5.primaryFuelUsedString;
	secFuelUsedString     = imp5.secFuelUsedString;
	electricityTarrif = imp5.electricityTarrif;
	mainHtType		  = imp5.mainHtType;
	mainHtEffFrom     = imp5.mainHtEffFrom;
	boilerType		  = imp5.boilerType;
	mainFuel		  = imp5.mainFuel;
	isFanFluePresent  = imp5.isFanFluePresent;
	mainHtSystem      = imp5.mainHtSystem;
	mainHtControls    = imp5.mainHtControls;
	mainHtEmitter     = imp5.mainHtEmitter;
	isIterlockPresent = imp5.isIterlockPresent;
	mainHtCompensator = imp5.mainHtCompensator;
	isPumpInHeatedSpace= imp5.isPumpInHeatedSpace;
	mainHtManufacturerDesc = imp5.mainHtManufacturerDesc;
	mainHtTestMethod       = imp5.mainHtTestMethod ;
	
	//mainHtEff              = imp5.mainHtEff;
	mainHtEffNominal              = imp5.mainHtEffNominal; //@min
	
	mainHtFractionSupplied = imp5.mainHtFractionSupplied;
	
	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	oilPumpInHeatedSpace = imp5.oilPumpInHeatedSpace;
	oilBoilerInstalled   = imp5.oilBoilerInstalled;
	CPSUoperatingTemp    = imp5.CPSUoperatingTemp;
	heatEmmFromCase      = imp5.heatEmmFromCase;
	heatTransferredToWater = imp5.heatTransferredToWater;

	isThereCHP		 = imp5.isThereCHP;
	CHPfuel			 = imp5.CHPfuel;
	fractOfHtFromCHP = imp5.fractOfHtFromCHP;
	elecEffOfCHP     = imp5.elecEffOfCHP;
	heatingEffOfCHP  = imp5.heatingEffOfCHP;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	isThereSecHeating		= imp5.isThereSecHeating;
	secHtOpenFlueChimney	= imp5.secHtOpenFlueChimney;
	secHtUnconnectedGasPoint= imp5.secHtUnconnectedGasPoint;
	secHtEffFrom			= imp5.secHtEffFrom;
	secHtFuel				= imp5.secHtFuel;
	secHtSystem				= imp5.secHtSystem;
	secHtManufactDesc		= imp5.secHtManufactDesc;
	secHtTestMethod			= imp5.secHtTestMethod;
	secHtEff				= imp5.secHtEff;
	secHtFraction			= imp5.secHtFraction;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	btnWaterHtFromMainState   = imp5.btnWaterHtFromMainState;
	WHtype					  = imp5.WHtype;
	WHtCylinderWithinDwelling = imp5.WHtCylinderWithinDwelling;
	WHtFuel					  = imp5.WHtFuel;
	WHtWaterSepTimed		  = imp5.WHtWaterSepTimed ;

	WHtCylManufactLossFactor = imp5.WHtCylManufactLossFactor;
	WHtCylDeclaredFactor	 = imp5.WHtCylDeclaredFactor ;
	WHtCylVolume			 = imp5.WHtCylVolume;
	WHtCylInsType			 = imp5.WHtCylInsType;
	WHtCylInsThickness		 = imp5.WHtCylInsThickness;
	WHtCylThermostat		 = imp5.WHtCylThermostat;
	WHtCylInHeatedSpace		 = imp5.WHtCylInHeatedSpace;
	WHtCylPrimaryPipeworkInsulated = imp5.WHtCylPrimaryPipeworkInsulated;
	WHtCylPumpedPrimarySystem = imp5.WHtCylPumpedPrimarySystem;
	WHtEff = imp5.WHtEff;

	WHtTSnCPSUinSingleUnit			= imp5.WHtTSnCPSUinSingleUnit;
	WHtTSnCPSUPrimaryPipeworkLT1_5m = imp5.WHtTSnCPSUPrimaryPipeworkLT1_5m;;
	WHtTSnCPSUstoreInAirCupbrd	    = imp5.WHtTSnCPSUstoreInAirCupbrd;

	WHtCombiKeepHotYN	   = imp5.WHtCombiKeepHotYN;
	DHWfromCommunityScheme = imp5.DHWfromCommunityScheme;
	WHtHeatPumpUsesImmer   = imp5.WHtHeatPumpUsesImmer;
	WHtUsesSummerImmer     = imp5.WHtUsesSummerImmer ;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	isSHWPresent     = imp5.isSHWPresent;	
	SHWCollectorType = imp5.SHWCollectorType;
	SHWCollectorOrientation = imp5.SHWCollectorOrientation;
	SHWCollectorTilt = imp5.SHWCollectorTilt;
	SHWOvershading   = imp5.SHWOvershading;
	isSHWAreaGross   = imp5.isSHWAreaGross;
	SHWApertureArea     = imp5.SHWApertureArea;
	SHW_ZLCE         = imp5.SHW_ZLCE;
	SHW_HeatLossCoefficient = imp5.SHW_HeatLossCoefficient;
	isSHWSolarStoreCombined = imp5.isSHWSolarStoreCombined;
	SHWSolarCircPump  = imp5.SHWSolarCircPump;
	SHWDedSolStoreVol = imp5.SHWDedSolStoreVol;
	 
	isPVPresent			   = imp5.isPVPresent;
	installedPVPeakPower   = imp5.installedPVPeakPower;
	PVCollectorOrientation = imp5.PVCollectorOrientation;
	PVCollectorTilt        = imp5.PVCollectorTilt;
	PVOvershading          = imp5.PVOvershading ;

	isWTPresent = imp5.isWTPresent;
	WTNumOf		= imp5.WTNumOf;
	WTDiameter  = imp5.WTDiameter;
	WTHeight	= imp5.WTHeight;

	uHydroyn = imp5.uHydroyn;
	uHydroAnnualAvgHead = imp5.uHydroAnnualAvgHead;
	uHydroAnnualAvgFlow = imp5.uHydroAnnualAvgFlow;
	uHydroEff = imp5.uHydroEff;
	
	uCHPyn               = imp5.uCHPyn; 
	uCHPheatToPowerRatio = imp5.uCHPheatToPowerRatio;
	uCHPElectricEff      = imp5.uCHPElectricEff;
	CHPFuel				 = imp5.CHPFuel;
	uCHPHeatingEff		 = imp5.uCHPHeatingEff;
	uCHPHeatingFraction  = imp5.uCHPHeatingFraction;

	MVHRyn		   = imp5.MVHRyn;
	MVHRThermalEff = imp5.MVHRThermalEff;

	FGHRSpresent           = imp5.FGHRSpresent;
	FGHRSstore           = imp5.FGHRSstore;
	FGHRSstoreVolume     = imp5.FGHRSstoreVolume;
	FGHRSusefulFracHtRec_kf1 = imp5.FGHRSusefulFracHtRec_kf1;
	FGHRSfittedMain      = imp5.FGHRSfittedMain;
	FGHRSfittedSec       = imp5.FGHRSfittedSec;
	FGHRStype            = imp5.FGHRStype;
	determineFGHRStype   = imp5.determineFGHRStype;
	FGHRStotFracHeatRec_kf2  = imp5.FGHRStotFracHeatRec_kf2;
	FGHRSauxelec   = imp5.FGHRSauxelec;
	FGHRSpvPoweredHt     = imp5.FGHRSpvPoweredHt;
	FGHRSpvPkPower       = imp5.FGHRSpvPkPower;
	FGHRSpvOrientation = imp5.FGHRSpvOrientation;
	FGHRSpvTilt          = imp5.FGHRSpvTilt;
	FGHRSpvOvershading   = imp5.FGHRSpvOvershading;
	FGHRScableLoss       = imp5.FGHRScableLoss;

	WWHRSpresent    = imp5.WWHRSpresent;
	WWHRSnumOfRooms = imp5.WWHRSnumOfRooms;
	WWHRS1Make      = imp5.WWHRS1Make;
	WWHRSnumMixerShowersWithBath1    = imp5.WWHRSnumMixerShowersWithBath1;
	WWHRSnumMixerShowersWithoutBath1 = imp5.WWHRSnumMixerShowersWithoutBath1;
	WWHRS1Model = imp5.WWHRS1Model;
	WWHRS1ModelQualifier = imp5.WWHRS1ModelQualifier;
	WWHRS2Make                       = imp5.WWHRS2Make;
	WWHRSnumMixerShowersWithBath2    = imp5.WWHRSnumMixerShowersWithBath2;
	WWHRSnumMixerShowersWithoutBath2 = imp5.WWHRSnumMixerShowersWithoutBath2;
	WWHRS2Model                      = imp5.WWHRS2Model;
	WWHRS2ModelQualifier             = imp5.WWHRS2ModelQualifier;
	// ------------------------------------------------------
	//	LIGHTS
	//------------------------------------------------------
	fractionLEL = imp5.fractionLEL;

	// ------------------------------------------------------
	// HEM
	// ------------------------------------------------------
	hemHouseType   = imp5.hemHouseType;
	hemYearOfBuild = imp5.hemYearOfBuild;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	chkInsulation = imp5.chkInsulation;
	hemI_insulationSliderPos = imp5.hemI_insulationSliderPos;

	chkAirtightness = imp5.chkAirtightness;
	hemA_achSliderPos = imp5.hemA_achSliderPos;

	chkCapacity= imp5.chkCapacity;
	hemC_capacitySliderPos = imp5.hemC_capacitySliderPos;

	chkSolarIngress = imp5.chkSolarIngress;
	hemS_solarGainsSliderPos = imp5.hemS_solarGainsSliderPos;

	chkOccupancy = imp5.chkOccupancy;
	hemO_OCCDensitySliderPos = imp5.hemO_OCCDensitySliderPos;

	chkControlledSpace = imp5.chkControlledSpace;
	hemL_LAFracSliderPos = imp5.hemL_LAFracSliderPos;

	chkSDHW = imp5.chkSDHW;
	chkPV   = imp5.chkPV;
	chkWT   = imp5.chkWT;
	chkuCHP = imp5.chkuCHP;
	chkuHydro = imp5.chkuHydro;
	chkPCM    = imp5.chkPCM;
	chkMVHR   = imp5.chkMVHR;
	chkFGHRS  = imp5.chkFGHRS;
	chkWWHRS  = imp5.chkWWHRS;	
}

void CopyCurrentFromFileToCurrent()
{	
//--------------------------------------------------------
// JOB DETAILS GLOBAL VARIABLES
//--------------------------------------------------------

	JobDetRefNum   = current.JobDetRefNum;
	assessorName   = current.assessorName;
	JobDetComments = current.JobDetComments;
	propertyFlatNameorNum = current.propertyFlatNameorNum ;
	propertyLetter = current.propertyLetter;
	propertyHouseNum  = current.propertyHouseNum;
	propertyStreet = current.propertyStreet;
	propertyLocality = current.propertyLocality;
	propertyDistrict = current.propertyDistrict;
	propertyTown = current.propertyTown ;
	propertyCounty = current.propertyCounty;
	propertyPostCode = current.propertyPostCode;
	clientFlatNameorNum = current.clientFlatNameorNum;
	clientLetter = current.clientLetter;
	clientHouseorBlockNum = current.clientHouseorBlockNum;
	clientStreet = current.clientStreet;
	clientLocality = current.clientLocality;
	clientDistrict = current.clientDistrict;
	clientTown = current.clientTown ;
	clientCounty = current.clientCounty ;
	clientPostCode = current.clientPostCode;

	//---------------------------------------------------------
	// BUILT FORM
	//---------------------------------------------------------
	locationString = current.locationString;

	dwellingType = current.dwellingType;
	builtForm = current.builtForm;
	Detachment = current.Detachment;
	FlatPosition  = current.FlatPosition;
	yearPropertBuilt = current.yearPropertBuilt;
	dwellingShelteredSides = current.dwellingShelteredSides;
	dwellingExposure = current.dwellingExposure;

	dwellingTerrain = current.dwellingTerrain;

	storey1Level = current.storey1Level;
	storey2Level = current.storey2Level;
	storey3Level = current.storey3Level;
	storey4Level = current.storey4Level;
	storey5Level = current.storey5Level;
	storey6Level = current.storey6Level;
	
	storey1 = current.storey1;
	storey2 = current.storey2;
	storey3 = current.storey3;
	storey4 = current.storey4;
	storey5 = current.storey5;
	storey6 = current.storey6;

	storey1Basement = current.storey1Basement;
	storey2Basement = current.storey2Basement;
	storey3Basement = current.storey3Basement;
	storey4Basement = current.storey4Basement;
	storey5Basement = current.storey5Basement;
	storey6Basement = current.storey6Basement;

	storey1Area = current.storey1Area;
	storey2Area = current.storey2Area;
	storey3Area = current.storey3Area;
	storey4Area = current.storey4Area;
	storey5Area = current.storey5Area;
	storey6Area = current.storey6Area;

	storey1Height = current.storey1Height;
	storey2Height = current.storey2Height;
	storey3Height = current.storey3Height;
	storey4Height = current.storey4Height;
	storey5Height = current.storey5Height;
	storey6Height = current.storey6Height;
	TFAfromHEM = current.TFAfromHEM;

	//---------------------------------------------------------
	// WINDOWS
	//---------------------------------------------------------
	winNArea  = current.winNArea;
	winNEArea = current.winNEArea;
	winEArea  = current.winEArea;
	winSEArea = current.winSEArea;
	winSArea  = current.winSArea;
	winSWArea = current.winSWArea;
	winWArea  = current.winWArea;
	winNWArea = current.winNWArea;
	rooflightsArea = current.rooflightsArea;

	winNSolTrans  = current.winNSolTrans;
	winNESolTrans = current.winNESolTrans;
	winESolTrans  = current.winESolTrans;
	winSESolTrans = current.winSESolTrans;
	winSSolTrans  = current.winSSolTrans;
	winSWSolTrans = current.winSWSolTrans;
	winWSolTrans  = current.winWSolTrans;
	winNWSolTrans = current.winNWSolTrans;
	rooflightsSolTrans = current.rooflightsSolTrans;

	winNFrameFactor  = current.winNFrameFactor;
	winNEFrameFactor = current.winNEFrameFactor;
	winEFrameFactor  = current.winEFrameFactor;
	winSEFrameFactor = current.winSEFrameFactor;
	winSFrameFactor  = current.winSFrameFactor;
	winSWFrameFactor = current.winSWFrameFactor;
	winWFrameFactor  = current.winWFrameFactor;
	winNWFrameFactor = current.winNWFrameFactor;
	rooflightsFrameFactor = current.rooflightsFrameFactor;

	winOvershading = current.winOvershading;
	winGlazing     = current.winGlazing;

	//---------------------------------------------
	// AREAS & U-VALUES
	//---------------------------------------------
	grossAreaWall1 = current.grossAreaWall1;
	groosAreaRoof1 = current.groosAreaRoof1;
	netAreaDoors = current.netAreaDoors;;
	netAreaWindows = current.netAreaWindows;
	netAreaRoofLights = current.netAreaRoofLights ;
	netAreaGF = current.netAreaGF;
	netAreaExFloor = current.netAreaExFloor ;
	netAreaWallType1 = current.netAreaWallType1;
	netAreaWallType2 = current.netAreaWallType2;
	netAreaRoofType1= current.netAreaRoofType1;
	netAreaRoofType2 = current.netAreaRoofType2;
	netAreaPartyWall = current.netAreaPartyWall;
	netAreaPartyFloor = current.netAreaPartyFloor;
	netAreaPartyCeiling = current.netAreaPartyCeiling;
	netAreaInternalWall = current.netAreaInternalWall; ;
	netAreaInternalFloor = current.netAreaInternalFloor;
	netAreaInternalCeiling = current.netAreaInternalCeiling; ;

	UvalueDoors = current.UvalueDoors ;
	UvalueWindows = current.UvalueWindows;
	UvalueRooflights = current.UvalueRooflights;
	UvalueGF = current.UvalueGF;
	UvalueExposedFloor = current.UvalueExposedFloor;
	UvalueWallType1 = current.UvalueWallType1;
	UvalueWallType2 = current.UvalueWallType2;
	UvalueRoofTYpe1 = current.UvalueRoofTYpe1;
	UvalueRoofType2 = current.UvalueRoofType2;
	UvaluePartyWall = current.UvaluePartyWall;

	kValueGF = current.kValueGF;;
	kValueExpFloor = current.kValueExpFloor;
	kValueWallType1 = current.kValueWallType1;
	kValueWallType2 = current.kValueWallType2;
	kValueRoofType1 = current.kValueRoofType1;
	kValueRoofType2 = current.kValueRoofType2;
	kValuePartyWall = current.kValuePartyWall;
	kValuePartyFloor = current.kValuePartyFloor;
	kValuePartyCeiling = current.kValuePartyCeiling;
	kValueIntWall = current.kValueIntWall;
	kValueIntFloor	 = current.kValueIntFloor;
	kValueIntCeiling = current.kValueIntCeiling;

	livingRoomFraction	 = current.livingRoomFraction;

	//-------------------------------------------------
	// THERMAL BRIDGES Global Variables
	//-------------------------------------------------
	enterYValue = current.enterYValue;
	yValueEntry = current.yValueEntry;

	ThermBGFPerimeter = current.ThermBGFPerimeter;
	ThermBFloorWithingDwellinPerimeter = current.ThermBFloorWithingDwellinPerimeter;
	ThermBFloorBetweenDwellinPerimeter = current.ThermBFloorBetweenDwellinPerimeter;
	ThermBBalconyWithingDwellingLength = current.ThermBBalconyWithingDwellingLength; 
	ThermBBalconyBetweenDwellingLength	 = current.ThermBBalconyBetweenDwellingLength;
	ThermBEavesAtCeiling = current.ThermBEavesAtCeiling;
	ThermBEavesAtRafter = current.ThermBEavesAtRafter;
	ThermBGableAtCeiling = current.ThermBGableAtCeiling;
	ThermBGableAtRafter = current.ThermBGableAtRafter;
	ThermBLengthNormalCorners = current.ThermBLengthNormalCorners;
	ThermBLengthInvertedCorners = current.ThermBLengthInvertedCorners;
	ThermBPartWallBetweenDwelling = current.ThermBPartWallBetweenDwelling;
	
	ThermBMetalBoxLintelUserDef = current.ThermBMetalBoxLintelUserDef;
	ThermBOtherLintelUserDef = current.ThermBOtherLintelUserDef;
	ThermBSillUserDef = current.ThermBSillUserDef;
	ThermBJambUserDef = current.ThermBJambUserDef;
	ThermBGFPerimeterUserDef = current.ThermBGFPerimeterUserDef;
	ThermBFloorWithinDwellingUserDef = current.ThermBFloorWithinDwellingUserDef;
	ThermBFloorBwDwellingUserDef = current.ThermBFloorBwDwellingUserDef;
	ThermBBalcWithinDwellingLengthUserDef = current.ThermBBalcWithinDwellingLengthUserDef;
	ThermBBalcBwDwellingLengthUserDef = current.ThermBBalcBwDwellingLengthUserDef;
	ThermBEavesInsAtCeilingUserDef = current.ThermBEavesInsAtCeilingUserDef;
	ThermBEavesInsAtRafterUserDef= current.ThermBEavesInsAtRafterUserDef;
	ThermBGableInsAtCeilingUserDef = current.ThermBGableInsAtCeilingUserDef;
	ThermBGableInsAtRafetUserDef = current.ThermBGableInsAtRafetUserDef;
	ThermBLengthOfNormalCornersUserDef = current.ThermBLengthOfNormalCornersUserDef;
	ThermBLengthOfInvertedCornersUserDef = current.ThermBLengthOfInvertedCornersUserDef;
	ThermBPartWallBetweenDwellingUserDef = current.ThermBPartWallBetweenDwellingUserDef;

	ThermBMetalBoxLintelSiValue = current.ThermBMetalBoxLintelSiValue;
	ThermBOtherLintelsSiValue = current.ThermBOtherLintelsSiValue;
	ThermBSillSiValue = current.ThermBSillSiValue;
	ThermBJambSiValue = current.ThermBJambSiValue;
	ThermBGFPerimeterSiValue = current.ThermBGFPerimeterSiValue;
	ThermBFloorWithinDwellingSiValue = current. ThermBFloorWithinDwellingSiValue;
	ThermBFloorBetweenDwellingSiValue = current.ThermBFloorBetweenDwellingSiValue;
	ThermBBalconyWithinDwellingSiValue = current.ThermBBalconyWithinDwellingSiValue;
	ThermBBalconyBwDwellingSiValue = current.ThermBBalconyBwDwellingSiValue ;
	ThermBEavesInsAtCelingSiValue = current.ThermBEavesInsAtCelingSiValue;
	ThermBEavesInsAtRafterSiValue = current. ThermBEavesInsAtRafterSiValue;
	ThermBGableInsAtCeilingSiValue= current.ThermBGableInsAtCeilingSiValue;
	ThermBGableInsAtRafterSiValue = current.ThermBGableInsAtRafterSiValue;
	ThermBLengthOfNormalCornersSiValue = current.ThermBLengthOfNormalCornersSiValue;
	ThermBLengthOfInvertedCornersSiValue = current.ThermBLengthOfInvertedCornersSiValue;
	ThermBPartBwDwellingLengthSiValue = current.ThermBPartBwDwellingLengthSiValue;

	ThermBMetalBoxLintelResult = current.ThermBMetalBoxLintelResult;
	ThermBOtherLintelsResult = current.ThermBOtherLintelsResult;
	ThermBSillResult = current.ThermBSillResult;
	ThermBJambResult= current.ThermBJambResult;
	ThermBGFPerimeterResult = current.ThermBGFPerimeterResult;
	ThermBFloorWithinDwellingPerimeterResult = current.ThermBFloorWithinDwellingPerimeterResult;
	ThermBFloorBetweenDwellingPerimeterResult = current.ThermBFloorBetweenDwellingPerimeterResult;
	ThermBBalcWithDwellingLengthResult = current.ThermBBalcWithDwellingLengthResult;
	ThermBBalconyBwDwellingLengthResult = current.ThermBBalconyBwDwellingLengthResult;
	ThermBEavesInsCeilingResult = current.ThermBEavesInsCeilingResult;
	ThermBEavesInsRafterResult = current.ThermBEavesInsRafterResult;
	ThermBGableInsCeilingResult = current.ThermBGableInsCeilingResult;
	ThermBGableInsRafterResult = current.ThermBGableInsRafterResult;
	ThermBLengthNormalCornersResult = current.ThermBLengthNormalCornersResult;
	ThermBLengthInvertedCornersResult = current.ThermBLengthInvertedCornersResult;
	ThermBPartyWallBwDwellingResult = current.ThermBPartyWallBwDwellingResult;

	//---------------------------------------------------------
	// VENTILATION
	//---------------------------------------------------------
	numsOpenFirePlaces	 = current.numsOpenFirePlaces;
	numsOpenFlues		 = current.numsOpenFlues;
	numsFluelessGasFires = current.numsFluelessGasFires;
	numsExtractFans		 = current.numsExtractFans;
	numsPassiveVents     = current.numsPassiveVents;

	mechVentType = current.mechVentType;
	MVHRThermalEff  = current.MVHRThermalEff;
	SFP = current.SFP;

	pressureTestYN  = current.pressureTestYN;
	measuredQ50     = current.measuredQ50;
	numOfStoreys    = current.numOfStoreys;
	structInf		= current.structInf;
	floorInf		= current.floorInf;
	draughtLobby	= current.draughtLobby;
	perWindowDraughtStripped = current.perWindowDraughtStripped;
	numOfShelteredSides      = current.numOfShelteredSides;

	//---------------------------------------------------------
	// MAIM HEATING
	//---------------------------------------------------------
	primaryFuelUsed   = current.primaryFuelUsed;
    secFuelUsed       = current.secFuelUsed;
	primaryFuelUsedString = current.primaryFuelUsedString;
	secFuelUsedString     = current.secFuelUsedString;
	electricityTarrif = current.electricityTarrif;
	mainHtType		  = current.mainHtType;
	mainHtEffFrom     = current.mainHtEffFrom;
	boilerType		  = current.boilerType;
	mainFuel		  = current.mainFuel;
	isFanFluePresent  = current.isFanFluePresent;
	mainHtSystem      = current.mainHtSystem;
	mainHtControls    = current.mainHtControls;
	mainHtEmitter     = current.mainHtEmitter;
	isIterlockPresent = current.isIterlockPresent;
	mainHtCompensator = current.mainHtCompensator;
	isPumpInHeatedSpace= current.isPumpInHeatedSpace;
	mainHtManufacturerDesc = current.mainHtManufacturerDesc;
	mainHtTestMethod       = current.mainHtTestMethod ;
	
	//mainHtEff           = current.mainHtEff;
	mainHtEffNominal      = current.mainHtEffNominal;
	
	mainHtFractionSupplied = current.mainHtFractionSupplied;
	
	//---------------------------------------------------------
	// MAIN HETAING DETAILS
	//---------------------------------------------------------
	oilPumpInHeatedSpace = current.oilPumpInHeatedSpace;
	oilBoilerInstalled   = current.oilBoilerInstalled;
	CPSUoperatingTemp    = current.CPSUoperatingTemp;
	heatEmmFromCase      = current.heatEmmFromCase;
	heatTransferredToWater = current.heatTransferredToWater;

	isThereCHP		 = current.isThereCHP;
	CHPfuel			 = current.CHPfuel;
	fractOfHtFromCHP = current.fractOfHtFromCHP;
	elecEffOfCHP     = current.elecEffOfCHP;
	heatingEffOfCHP  = current.heatingEffOfCHP;

	//---------------------------------------------------------
	// SECONDARY HEATING
	//---------------------------------------------------------
	isThereSecHeating		= current.isThereSecHeating;
	secHtOpenFlueChimney	= current.secHtOpenFlueChimney;
	secHtUnconnectedGasPoint= current.secHtUnconnectedGasPoint;
	secHtEffFrom			= current.secHtEffFrom;
	secHtFuel				= current.secHtFuel;
	secHtSystem				= current.secHtSystem;
	secHtManufactDesc		= current.secHtManufactDesc;
	secHtTestMethod			= current.secHtTestMethod;
	secHtEff				= current.secHtEff;
	secHtFraction			= current.secHtFraction;

	//---------------------------------------------------------
	// WATER HEATING
	//---------------------------------------------------------
	btnWaterHtFromMainState   = current.btnWaterHtFromMainState;
	WHtype					  = current.WHtype;
	WHtCylinderWithinDwelling = current.WHtCylinderWithinDwelling;
	WHtFuel					  = current.WHtFuel;
	WHtWaterSepTimed		  = current.WHtWaterSepTimed ;

	WHtCylManufactLossFactor = current.WHtCylManufactLossFactor;
	WHtCylDeclaredFactor	 = current.WHtCylDeclaredFactor ;
	WHtCylVolume			 = current.WHtCylVolume;
	WHtCylInsType			 = current.WHtCylInsType;
	WHtCylInsThickness		 = current.WHtCylInsThickness;
	WHtCylThermostat		 = current.WHtCylThermostat;
	WHtCylInHeatedSpace		 = current.WHtCylInHeatedSpace;
	WHtCylPrimaryPipeworkInsulated = current.WHtCylPrimaryPipeworkInsulated;
	WHtCylPumpedPrimarySystem = current.WHtCylPumpedPrimarySystem;
	WHtEff = current.WHtEff;

	WHtTSnCPSUinSingleUnit			= current.WHtTSnCPSUinSingleUnit;
	WHtTSnCPSUPrimaryPipeworkLT1_5m = current.WHtTSnCPSUPrimaryPipeworkLT1_5m;;
	WHtTSnCPSUstoreInAirCupbrd	    = current.WHtTSnCPSUstoreInAirCupbrd;

	WHtCombiKeepHotYN	   = current.WHtCombiKeepHotYN;
	DHWfromCommunityScheme = current.DHWfromCommunityScheme;
	WHtHeatPumpUsesImmer   = current.WHtHeatPumpUsesImmer;
	WHtUsesSummerImmer     = current.WHtUsesSummerImmer ;

	//---------------------------------------------------------
	// RENEWABLES 1
	//---------------------------------------------------------
	isSHWPresent     = current.isSHWPresent;	
	SHWCollectorType = current.SHWCollectorType;
	SHWCollectorOrientation = current.SHWCollectorOrientation;
	SHWCollectorTilt = current.SHWCollectorTilt;
	SHWOvershading   = current.SHWOvershading;
	isSHWAreaGross   = current.isSHWAreaGross;
	SHWApertureArea     = current.SHWApertureArea;
	SHW_ZLCE         = current.SHW_ZLCE;
	SHW_HeatLossCoefficient = current.SHW_HeatLossCoefficient;
	isSHWSolarStoreCombined = current.isSHWSolarStoreCombined;
	SHWSolarCircPump  = current.SHWSolarCircPump;
	SHWDedSolStoreVol = current.SHWDedSolStoreVol;
	 
	isPVPresent			   = current.isPVPresent;
	installedPVPeakPower   = current.installedPVPeakPower;
	PVCollectorOrientation = current.PVCollectorOrientation;
	PVCollectorTilt        = current.PVCollectorTilt;
	PVOvershading          = current.PVOvershading ;

	isWTPresent = current.isWTPresent;
	WTNumOf		= current.WTNumOf;
	WTDiameter  = current.WTDiameter;
	WTHeight	= current.WTHeight;

	uHydroyn = current.uHydroyn;
	uHydroAnnualAvgHead = current.uHydroAnnualAvgHead;
	uHydroAnnualAvgFlow = current.uHydroAnnualAvgFlow;
	uHydroEff = current.uHydroEff;
	
	uCHPyn               = current.uCHPyn; 
	uCHPheatToPowerRatio = current.uCHPheatToPowerRatio;
	uCHPElectricEff      = current.uCHPElectricEff;
	CHPFuel				 = current.CHPFuel;
	uCHPHeatingEff		 = current.uCHPHeatingEff;
	uCHPHeatingFraction  = current.uCHPHeatingFraction;

	MVHRyn		   = current.MVHRyn;
	MVHRThermalEff = current.MVHRThermalEff;

	FGHRSpresent           = current.FGHRSpresent;
	FGHRSstore           = current.FGHRSstore;
	FGHRSstoreVolume     = current.FGHRSstoreVolume;
	FGHRSusefulFracHtRec_kf1 = current.FGHRSusefulFracHtRec_kf1;
	FGHRSfittedMain      = current.FGHRSfittedMain;
	FGHRSfittedSec       = current.FGHRSfittedSec;
	FGHRStype            = current.FGHRStype;
	determineFGHRStype   = current.determineFGHRStype;
	FGHRStotFracHeatRec_kf2  = current.FGHRStotFracHeatRec_kf2;
	FGHRSauxelec   = current.FGHRSauxelec;
	FGHRSpvPoweredHt     = current.FGHRSpvPoweredHt;
	FGHRSpvPkPower       = current.FGHRSpvPkPower;
	FGHRSpvOrientation = current.FGHRSpvOrientation;
	FGHRSpvTilt          = current.FGHRSpvTilt;
	FGHRSpvOvershading   = current.FGHRSpvOvershading;
	FGHRScableLoss       = current.FGHRScableLoss;

	WWHRSpresent    = current.WWHRSpresent;
	WWHRSnumOfRooms = current.WWHRSnumOfRooms;
	WWHRS1Make      = current.WWHRS1Make;
	WWHRSnumMixerShowersWithBath1    = current.WWHRSnumMixerShowersWithBath1;
	WWHRSnumMixerShowersWithoutBath1 = current.WWHRSnumMixerShowersWithoutBath1;
	WWHRS1Model = current.WWHRS1Model;
	WWHRS1ModelQualifier = current.WWHRS1ModelQualifier;
	WWHRS2Make                       = current.WWHRS2Make;
	WWHRSnumMixerShowersWithBath2    = current.WWHRSnumMixerShowersWithBath2;
	WWHRSnumMixerShowersWithoutBath2 = current.WWHRSnumMixerShowersWithoutBath2;
	WWHRS2Model                      = current.WWHRS2Model;
	WWHRS2ModelQualifier             = current.WWHRS2ModelQualifier;
	// ------------------------------------------------------
	//	LIGHTS
	//------------------------------------------------------
	fractionLEL = current.fractionLEL;

	// ------------------------------------------------------
	// HEM
	// ------------------------------------------------------
	hemHouseType   = current.hemHouseType;
	hemYearOfBuild = current.hemYearOfBuild;

	//---------------------------------------------
	// MISC VARIABLES FO RRESULTS DIALOG
	//---------------------------------------------
	chkInsulation = current.chkInsulation;
	hemI_insulationSliderPos = current.hemI_insulationSliderPos;

	chkAirtightness = current.chkAirtightness;
	hemA_achSliderPos = current.hemA_achSliderPos;

	chkCapacity= current.chkCapacity;
	hemC_capacitySliderPos = current.hemC_capacitySliderPos;

	chkSolarIngress = current.chkSolarIngress;
	hemS_solarGainsSliderPos = current.hemS_solarGainsSliderPos;

	chkOccupancy = current.chkOccupancy;
	hemO_OCCDensitySliderPos = current.hemO_OCCDensitySliderPos;

	chkControlledSpace = current.chkControlledSpace;
	hemL_LAFracSliderPos = current.hemL_LAFracSliderPos;

	chkSDHW = current.chkSDHW;
	chkPV   = current.chkPV;
	chkWT   = current.chkWT;
	chkuCHP = current.chkuCHP;
	chkuHydro = current.chkuHydro;
	chkPCM    = current.chkPCM;
	chkMVHR   = current.chkMVHR;
	chkFGHRS  = current.chkFGHRS;
	chkWWHRS  = current.chkWWHRS;	
}


CSAPPImpData::CSAPPImpData(void)
{
}

CSAPPImpData::~CSAPPImpData(void)
{
}

void CDlg_Results::OnBnClickedBase()
{
	is_base_changed = true;
	is_base_selected = true;
	ReadInputsFromResultsDialog();
	EnableOrDisableControls();

}

void CDlg_Results::OnBnClickedImprovement1()
{
	is_imp1_selected = true;
	is_imp1_changed  = true;
	ReadInputsFromResultsDialog();
	EnableOrDisableControls();
}

void CDlg_Results::OnBnClickedImprovement2()
{
	is_imp2_selected = true;	
	is_imp2_changed  = true;
	ReadInputsFromResultsDialog();	
	EnableOrDisableControls();
}

void CDlg_Results::OnBnClickedImprovement3()
{
	is_imp3_selected = true;
	is_imp3_changed  = true;
	ReadInputsFromResultsDialog();	
	EnableOrDisableControls();
}

void CDlg_Results::OnBnClickedImprovement4()
{
	is_imp4_selected = true;
	is_imp4_changed  = true;
	ReadInputsFromResultsDialog();	
	EnableOrDisableControls();
}

void CDlg_Results::OnBnClickedImprovement5()
{
	is_imp5_selected = true;
	is_imp5_changed  = true;
	ReadInputsFromResultsDialog();	
	EnableOrDisableControls();
}

void CSAPP1Dlg::SaveProjectFile_2()
{
	//if(save_file_called_first_time == true)
	//{
	//	save_file_called_first_time = false;
	//	m_tabCtrlProjects.DeleteAllItems(); // This will be the first untitled tab
	//}

	//-----------------------------------------------
	// These integer variables will be used to check
	// which improvements have been applied when the
	// file is opened
	//-----------------------------------------------
	if(is_base_selected == false)
		baseSelected = 0;
	else
		baseSelected = 1;

	if(is_imp1_selected == false)
		imp1Selected = 0;
	else
		imp1Selected = 1;

	if(is_imp2_selected == false)
		imp2Selected = 0;
	else
		imp2Selected = 1;

	if(is_imp3_selected == false)
		imp3Selected = 0;
	else
		imp3Selected = 1;

	if(is_imp4_selected == false)
		imp4Selected = 0;
	else
		imp4Selected = 1;

	if(is_imp5_selected == false)
		imp5Selected = 0;
	else
		imp5Selected = 1;
	 
	FILE *fptr;	
	fptr = fopen( projectFileName,"w");
	// Line 1 for headings

	//-------------------------------
	// JOB DETAILS
	//-------------------------------	
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n",	"HUE ver 1.8","current","base","improvement1","improvement2","improvement3","improvement4","improvement5",XIACSOL_string,XIACSOL_string); 
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",	"Improvements applied",1,baseSelected,imp1Selected,imp2Selected,imp3Selected,imp4Selected,imp5Selected);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Ref Num",		 JobDetRefNum,   base.JobDetRefNum, imp1.JobDetRefNum,imp2.JobDetRefNum,imp3.JobDetRefNum,imp4.JobDetRefNum,imp5.JobDetRefNum); 
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Assessor Name", assessorName,   base.assessorName,	imp1.assessorName,imp2.assessorName,imp3.assessorName,imp4.assessorName,imp5.assessorName);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Comments",		JobDetComments,  base.JobDetComments, imp1.JobDetComments,imp2.JobDetComments,imp3.JobDetComments,imp4.JobDetComments,imp5.JobDetComments);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Flat Name/Num (Property)", propertyFlatNameorNum, base.propertyFlatNameorNum,imp1.propertyFlatNameorNum,imp2.propertyFlatNameorNum,imp3.propertyFlatNameorNum,imp4.propertyFlatNameorNum,imp5.propertyFlatNameorNum);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Letter", propertyLetter,        base.propertyLetter,  imp1.propertyLetter,imp2.propertyLetter,imp3.propertyLetter,imp4.propertyLetter,imp5.propertyLetter);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"HouseNum", propertyHouseNum,	base.propertyHouseNum, imp1.propertyHouseNum,imp2.propertyHouseNum,imp3.propertyHouseNum,imp4.propertyHouseNum,imp5.propertyHouseNum);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Street", propertyStreet, base.propertyStreet,     imp1.propertyStreet,imp2.propertyStreet,imp3.propertyStreet,imp4.propertyStreet,imp5.propertyStreet);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Locality", propertyLocality,	base.propertyLocality, imp1.propertyLocality,imp2.propertyLocality,imp3.propertyLocality,imp4.propertyLocality,imp5.propertyLocality);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"District", propertyDistrict,	base.propertyDistrict, imp1.propertyDistrict,imp2.propertyDistrict,imp3.propertyDistrict,imp4.propertyDistrict,imp5.propertyDistrict);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Town", propertyTown,			base.propertyTown,     imp1.propertyTown,imp2.propertyTown,imp3.propertyTown,imp4.propertyTown,imp5.propertyTown);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"County", propertyCounty,		base.propertyCounty,   imp1.propertyCounty,imp2.propertyCounty,imp3.propertyCounty,imp4.propertyCounty,imp5.propertyCounty);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"PostCode", propertyPostCode,	base.propertyPostCode, imp1.propertyPostCode,imp2.propertyPostCode,imp3.propertyPostCode,imp4.propertyPostCode,imp5.propertyPostCode);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"FlatNameorNum (Client)",clientFlatNameorNum, base.clientFlatNameorNum,imp1.clientFlatNameorNum,imp2.clientFlatNameorNum,imp3.clientFlatNameorNum,imp4.clientFlatNameorNum,imp5.clientFlatNameorNum);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"House/BlockNum", clientHouseorBlockNum, base.clientHouseorBlockNum,imp1.clientHouseorBlockNum,imp2.clientHouseorBlockNum,imp3.clientHouseorBlockNum,imp4.clientHouseorBlockNum,imp5.clientHouseorBlockNum);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Letter",clientLetter,			base.clientLetter,     imp1.clientLetter,imp2.clientLetter,imp3.clientLetter,imp4.clientLetter,imp5.clientLetter);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Street",clientStreet,			base.clientStreet,     imp1.clientStreet,imp2.clientStreet,imp3.clientStreet,imp4.clientStreet,imp5.clientStreet);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Locality", clientLocality,		base.clientLocality,   imp1.clientLocality,imp2.clientLocality,imp3.clientLocality,imp4.clientLocality,imp5.clientLocality);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"District", clientDistrict,		base.clientDistrict,   imp1.clientDistrict,imp2.clientDistrict,imp3.clientDistrict,imp4.clientDistrict,imp5.clientDistrict);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Town", clientTown,				base.clientTown,       imp1.clientTown,imp2.clientTown,imp3.clientTown,imp4.clientTown,imp5.clientTown);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"County",clientCounty,			base.clientCounty,     imp1.clientCounty,imp2.clientCounty,imp3.clientCounty,imp4.clientCounty,imp5.clientCounty);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"PostCode",clientPostCode,		base.clientPostCode,   imp1.clientPostCode,imp2.clientPostCode,imp3.clientPostCode,imp4.clientPostCode,imp5.clientPostCode);

	//-------------------------------
	// BUILT FORM
	//-------------------------------
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Dwelling Type",  dwellingType, base.dwellingType,				imp1.dwellingType,		imp2.dwellingType,		imp3.dwellingType,		imp4.dwellingType,		imp5.dwellingType);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Built form",  builtForm, base.builtForm,				imp1.builtForm,		imp2.builtForm,		imp3.builtForm,		imp4.builtForm,		imp5.builtForm);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Detachment",     Detachment, base.Detachment,					imp1.Detachment,			imp2.Detachment,			imp3.Detachment,			imp4.Detachment,			imp5.Detachment);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"FlatPosition",       FlatPosition, base.FlatPosition,					imp1.FlatPosition,			imp2.FlatPosition,			imp3.FlatPosition,			imp4.FlatPosition,          imp5.FlatPosition);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Year Property Built", yearPropertBuilt, base.yearPropertBuilt,		imp1.yearPropertBuilt,  imp2.yearPropertBuilt,  imp3.yearPropertBuilt,  imp4.yearPropertBuilt,  imp5.yearPropertBuilt);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Degree Day Location", locationString, base.locationString,			imp1.locationString,    imp2.locationString,	imp3.locationString,    imp4.locationString,    imp5.locationString);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",	"Dwelling Sheltered Sides", dwellingShelteredSides, base.dwellingShelteredSides,imp1.dwellingShelteredSides, imp2.dwellingShelteredSides, imp3.dwellingShelteredSides,	imp4.dwellingShelteredSides, imp5.dwellingShelteredSides);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Dwelling Terrain", dwellingTerrain, base.dwellingTerrain,			imp1.dwellingTerrain,	imp2.dwellingTerrain,	imp3.dwellingTerrain,	imp4.dwellingTerrain,	imp5.dwellingTerrain);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Dwelling Exposure", dwellingExposure, base.dwellingExposure,			imp1.dwellingExposure,  imp2.dwellingExposure,  imp3.dwellingExposure,  imp4.dwellingExposure,  imp5.dwellingExposure);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Storey1", "  ", "  ","  ","  "," ","  ","  ");
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",  "Level", storey1Level, base.storey1Level,							imp1.storey1Level,		imp2.storey1Level,		imp3.storey1Level,		imp4.storey1Level,		imp5.storey1Level);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",  "Basement", storey1Basement , base.storey1Basement,					imp1.storey1Basement,   imp2.storey1Basement,   imp3.storey1Basement,   imp4.storey1Basement,   imp5.storey1Basement);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Area", storey1Area, base.storey1Area,				imp1.storey1Area,		imp2.storey1Area,		imp3.storey1Area,		imp4.storey1Area,		imp5.storey1Area);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Height",storey1Height, base.storey1Height,				imp1.storey1Height,		imp2.storey1Height,		imp3.storey1Height,		imp4.storey1Height,		imp5.storey1Height);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Storey2", "  ", "  ", "  ","  ", "  ", "  ", "  ");	
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Level", storey2Level, base.storey2Level,							imp1.storey2Level,		imp2.storey2Level,		imp3.storey2Level,		imp4.storey2Level,		imp5.storey2Level);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Basement", storey2Basement, base.storey2Basement,					imp1.storey2Basement,   imp2.storey2Basement,   imp3.storey2Basement,   imp4.storey2Basement,   imp5.storey2Basement);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Area",storey2Area,  base.storey2Area,				imp1.storey2Area,       imp2.storey2Area,       imp3.storey2Area,       imp4.storey2Area,       imp5.storey2Area);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Height",storey2Height, base.storey2Height,				imp1.storey2Height,     imp2.storey2Height,		imp3.storey2Height,		imp4.storey2Height,		imp5.storey2Height);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Storey3", "  ", "  ", "  ","  ", "  ", "  ", "  ");	
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Level", storey3Level, base.storey3Level,							imp1.storey3Level,		imp2.storey3Level,	imp3.storey3Level,		imp4.storey3Level,		imp5.storey3Level);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Basement", storey3Basement, base.storey3Basement,					imp1.storey3Basement,   imp2.storey3Basement,   imp3.storey3Basement,  imp4.storey3Basement,    imp5.storey3Basement);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Area", storey3Area, base.storey3Area,				imp1.storey3Area,		imp2.storey3Area,		imp3.storey3Area,		imp4.storey3Area,		imp5.storey3Area);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Height",storey3Height, base.storey3Height,				imp1.storey3Height,		imp2.storey3Height,		imp3.storey3Height,		imp4.storey3Height,		imp5.storey3Height);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Storey4", "  ", "  ", "  ","  ", "  ", "  ", "  ");	
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Level", storey4Level, base.storey4Level,							imp1.storey4Level,		imp2.storey4Level,		imp3.storey4Level,		imp4.storey4Level,		imp5.storey4Level);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Basement", storey4Basement, base.storey4Basement,					imp1.storey4Basement,	imp2.storey4Basement,	imp3.storey4Basement,	imp4.storey4Basement,	imp5.storey4Basement);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Area", storey4Area,base.storey4Area,				imp1.storey4Area,		imp2.storey4Area,		imp3.storey4Area,		imp4.storey4Area,		imp5.storey4Area);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Height",storey4Height,base.storey4Height,				imp1.storey4Height,		imp2.storey4Height,		imp3.storey4Height,		imp4.storey4Height,		imp5.storey4Height);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Storey5", "  ", "  ","  ", "  ", "  ", "  ", "  ");	
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Level", storey5Level,base.storey5Level,							imp1.storey5Level,		imp2.storey5Level,		imp3.storey5Level,		imp4.storey5Level,		imp5.storey5Level);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Basement",storey5Basement, base.storey5Basement,					imp1.storey5Basement,	imp2.storey5Basement,	imp3.storey5Basement,	imp4.storey5Basement,	imp5.storey5Basement);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Area", storey5Area,base.storey5Area,				imp1.storey5Area,		imp2.storey5Area,		imp3.storey5Area,		imp4.storey5Area,		imp5.storey5Area);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Height",storey5Height,base.storey5Height,				imp1.storey5Height,		imp2.storey5Height,		imp3.storey5Height,		imp4.storey5Height,		imp5.storey5Height);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Storey6", "  ", "  ","  ", "  ", "  ", "  ");	
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Level", storey6Level,base.storey6Level,							imp1.storey6Level,		imp2.storey6Level,		imp3.storey6Level,		imp4.storey6Level,		imp5.storey6Level);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Basement", storey6Basement,base.storey6Basement,					imp1.storey6Basement,	imp2.storey6Basement,	imp3.storey6Basement,	imp4.storey6Basement,	imp5.storey6Basement);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Area", storey6Area,base.storey6Area,				imp1.storey6Area,		imp2.storey6Area,		imp3.storey6Area,		imp4.storey6Area,		imp5.storey6Area);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Height",storey6Height,base.storey6Height,				imp1.storey6Height,		imp2.storey6Height,		imp3.storey6Height,		imp4.storey6Height,		imp5.storey6Height);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "TFA from SHCS",TFAfromHEM,base.TFAfromHEM,				imp1.TFAfromHEM,		imp2.TFAfromHEM,		imp3.TFAfromHEM,		imp4.TFAfromHEM,		imp5.TFAfromHEM);
		
	//-------------------------------
	// WINDOWS
	//-------------------------------
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "North window area",winNArea, base.winNArea,		imp1.winNArea,			imp2.winNArea,			imp3.winNArea,			imp4.winNArea,			imp5.winNArea);
    fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sol trans",winNSolTrans, base.winNSolTrans,			imp1.winNSolTrans,		imp2.winNSolTrans,		imp3.winNSolTrans,		imp4.winNSolTrans,		imp5.winNSolTrans);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Frame Factor",winNFrameFactor,base.winNFrameFactor,		imp1.winNFrameFactor,	imp2.winNFrameFactor,	imp3.winNFrameFactor,	imp4.winNFrameFactor,	imp5.winNFrameFactor);

	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "North East window area",winNEArea,base.winNEArea,	imp1.winNEArea,			imp2.winNEArea,			imp3.winNEArea,			imp4.winNEArea,			imp5.winNEArea);
    fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sol trans",winNESolTrans,	base.winNESolTrans,			imp1.winNESolTrans,		imp2.winNESolTrans,		imp3.winNESolTrans,		imp4.winNESolTrans,		imp5.winNESolTrans);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Frame Factor",winNEFrameFactor,base.winNEFrameFactor,	imp1.winNEFrameFactor,  imp2.winNEFrameFactor,  imp3.winNEFrameFactor,  imp4.winNEFrameFactor,  imp5.winNEFrameFactor);

	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "East window area",winEArea,base.winEArea,		imp1.winEArea,			imp2.winEArea,			imp3.winEArea,			imp4.winEArea,			imp5.winEArea);
    fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sol trans",winESolTrans,base.winESolTrans,			imp1.winESolTrans,		imp2.winESolTrans,		imp3.winESolTrans,		imp4.winESolTrans,		imp5.winESolTrans);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Frame Factor",winEFrameFactor,base.winEFrameFactor,		imp1.winEFrameFactor,	imp2.winEFrameFactor,	imp3.winEFrameFactor,	imp4.winEFrameFactor,	imp5.winEFrameFactor);

	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sourth East window area",winSEArea,base.winSEArea,imp1.winSEArea,			imp2.winSEArea,			imp3.winSEArea,			imp4.winSEArea,			imp5.winSEArea);
    fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sol trans",winSESolTrans,	base.winSESolTrans,			imp1.winSESolTrans,		imp2.winSESolTrans,		imp3.winSESolTrans,		imp4.winSESolTrans,		imp5.winSESolTrans);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Frame Factor",winSEFrameFactor,base.winSEFrameFactor,	imp1.winSEFrameFactor,	imp2.winSEFrameFactor,	imp3.winSEFrameFactor,	imp4.winSEFrameFactor,	imp5.winSEFrameFactor);

	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "South window area",winSArea,base.winSArea,		imp1.winSArea,			imp2.winSArea,			imp3.winSArea,			imp4.winSArea,			imp5.winSArea);
    fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sol trans",winSSolTrans,base.winSSolTrans,			imp1.winSSolTrans,		imp2.winSSolTrans,		imp3.winSSolTrans,		imp4.winSSolTrans,		imp5.winSSolTrans);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Frame Factor",winSFrameFactor,base.winSFrameFactor,		imp1.winSFrameFactor,	imp2.winSFrameFactor,	imp3.winSFrameFactor,	imp4.winSFrameFactor,	imp5.winSFrameFactor);

	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "South Wsey window area",winSWArea,base.winSWArea, imp1.winSWArea ,		imp2.winSWArea,			imp3.winSWArea,			imp4.winSWArea,			imp5.winSWArea);
    fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sol trans",winSWSolTrans,base.winSWSolTrans,			imp1.winSWSolTrans,		imp2.winSWSolTrans,		imp3.winSWSolTrans,		imp4.winSWSolTrans,		imp5.winSWSolTrans);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Frame Factor",winSWFrameFactor,base.winSWFrameFactor,	imp1.winSWFrameFactor,	imp2.winSWFrameFactor,	imp3.winSWFrameFactor,	imp4.winSWFrameFactor,	imp5.winSWFrameFactor);

	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "West window area",winWArea,base.winWArea,		imp1.winWArea,			imp2.winWArea,			imp3.winWArea,			imp4.winWArea,			imp5.winWArea);
    fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sol trans",winWSolTrans,base.winWSolTrans,			imp1.winWSolTrans,		imp2.winWSolTrans,		imp3.winWSolTrans,		imp4.winWSolTrans,		imp5.winWSolTrans);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Frame Factor",winWFrameFactor,base.winWFrameFactor,		imp1.winWFrameFactor,	imp2.winWFrameFactor,	imp3.winWFrameFactor,	imp4.winWFrameFactor,	imp5.winWFrameFactor);

	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "North west window area",winNWArea,base.winNWArea,	imp1.winNWArea,			imp2.winNWArea,			imp3.winNWArea,			imp4.winNWArea,			imp5.winNWArea);
    fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sol trans",winNWSolTrans,	base.winNWSolTrans,			imp1.winNWSolTrans,		imp2.winNWSolTrans,		imp3.winNWSolTrans,		imp4.winNWSolTrans,		imp5.winNWSolTrans);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Frame Factor",winNWFrameFactor,base.winNWFrameFactor,	imp1.winNWFrameFactor,  imp2.winNWFrameFactor,  imp3.winNWFrameFactor,  imp4.winNWFrameFactor,  imp5.winNWFrameFactor);

	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Rooflights area",rooflightsArea,base.rooflightsArea,	imp1.rooflightsArea,		imp2.rooflightsArea,		imp3.rooflightsArea,		imp4.rooflightsArea,		imp5.rooflightsArea);
    fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Sol trans",rooflightsSolTrans,base.rooflightsSolTrans,		imp1.rooflightsSolTrans,	imp2.rooflightsSolTrans,	imp3.rooflightsSolTrans,	imp4.rooflightsSolTrans,	imp5.rooflightsSolTrans);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Frame Factor",rooflightsFrameFactor,base.rooflightsFrameFactor,imp1.rooflightsFrameFactor, imp2.rooflightsFrameFactor, imp3.rooflightsFrameFactor, imp4.rooflightsFrameFactor, imp5.rooflightsFrameFactor);

	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Overshading",winOvershading,	base.winOvershading,				imp1.winOvershading,		imp2.winOvershading,		imp3.winOvershading,		imp4.winOvershading,		imp5.winOvershading);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Glazing",winGlazing,	base.winGlazing,						imp1.winGlazing,			imp2.winGlazing,			imp3.winGlazing,			imp4.winGlazing,			imp5.winGlazing);

	//-------------------------------
	// AREAS AND U-VALUES
	//-------------------------------
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Gross Area Wall1",grossAreaWall1,	 base.grossAreaWall1,			imp1.grossAreaWall1,		imp2.grossAreaWall1,	   imp3.grossAreaWall1,		  imp4.grossAreaWall1,			imp5.grossAreaWall1);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Gross Area Roof1",groosAreaRoof1,	 base.groosAreaRoof1,			imp1.groosAreaRoof1,		imp2.groosAreaRoof1,	   imp3.groosAreaRoof1,		  imp4.groosAreaRoof1,			imp5.groosAreaRoof1);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area Doors",netAreaDoors,	 base.netAreaDoors,					imp1.netAreaDoors,			imp2.netAreaDoors,		   imp3.netAreaDoors,		  imp4.netAreaDoors,			imp5.netAreaDoors);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area Windows",netAreaWindows, base.netAreaWindows,				imp1.netAreaWindows,		imp2.netAreaWindows,	   imp3.netAreaWindows,		  imp4.netAreaWindows,			imp5.netAreaWindows);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area RoofLights",netAreaRoofLights,base.netAreaRoofLights,		imp1.netAreaRoofLights,		imp2.netAreaRoofLights,    imp3.netAreaRoofLights,    imp4.netAreaRoofLights,		imp5.netAreaRoofLights);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Fraction LEL",  fractionLEL, base.fractionLEL,   imp1.fractionLEL,  imp2. fractionLEL,   imp3.fractionLEL,  imp4.fractionLEL,   imp5.fractionLEL);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area GF",netAreaGF,base.netAreaGF,								imp1.netAreaGF,             imp2.netAreaGF,			   imp3.netAreaGF,			  imp4.netAreaGF,				imp5.netAreaGF);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area ExFloor",netAreaExFloor,	base.netAreaExFloor,			imp1.netAreaExFloor,		imp2.netAreaExFloor,	   imp3.netAreaExFloor,		  imp4.netAreaExFloor,	        imp5.netAreaExFloor);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area WallType1",netAreaWallType1,base.netAreaWallType1,		imp1.netAreaWallType1,		imp2.netAreaWallType1,     imp3.netAreaWallType1,	  imp4.netAreaWallType1,	    imp5.netAreaWallType1);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area WallType2",netAreaWallType2,	base.netAreaWallType2,		imp1.netAreaWallType2,		imp2.netAreaWallType2,     imp3.netAreaWallType2,	  imp4.netAreaWallType2,	    imp5.netAreaWallType2);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area RoofType1",netAreaRoofType1,base.netAreaRoofType1,		imp1.netAreaRoofType1,		imp2.netAreaRoofType1,     imp3.netAreaRoofType1,	  imp4.netAreaRoofType1,	    imp5.netAreaRoofType1);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area RoofType2",netAreaRoofType2,	base.netAreaRoofType2,		imp1.netAreaRoofType2,		imp2.netAreaRoofType2,     imp3.netAreaRoofType2,	  imp4.netAreaRoofType2,	    imp5.netAreaRoofType2);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area PartyWall",netAreaPartyWall,base.netAreaPartyWall,		imp1.netAreaPartyWall,		imp2.netAreaPartyWall,     imp3.netAreaPartyWall,	  imp4.netAreaPartyWall,	    imp5.netAreaPartyWall);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area Party Floor",netAreaPartyFloor,base.netAreaPartyFloor,	imp1.netAreaPartyFloor,		imp2.netAreaPartyFloor,    imp3.netAreaPartyFloor,	  imp4.netAreaPartyFloor,	    imp5.netAreaPartyFloor);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area Party Ceiling",netAreaPartyCeiling,base.netAreaPartyCeiling, imp1.netAreaPartyCeiling,   imp2.netAreaPartyCeiling,   imp3.netAreaPartyCeiling, imp4.netAreaPartyCeiling,	    imp5.netAreaPartyCeiling);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area Internal Wall",netAreaInternalWall,base.netAreaInternalWall, imp1.netAreaInternalWall,   imp2.netAreaInternalWall,  imp3.netAreaInternalWall,  imp4.netAreaInternalWall,	    imp5.netAreaInternalWall);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area Internal Floor",netAreaInternalFloor,base.netAreaInternalFloor,imp1.netAreaInternalFloor, imp2.netAreaInternalFloor, imp3.netAreaInternalFloor, imp4.netAreaInternalFloor,    imp5.netAreaInternalFloor);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Net Area Internal Ceiling",netAreaInternalCeiling,base.netAreaInternalCeiling,imp1.netAreaInternalCeiling, imp2.netAreaInternalCeiling, imp3.netAreaInternalCeiling, imp4.netAreaInternalCeiling, imp5.netAreaInternalCeiling);
	
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value Doors",UvalueDoors, base.UvalueDoors,			 imp1.UvalueDoors,       imp2.UvalueDoors,			 imp3.UvalueDoors,		imp4.UvalueDoors,		imp5.UvalueDoors);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value Windows",UvalueWindows, base.UvalueWindows,		 imp1.UvalueWindows,     imp2.UvalueWindows,		 imp3.UvalueWindows,		imp4.UvalueWindows,		imp5.UvalueWindows);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value Rooflights",UvalueRooflights, base.UvalueRooflights,	 imp1.UvalueRooflights,  imp2.UvalueRooflights,		 imp3.UvalueRooflights,	imp4.UvalueRooflights,	imp5.UvalueRooflights);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value GF",UvalueGF,	 base.UvalueGF,					 imp1.UvalueGF,			 imp2.UvalueGF,				 imp3.UvalueGF,			imp4.UvalueGF,			imp5.UvalueGF);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value ExposedFloor",UvalueExposedFloor, base.UvalueExposedFloor,imp1.UvalueExposedFloor,imp2.UvalueExposedFloor,	 imp3.UvalueExposedFloor,imp4.UvalueExposedFloor,imp5.UvalueExposedFloor);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value WallType1",UvalueWallType1, base.UvalueWallType1,	 imp1.UvalueWallType1,   imp2.UvalueWallType1,		 imp3.UvalueWallType1,	imp4.UvalueWallType1,	imp5.UvalueWallType1);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value WallType2",UvalueWallType2, base.UvalueWallType2,	 imp1.UvalueWallType2,   imp2.UvalueWallType2,		 imp3.UvalueWallType2,	imp4.UvalueWallType2,	imp5.UvalueWallType2);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value RoofTYpe1",UvalueRoofTYpe1, base.UvalueRoofTYpe1,	 imp1.UvalueRoofTYpe1,   imp2.UvalueRoofTYpe1,		 imp3.UvalueRoofTYpe1,	imp4.UvalueRoofTYpe1,	imp5.UvalueRoofTYpe1);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value RoofType2",UvalueRoofType2, base.UvalueRoofType2,	 imp1.UvalueRoofType2,   imp2.UvalueRoofType2,		 imp3.UvalueRoofType2,	imp4.UvalueRoofType2,	imp5.UvalueRoofType2);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "U-value PartyWall",UvaluePartyWall, base.UvaluePartyWall,	 imp1.UvaluePartyWall,   imp2.UvaluePartyWall,		 imp3.UvaluePartyWall,	imp4.UvaluePartyWall,	imp5.UvaluePartyWall);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value GF",kValueGF,	 base.kValueGF,					  imp1.kValueGF,			imp2.kValueGF,			 imp3.kValueGF,				imp4.kValueGF,			imp5.kValueGF);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value ExpFloor",kValueExpFloor, base.kValueExpFloor,		  imp1.kValueExpFloor,		imp2.kValueExpFloor,	 imp3.kValueExpFloor,		imp4.kValueExpFloor,	imp5.kValueExpFloor);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value WallType1",kValueWallType1, base.kValueWallType1,	  imp1.kValueWallType1,		imp2.kValueWallType1,	 imp3.kValueWallType1,		imp4.kValueWallType1,	imp5.kValueWallType1);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value WallType2",kValueWallType2, base.kValueWallType2,	  imp1.kValueWallType2,		imp2.kValueWallType2,	 imp3.kValueWallType2,		imp4.kValueWallType2,	imp5.kValueWallType2);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value RoofType1",kValueRoofType1, base.kValueRoofType1,	  imp1.kValueRoofType1,		imp2.kValueRoofType1,	 imp3.kValueRoofType1,		imp4.kValueRoofType1,	imp5.kValueRoofType1);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value RoofType2",kValueRoofType2, base.kValueRoofType2,	  imp1.kValueRoofType2,		imp2.kValueRoofType2,	 imp3.kValueRoofType2,		imp4.kValueRoofType2,	imp5.kValueRoofType2);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value PartyWall",kValuePartyWall, base.kValuePartyWall,	  imp1.kValuePartyWall,		imp2.kValuePartyWall,	 imp3.kValuePartyWall,		imp4.kValuePartyWall,	imp5.kValuePartyWall);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value PartyFloor",kValuePartyFloor, base.kValuePartyFloor,    imp1.kValuePartyFloor,	imp2.kValuePartyFloor,	 imp3.kValuePartyFloor,		imp4.kValuePartyFloor,	imp5.kValuePartyFloor);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value PartyCeiling",kValuePartyCeiling, base.kValuePartyCeiling,imp1.kValuePartyCeiling,  imp2.kValuePartyCeiling, imp3.kValuePartyCeiling,   imp4.kValuePartyCeiling,imp5.kValuePartyCeiling);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value IntWall",kValueIntWall, base.kValueIntWall,		  imp1.kValueIntWall,		imp2.kValueIntWall,      imp3.kValueIntWall,		imp4.kValueIntWall,		imp5.kValueIntWall);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value IntFloor",kValueIntFloor, base.kValueIntFloor,		  imp1.kValueIntFloor,		imp2.kValueIntFloor,	 imp3.kValueIntFloor,		imp4.kValueIntFloor,	imp5.kValueIntFloor);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "k-Value IntCeiling",kValueIntCeiling, base.kValueIntCeiling,    imp1.kValueIntCeiling,	imp2.kValueIntCeiling,   imp3.kValueIntCeiling,		imp4.kValueIntCeiling,	imp5.kValueIntCeiling);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Thermal Mass",thermalMassParameter, base.thermalMassParameter,imp1.thermalMassParameter,imp2.thermalMassParameter,imp3.thermalMassParameter,imp4.thermalMassParameter,imp5.thermalMassParameter);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Living Room Fraction",livingRoomFraction, base.livingRoomFraction,imp1.livingRoomFraction,imp2.livingRoomFraction,imp3.livingRoomFraction,imp4.livingRoomFraction,imp5.livingRoomFraction);

	//------------------------------------------
	// THERMAL BRIDGES
	//------------------------------------------
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n","Enter Y-value",enterYValue,	base.enterYValue,						imp1.enterYValue, imp2.enterYValue,  imp3.enterYValue, imp4.enterYValue, imp5.enterYValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","y-value",yValueEntry,base.yValueEntry,				imp1.yValueEntry, imp2.yValueEntry,  imp3.yValueEntry, imp4.yValueEntry, imp5.yValueEntry);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Ground Floor perimeter",ThermBGFPerimeter,base.ThermBGFPerimeter,  imp1.ThermBGFPerimeter,        imp2.ThermBGFPerimeter,			imp3.ThermBGFPerimeter,         imp4.ThermBGFPerimeter,         imp5.ThermBGFPerimeter);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBGFPerimeterUserDef,	base.ThermBGFPerimeterUserDef,				imp1.ThermBGFPerimeterUserDef, imp2.ThermBGFPerimeterUserDef,	imp3.ThermBGFPerimeterUserDef,	imp4.ThermBGFPerimeterUserDef,  imp5.ThermBGFPerimeterUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBGFPerimeterSiValue,	base.ThermBGFPerimeterSiValue,			imp1.ThermBGFPerimeterSiValue, imp2.ThermBGFPerimeterSiValue,	imp3.ThermBGFPerimeterSiValue,	imp4.ThermBGFPerimeterSiValue,  imp5.ThermBGFPerimeterSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBGFPerimeterResult,	base.ThermBGFPerimeterResult,			imp1.ThermBGFPerimeterResult,  imp2.ThermBGFPerimeterResult,	imp3.ThermBGFPerimeterResult,	imp4.ThermBGFPerimeterResult,   imp5.ThermBGFPerimeterResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Floor Within Dwelling Perimeter",ThermBFloorWithingDwellinPerimeter,base.ThermBFloorWithingDwellinPerimeter, imp1.ThermBFloorWithingDwellinPerimeter,	   imp2.ThermBFloorWithingDwellinPerimeter,		 imp3.ThermBFloorWithingDwellinPerimeter,		imp4.ThermBFloorWithingDwellinPerimeter,		imp5.ThermBFloorWithingDwellinPerimeter);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBFloorWithinDwellingUserDef,	base.ThermBFloorWithinDwellingUserDef,								 imp1.ThermBFloorWithinDwellingUserDef,		   imp2.ThermBFloorWithinDwellingUserDef,		 imp3.ThermBFloorWithinDwellingUserDef,			imp4.ThermBFloorWithinDwellingUserDef,			imp5.ThermBFloorWithinDwellingUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBFloorWithinDwellingSiValue,	base.ThermBFloorWithinDwellingSiValue,							 imp1.ThermBFloorWithinDwellingSiValue,         imp2.ThermBFloorWithinDwellingSiValue,		 imp3.ThermBFloorWithinDwellingSiValue,			imp4.ThermBFloorWithinDwellingSiValue,			imp5.ThermBFloorWithinDwellingSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBFloorWithinDwellingPerimeterResult,base.ThermBFloorWithinDwellingPerimeterResult,					 imp1.ThermBFloorWithinDwellingPerimeterResult, imp2.ThermBFloorWithinDwellingPerimeterResult,imp3.ThermBFloorWithinDwellingPerimeterResult, imp4.ThermBFloorWithinDwellingPerimeterResult,  imp5.ThermBFloorWithinDwellingPerimeterResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Floor Between Dwelling Perimeter",ThermBFloorBetweenDwellinPerimeter,base.ThermBFloorBetweenDwellinPerimeter,imp1.ThermBFloorBetweenDwellinPerimeter,		 imp2.ThermBFloorBetweenDwellinPerimeter,		imp3.ThermBFloorBetweenDwellinPerimeter,		imp4.ThermBFloorBetweenDwellinPerimeter, imp5.ThermBFloorBetweenDwellinPerimeter);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBFloorBwDwellingUserDef,	base.ThermBFloorBwDwellingUserDef,									imp1.ThermBFloorBwDwellingUserDef,				 imp2.ThermBFloorBwDwellingUserDef,				imp3.ThermBFloorBwDwellingUserDef,				imp4.ThermBFloorBwDwellingUserDef,		 imp5.ThermBFloorBwDwellingUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBFloorBetweenDwellingSiValue,base.ThermBFloorBetweenDwellingSiValue,							imp1.ThermBFloorBetweenDwellingSiValue,			 imp2.ThermBFloorBetweenDwellingSiValue,		imp3.ThermBFloorBetweenDwellingSiValue,			imp4.ThermBFloorBetweenDwellingSiValue,	 imp5.ThermBFloorBetweenDwellingSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBFloorBetweenDwellingPerimeterResult,base.ThermBFloorBetweenDwellingPerimeterResult,					imp1.ThermBFloorBetweenDwellingPerimeterResult,  imp2.ThermBFloorBetweenDwellingPerimeterResult,imp3.ThermBFloorBetweenDwellingPerimeterResult, imp4.ThermBFloorBetweenDwellingPerimeterResult,imp5.ThermBFloorBetweenDwellingPerimeterResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Balcony Within Dwelling Length",ThermBBalconyWithingDwellingLength,base.ThermBBalconyWithingDwellingLength,	imp1.ThermBBalconyWithingDwellingLength,		 imp2.ThermBBalconyWithingDwellingLength,	imp3.ThermBBalconyWithingDwellingLength,	imp4.ThermBBalconyWithingDwellingLength,    imp5.ThermBBalconyWithingDwellingLength);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBBalcWithinDwellingLengthUserDef,	base.ThermBBalcWithinDwellingLengthUserDef,							imp1.ThermBBalcWithinDwellingLengthUserDef,		 imp2.ThermBBalcWithinDwellingLengthUserDef,imp3.ThermBBalcWithinDwellingLengthUserDef, imp4.ThermBBalcWithinDwellingLengthUserDef, imp5.ThermBBalcWithinDwellingLengthUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBBalconyWithinDwellingSiValue,	base.ThermBBalconyWithinDwellingSiValue,						imp1.ThermBBalconyWithinDwellingSiValue,		 imp2.ThermBBalconyWithinDwellingSiValue,	imp3.ThermBBalconyWithinDwellingSiValue,	imp4.ThermBBalconyWithinDwellingSiValue,    imp5.ThermBBalconyWithinDwellingSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBBalcWithDwellingLengthResult,	base.ThermBBalcWithDwellingLengthResult,							imp1.ThermBBalcWithDwellingLengthResult,		 imp2.ThermBBalcWithDwellingLengthResult,	imp3.ThermBBalcWithDwellingLengthResult,	imp4.ThermBBalcWithDwellingLengthResult,    imp5.ThermBBalcWithDwellingLengthResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Balcony Between Dwelling Length",ThermBBalconyBetweenDwellingLength,base.ThermBBalconyBetweenDwellingLength,imp1.ThermBBalconyBetweenDwellingLength,		 imp2.ThermBBalconyBetweenDwellingLength,	imp3.ThermBBalconyBetweenDwellingLength,	imp4.ThermBBalconyBetweenDwellingLength, imp5.ThermBBalconyBetweenDwellingLength);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBBalcBwDwellingLengthUserDef,	base.ThermBBalcBwDwellingLengthUserDef,								imp1.ThermBBalcBwDwellingLengthUserDef,			 imp2.ThermBBalcBwDwellingLengthUserDef,	imp3.ThermBBalcBwDwellingLengthUserDef,		imp4.ThermBBalcBwDwellingLengthUserDef,  imp5.ThermBBalcBwDwellingLengthUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBBalconyBwDwellingSiValue,	base.ThermBBalconyBwDwellingSiValue,							imp1.ThermBBalconyBwDwellingSiValue,			 imp2.ThermBBalconyBwDwellingSiValue,		imp3.ThermBBalconyBwDwellingSiValue,		imp4.ThermBBalconyBwDwellingSiValue,	 imp5.ThermBBalconyBwDwellingSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBBalconyBwDwellingLengthResult,	base.ThermBBalconyBwDwellingLengthResult,						imp1.ThermBBalconyBwDwellingLengthResult,		 imp2.ThermBBalconyBwDwellingLengthResult,  imp3.ThermBBalconyBwDwellingLengthResult,	imp4.ThermBBalconyBwDwellingLengthResult,imp5.ThermBBalconyBwDwellingLengthResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Evaes Insulation At Ceiling",ThermBEavesAtCeiling,	base.ThermBEavesAtCeiling,					imp1.ThermBEavesAtCeiling,                   	 imp2.ThermBEavesAtCeiling,			 imp3.ThermBEavesAtCeiling,            imp4.ThermBEavesAtCeiling,			imp5.ThermBEavesAtCeiling);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBEavesInsAtCeilingUserDef,	base.ThermBEavesInsAtCeilingUserDef,									imp1.ThermBEavesInsAtCeilingUserDef,			 imp2.ThermBEavesInsAtCeilingUserDef,imp3.ThermBEavesInsAtCeilingUserDef,  imp4.ThermBEavesInsAtCeilingUserDef, imp5.ThermBEavesInsAtCeilingUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBEavesInsAtCelingSiValue,base.ThermBEavesInsAtCelingSiValue,								imp1.ThermBEavesInsAtCelingSiValue,				 imp2.ThermBEavesInsAtCelingSiValue, imp3.ThermBEavesInsAtCelingSiValue,   imp4.ThermBEavesInsAtCelingSiValue,  imp5.ThermBEavesInsAtCelingSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBEavesInsCeilingResult,base.ThermBEavesInsCeilingResult,								imp1.ThermBEavesInsCeilingResult,				 imp2.ThermBEavesInsCeilingResult,   imp3.ThermBEavesInsCeilingResult,     imp4.ThermBEavesInsCeilingResult,	imp5.ThermBEavesInsCeilingResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Evaes Insulation At Rafters",ThermBEavesAtRafter,	base.ThermBEavesAtRafter,					imp1.ThermBEavesAtRafter,						 imp2.ThermBEavesAtRafter,			 imp3.ThermBEavesAtRafter,				imp4.ThermBEavesAtRafter,			imp5.ThermBEavesAtRafter);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBEavesInsAtRafterUserDef,base.ThermBEavesInsAtRafterUserDef,									imp1.ThermBEavesInsAtRafterUserDef,				 imp2.ThermBEavesInsAtRafterUserDef, imp3.ThermBEavesInsAtRafterUserDef,	imp4.ThermBEavesInsAtRafterUserDef, imp5.ThermBEavesInsAtRafterUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBEavesInsAtRafterSiValue,base.ThermBEavesInsAtRafterSiValue,								imp1.ThermBEavesInsAtRafterSiValue,				 imp2.ThermBEavesInsAtRafterSiValue, imp3.ThermBEavesInsAtRafterSiValue,	imp4.ThermBEavesInsAtRafterSiValue, imp5.ThermBEavesInsAtRafterSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBEavesInsRafterResult,base.ThermBEavesInsRafterResult,									imp1.ThermBEavesInsRafterResult,				 imp2.ThermBEavesInsRafterResult,	 imp3.ThermBEavesInsRafterResult,		imp4.ThermBEavesInsRafterResult,	imp5.ThermBEavesInsRafterResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Gable Insulation At Ceiling",ThermBGableAtCeiling,	base.ThermBGableAtCeiling,					imp1.ThermBGableAtCeiling,						 imp2.ThermBGableAtCeiling,			  imp3.ThermBGableAtCeiling,			imp4.ThermBGableAtCeiling,			 imp5.ThermBGableAtCeiling);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBGableInsAtCeilingUserDef,	base.ThermBGableInsAtCeilingUserDef,									imp1.ThermBGableInsAtCeilingUserDef,			 imp2.ThermBGableInsAtCeilingUserDef, imp3.ThermBGableInsAtCeilingUserDef,  imp4.ThermBGableInsAtCeilingUserDef, imp5.ThermBGableInsAtCeilingUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBGableInsAtCeilingSiValue,base.ThermBGableInsAtCeilingSiValue,							imp1.ThermBGableInsAtCeilingSiValue,			 imp2.ThermBGableInsAtCeilingSiValue, imp3.ThermBGableInsAtCeilingSiValue,  imp4.ThermBGableInsAtCeilingSiValue, imp5.ThermBGableInsAtCeilingSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBGableInsCeilingResult,	base.ThermBGableInsCeilingResult,								imp1.ThermBGableInsCeilingResult,				 imp2.ThermBGableInsCeilingResult,    imp3.ThermBGableInsCeilingResult,		imp4.ThermBGableInsCeilingResult,    imp5.ThermBGableInsCeilingResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Gable Insulation At Rafters",ThermBGableAtRafter,	base.ThermBGableAtRafter,					imp1.ThermBGableAtRafter,						 imp2.ThermBGableAtRafter,			 imp3.ThermBGableAtRafter,				imp4.ThermBGableAtRafter,			imp5.ThermBGableAtRafter);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBGableInsAtRafetUserDef,	base.ThermBGableInsAtRafetUserDef,									imp1.ThermBGableInsAtRafetUserDef,				 imp2.ThermBGableInsAtRafetUserDef,  imp3.ThermBGableInsAtRafetUserDef,		imp4.ThermBGableInsAtRafetUserDef,  imp5.ThermBGableInsAtRafetUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBGableInsAtRafterSiValue,base.ThermBGableInsAtRafterSiValue,								imp1.ThermBGableInsAtRafterSiValue,				 imp2.ThermBGableInsAtRafterSiValue, imp3.ThermBGableInsAtRafterSiValue,    imp4.ThermBGableInsAtRafterSiValue, imp5.ThermBGableInsAtRafterSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBGableInsRafterResult,base.ThermBGableInsRafterResult,									imp1.ThermBGableInsRafterResult,				 imp2.ThermBGableInsRafterResult,	 imp3.ThermBGableInsRafterResult,       imp4.ThermBGableInsRafterResult,    imp5.ThermBGableInsRafterResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Length Normal Corners",ThermBLengthNormalCorners,	base.ThermBLengthNormalCorners,					imp1.ThermBLengthNormalCorners,					 imp2.ThermBLengthNormalCorners,		  imp3.ThermBLengthNormalCorners,			imp4.ThermBLengthNormalCorners,			 imp5.ThermBLengthNormalCorners);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBLengthOfNormalCornersUserDef,base.ThermBLengthOfNormalCornersUserDef,								imp1.ThermBLengthOfNormalCornersUserDef,		 imp2.ThermBLengthOfNormalCornersUserDef, imp3.ThermBLengthOfNormalCornersUserDef,  imp4.ThermBLengthOfNormalCornersUserDef, imp5.ThermBLengthOfNormalCornersUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBLengthOfNormalCornersSiValue,base.ThermBLengthOfNormalCornersSiValue,						imp1.ThermBLengthOfNormalCornersSiValue,		 imp2.ThermBLengthOfNormalCornersSiValue, imp3.ThermBLengthOfNormalCornersSiValue,  imp4.ThermBLengthOfNormalCornersSiValue, imp5.ThermBLengthOfNormalCornersSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBLengthNormalCornersResult,base.ThermBLengthNormalCornersResult,							imp1.ThermBLengthNormalCornersResult,			 imp2.ThermBLengthNormalCornersResult,    imp3.ThermBLengthNormalCornersResult,     imp4.ThermBLengthNormalCornersResult,    imp5.ThermBLengthNormalCornersResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Length Inverted Corners",ThermBLengthInvertedCorners,base.ThermBLengthInvertedCorners,				imp1.ThermBLengthInvertedCorners,				 imp2.ThermBLengthInvertedCorners,          imp3.ThermBLengthInvertedCorners,			imp4.ThermBLengthInvertedCorners,			imp5.ThermBLengthInvertedCorners);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBLengthOfInvertedCornersUserDef,base.ThermBLengthOfInvertedCornersUserDef,							imp1.ThermBLengthOfInvertedCornersUserDef,		 imp2.ThermBLengthOfInvertedCornersUserDef, imp3.ThermBLengthOfInvertedCornersUserDef,	imp4.ThermBLengthOfInvertedCornersUserDef,  imp5.ThermBLengthOfInvertedCornersUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBLengthOfInvertedCornersSiValue,base.ThermBLengthOfInvertedCornersSiValue,						imp1.ThermBLengthOfInvertedCornersSiValue,		 imp2.ThermBLengthOfInvertedCornersSiValue, imp3.ThermBLengthOfInvertedCornersSiValue,	imp4.ThermBLengthOfInvertedCornersSiValue,  imp5.ThermBLengthOfInvertedCornersSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBLengthInvertedCornersResult,base.ThermBLengthInvertedCornersResult,							imp1.ThermBLengthInvertedCornersResult,			 imp2.ThermBLengthInvertedCornersResult,    imp3.ThermBLengthInvertedCornersResult,		imp4.ThermBLengthInvertedCornersResult,		imp5.ThermBLengthInvertedCornersResult);

	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Party Wall Between Dwelling Length",ThermBPartWallBetweenDwelling, base.ThermBPartWallBetweenDwelling,	imp1.ThermBPartWallBetweenDwelling,			 imp2.ThermBPartWallBetweenDwelling,       imp3.ThermBPartWallBetweenDwelling,			imp4.ThermBPartWallBetweenDwelling,		   imp5.ThermBPartWallBetweenDwelling);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "User defined",ThermBPartWallBetweenDwellingUserDef, base.ThermBPartWallBetweenDwellingUserDef,							imp1.ThermBPartWallBetweenDwellingUserDef,	 imp2.ThermBPartWallBetweenDwellingUserDef,imp3.ThermBPartWallBetweenDwellingUserDef,	imp4.ThermBPartWallBetweenDwellingUserDef, imp5.ThermBPartWallBetweenDwellingUserDef);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","SiValue",ThermBPartBwDwellingLengthSiValue, base.ThermBPartBwDwellingLengthSiValue,							imp1.ThermBPartBwDwellingLengthSiValue,		 imp2.ThermBPartBwDwellingLengthSiValue,   imp3.ThermBPartBwDwellingLengthSiValue,		imp4.ThermBPartBwDwellingLengthSiValue,    imp5.ThermBPartBwDwellingLengthSiValue);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Result",ThermBPartyWallBwDwellingResult, base.ThermBPartyWallBwDwellingResult,							imp1.ThermBPartyWallBwDwellingResult,		 imp2.ThermBPartyWallBwDwellingResult,     imp3.ThermBPartyWallBwDwellingResult,		imp4.ThermBPartyWallBwDwellingResult,      imp5.ThermBPartyWallBwDwellingResult);	

	//-------------------------------
	// VENTILATION
	//-------------------------------
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",   "Num of Open Fire Places",numsOpenFirePlaces, base.numsOpenFirePlaces,		imp1.numsOpenFirePlaces,   imp2.numsOpenFirePlaces,   imp3.numsOpenFirePlaces,	 imp4.numsOpenFirePlaces,	imp5.numsOpenFirePlaces);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",   "Num of Open Flues",numsOpenFlues, base.numsOpenFlues,				imp1.numsOpenFlues,		   imp2.numsOpenFlues,		  imp3.numsOpenFlues,		 imp4.numsOpenFlues,		imp5.numsOpenFlues);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",   "Num of Flueless Gas Fires",numsFluelessGasFires, base.numsFluelessGasFires,	imp1.numsFluelessGasFires, imp2.numsFluelessGasFires, imp3.numsFluelessGasFires, imp4.numsFluelessGasFires, imp5.numsFluelessGasFires);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",   "Num of Extract Fans",numsExtractFans, base.numsExtractFans,			imp1.numsExtractFans,      imp2.numsExtractFans,	  imp3.numsExtractFans,		 imp4.numsExtractFans,		imp5.numsExtractFans);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",   "Num of Passive Vents",numsPassiveVents, base.numsPassiveVents,			imp1.numsPassiveVents,     imp2.numsPassiveVents,	  imp3.numsPassiveVents,	 imp4.numsPassiveVents,		imp5.numsPassiveVents);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",   "Mech Vent Type",mechVentType, base.mechVentType,					imp1.mechVentType,         imp2.mechVentType,		  imp3.mechVentType,		 imp4.mechVentType,			imp5.mechVentType);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",   "Mech Vent Effeciency",MVHRThermalEff, base.MVHRThermalEff,	imp1.MVHRThermalEff,		   imp2.MVHRThermalEff,		  imp3.MVHRThermalEff,			 imp4.MVHRThermalEff,			imp5.MVHRThermalEff);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n", "SFP", SFP, base.SFP,								imp1.SFP,				   imp2.SFP,				  imp3.SFP,					 imp4.SFP,					imp5.SFP);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",   "Pressure Test YN",pressureTestYN, base.pressureTestYN,				imp1.pressureTestYN,       imp2.pressureTestYN,		  imp3.pressureTestYN,		 imp4.pressureTestYN,		imp5.pressureTestYN); 
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n", "Measured Q50",measuredQ50, base.measuredQ50,				imp1.measuredQ50,          imp2.measuredQ50,	      imp3.measuredQ50,			 imp4.measuredQ50,			imp5.measuredQ50 );  
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",   "Num Of Storeys",numOfStoreys, base.numOfStoreys,					imp1.numOfStoreys,		   imp2.numOfStoreys,		  imp3.numOfStoreys,		 imp4.numOfStoreys,			imp5.numOfStoreys );  
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Structural Infiltration",structInf, base.structInf,	imp1.structInf,		       imp2.structInf,			  imp3.structInf,			 imp4.structInf,			imp5.structInf);      
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Suspended Floor Infiltration",floorInf, base.floorInf,imp1.floorInf,             imp2.floorInf,			  imp3.floorInf,			 imp4.floorInf,				imp5.floorInf );   
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",   "Draught Lobby",draughtLobby, base.draughtLobby,						imp1.draughtLobby,         imp2.draughtLobby,		  imp3.draughtLobby,		 imp4.draughtLobby,			imp5.draughtLobby);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",   "Percentage of Windows Draught Stripped",perWindowDraughtStripped, base.perWindowDraughtStripped,            imp1.perWindowDraughtStripped, imp2.perWindowDraughtStripped,imp3.perWindowDraughtStripped,imp4.perWindowDraughtStripped,imp5.perWindowDraughtStripped);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n",   "Number of sheltered sides",numOfShelteredSides, base.numOfShelteredSides,	imp1.numOfShelteredSides,  imp2.numOfShelteredSides,  imp3.numOfShelteredSides,	 imp4.numOfShelteredSides,	imp5.numOfShelteredSides);
		
	//------------------------------------------
	// MAIN HEATING
	//------------------------------------------
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Electric Tarrif", electricityTarrif, base.electricityTarrif,	imp1.electricityTarrif, imp2.electricityTarrif, imp3.electricityTarrif, imp4.electricityTarrif, imp5.electricityTarrif);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Ht Type", mainHtType, base.mainHtType,				imp1.mainHtType,		imp2.mainHtType,		imp3.mainHtType,		imp4.mainHtType,		imp5.mainHtType);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Ht Eff From", mainHtEffFrom,	base.mainHtEffFrom,		imp1.mainHtEffFrom,		imp2.mainHtEffFrom,		imp3.mainHtEffFrom,		imp4.mainHtEffFrom,		imp5.mainHtEffFrom);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Boiler Type", boilerType, base.boilerType,				imp1.boilerType,		imp2.boilerType,		imp3.boilerType,		imp4.boilerType,		imp5.boilerType);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Fuel", mainFuel, base.mainFuel,	 				imp1.mainFuel,			imp2.mainFuel,			imp3.mainFuel,			imp4.mainFuel,			imp5.mainFuel);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Fan Flue", isFanFluePresent, base.isFanFluePresent,			imp1.isFanFluePresent,	imp2.isFanFluePresent,  imp3.isFanFluePresent,  imp4.isFanFluePresent,	imp5.isFanFluePresent);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Ht System", mainHtSystem,	 base.mainHtSystem,			imp1.mainHtSystem,		imp2.mainHtSystem,		imp3.mainHtSystem,		imp4.mainHtSystem,		imp5.mainHtSystem);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Ht Controls",  mainHtControls, base.mainHtControls,		imp1.mainHtControls,	imp2.mainHtControls,	imp3.mainHtControls,	imp4.mainHtControls,	imp5.mainHtControls);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Ht Emitter", mainHtEmitter, base.mainHtEmitter,		imp1.mainHtEmitter,		imp2.mainHtEmitter,		imp3.mainHtEmitter,		imp4.mainHtEmitter,		imp5.mainHtEmitter);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Ht Interlock", isIterlockPresent, base.isIterlockPresent,   imp1.isIterlockPresent, imp2.isIterlockPresent, imp3.isIterlockPresent, imp4.isIterlockPresent, imp5.isIterlockPresent);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Ht Compensator", mainHtCompensator, base.mainHtCompensator, imp1.mainHtCompensator, imp2.mainHtCompensator, imp3.mainHtCompensator, imp4.mainHtCompensator, imp5.mainHtCompensator);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Pump In Heated Space",isPumpInHeatedSpace, base.isPumpInHeatedSpace, imp1.isPumpInHeatedSpace, imp2.isPumpInHeatedSpace, imp3.isPumpInHeatedSpace, imp4.isPumpInHeatedSpace, imp5.isPumpInHeatedSpace);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Ht Manufacturer Desc", mainHtManufacturerDesc, base.mainHtManufacturerDesc, imp1.mainHtManufacturerDesc, imp2.mainHtManufacturerDesc, imp3.mainHtManufacturerDesc, imp4.mainHtManufacturerDesc, imp5.mainHtManufacturerDesc);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Main Ht Test Method", mainHtTestMethod,base.mainHtTestMethod,	imp1.mainHtTestMethod,	imp2.mainHtTestMethod,	imp3.mainHtTestMethod,	imp4. mainHtTestMethod, imp5.mainHtTestMethod);
	//fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Main Ht Eff", mainHtEff,base.mainHtEff,		imp1.mainHtEff,			imp2.mainHtEff,			imp3.mainHtEff,			imp4.mainHtEff, imp5.mainHtEff);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Main Ht Eff", mainHtEffNominal,base.mainHtEff,		imp1.mainHtEff,			imp2.mainHtEff,			imp3.mainHtEff,			imp4.mainHtEff, imp5.mainHtEff);
	//@min
	
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Main Ht Fraction", mainHtFractionSupplied,base.mainHtFractionSupplied, imp1.mainHtFractionSupplied, imp2.mainHtFractionSupplied, imp3.mainHtFractionSupplied, imp4.mainHtFractionSupplied, imp5.mainHtFractionSupplied);
	
	//------------------------------------------
	// MAIN HETAING DETAILS
	//------------------------------------------
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Oil Pump In Heated Space",  oilPumpInHeatedSpace, base.oilPumpInHeatedSpace,		imp1.oilPumpInHeatedSpace,      imp2.oilPumpInHeatedSpace,       imp3.oilPumpInHeatedSpace,   imp4.oilPumpInHeatedSpace,    imp5.oilPumpInHeatedSpace);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Oil Boiler Installed",		oilBoilerInstalled,base.oilBoilerInstalled,		imp1.oilBoilerInstalled,		imp2.oilBoilerInstalled,		 imp3.oilBoilerInstalled,     imp4.oilBoilerInstalled,		imp5.oilBoilerInstalled);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","CPSU Operating Temp", CPSUoperatingTemp,base.CPSUoperatingTemp,	imp1.CPSUoperatingTemp,			imp2.CPSUoperatingTemp,			 imp3.CPSUoperatingTemp,	  imp4.CPSUoperatingTemp,		imp5.CPSUoperatingTemp);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","Heat Emm From Case", heatEmmFromCase,	base.heatEmmFromCase,		imp1.heatEmmFromCase,			imp2.heatEmmFromCase,			 imp3.heatEmmFromCase,		  imp4.heatEmmFromCase,			imp5.heatEmmFromCase);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","Heat Transferred To Water", heatTransferredToWater, base.heatTransferredToWater, imp1.heatTransferredToWater, imp2.heatTransferredToWater, imp3.heatTransferredToWater, imp4.heatTransferredToWater,  imp5.heatTransferredToWater);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Is There CHP", isThereCHP,  base.isThereCHP,							imp1.isThereCHP,				imp2.isThereCHP,				 imp3.isThereCHP,			  imp4.isThereCHP,				imp5.isThereCHP);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","CHP fuel",   CHPfuel,base.CHPfuel,									imp1.CHPfuel,					imp2.CHPfuel,					 imp3.CHPfuel,				  imp4.CHPfuel,					imp5.CHPfuel);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","Fraction of Ht From CHP", fractOfHtFromCHP,base.fractOfHtFromCHP, imp1.fractOfHtFromCHP,			imp2.fractOfHtFromCHP,			 imp3.fractOfHtFromCHP,		  imp4.fractOfHtFromCHP,		imp5.fractOfHtFromCHP);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","Elec Eff of CHP",elecEffOfCHP, base.elecEffOfCHP,				imp1.elecEffOfCHP,				imp2.elecEffOfCHP,				 imp3.elecEffOfCHP,			  imp4.elecEffOfCHP,			imp5.elecEffOfCHP);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","Heating Eff of CHP",heatingEffOfCHP,	base. heatingEffOfCHP,		imp1.heatingEffOfCHP,			imp2.heatingEffOfCHP,			 imp3.heatingEffOfCHP,		  imp4.heatingEffOfCHP,			imp5.heatingEffOfCHP);

	//------------------------------------------
	// SECONDARY HEATING
	//------------------------------------------
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Sec Heating", isThereSecHeating,	base.isThereSecHeating,			     imp1.isThereSecHeating,		imp2.isThereSecHeating,			imp3.isThereSecHeating,			imp4.isThereSecHeating,			imp5.isThereSecHeating);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Open Flue Chimney", secHtOpenFlueChimney, base.secHtOpenFlueChimney,        imp1.secHtOpenFlueChimney,		imp2.secHtOpenFlueChimney,		imp3.secHtOpenFlueChimney,		imp4.secHtOpenFlueChimney,		imp5.secHtOpenFlueChimney);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Unconnected Gas Point", secHtUnconnectedGasPoint,base.secHtUnconnectedGasPoint,imp1.secHtUnconnectedGasPoint, imp2.secHtUnconnectedGasPoint,  imp3.secHtUnconnectedGasPoint,  imp4.secHtUnconnectedGasPoint,  imp5.secHtUnconnectedGasPoint);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Eff From", secHtEffFrom, base.secHtEffFrom, 						 imp1.secHtEffFrom,				imp2.secHtEffFrom,				imp3.secHtEffFrom,				imp4.secHtEffFrom,				imp5.secHtEffFrom);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Fuel", secHtFuel,base.secHtFuel,								 imp1.secHtFuel,				imp2.secHtFuel,					imp3.secHtFuel,					imp4.secHtFuel,					imp5.secHtFuel);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","System", secHtSystem,	base.secHtSystem,							 imp1.secHtSystem,				imp2.secHtSystem,				imp3.secHtSystem,				imp4.secHtSystem,				imp5.secHtSystem);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Manufact Desc", secHtManufactDesc,base.secHtManufactDesc,				 imp1.secHtManufactDesc,		imp2.secHtManufactDesc,			imp3.secHtManufactDesc,			imp4.secHtManufactDesc,			imp5.secHtManufactDesc);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Test Method", secHtTestMethod,	base.secHtTestMethod,					 imp1.secHtTestMethod,			imp2.secHtTestMethod,			imp3.secHtTestMethod,			imp4.secHtTestMethod,			imp5.secHtTestMethod);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n","Ht Eff", secHtEff,	base.secHtEff,					 imp1.secHtEff,					imp2.secHtEff,					imp3.secHtEff,					imp4.secHtEff,					imp5.secHtEff);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n","Sec Ht Fraction",secHtFraction,base.secHtFraction,		 imp1.secHtFraction,			imp2.secHtFraction,				imp3.secHtFraction,				imp4.secHtFraction,				imp5.secHtFraction); 

	//------------------------------------------
	// WATER HEATING
	//------------------------------------------
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n","Water Heating from main", btnWaterHtFromMainState,base.btnWaterHtFromMainState,			      imp1.btnWaterHtFromMainState,				imp2.btnWaterHtFromMainState,			imp3.btnWaterHtFromMainState,			imp4.btnWaterHtFromMainState,			imp5.btnWaterHtFromMainState);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Water Heating type",   WHtype,	base.WHtype,								      imp1.WHtype,								imp2.WHtype,							imp3.WHtype,							imp4.WHtype,							imp5.WHtype);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Is Cylinder Within Dwelling",   WHtCylinderWithinDwelling, base.WHtCylinderWithinDwelling,        imp1.WHtCylinderWithinDwelling,			imp2.WHtCylinderWithinDwelling,			imp3.WHtCylinderWithinDwelling,			imp4.WHtCylinderWithinDwelling,			imp5.WHtCylinderWithinDwelling);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Fuel",   WHtFuel,base.WHtFuel,											      imp1.WHtFuel,								imp2.WHtFuel,							imp3.WHtFuel,							imp4.WHtFuel,							imp5.WHtFuel);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Is Water Separately Timed",   WHtWaterSepTimed,base.WHtWaterSepTimed,				      imp1.WHtWaterSepTimed,					imp2.WHtWaterSepTimed,					imp3.WHtWaterSepTimed,					imp4.WHtWaterSepTimed,					imp5.WHtWaterSepTimed);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Cyllinder Manufacturer Loss Factor", WHtCylManufactLossFactor,base.WHtCylManufactLossFactor,    imp1.WHtCylManufactLossFactor,			imp2.WHtCylManufactLossFactor,			imp3.WHtCylManufactLossFactor,			imp4.WHtCylManufactLossFactor,			imp5.WHtCylManufactLossFactor);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n","Cylinder Declared Factor", WHtCylDeclaredFactor, base.WHtCylDeclaredFactor,      imp1.WHtCylDeclaredFactor,				imp2.WHtCylDeclaredFactor,				imp3.WHtCylDeclaredFactor,				imp4.WHtCylDeclaredFactor,				imp5.WHtCylDeclaredFactor);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n","Cylinder Volume", WHtCylVolume,base.WHtCylVolume,					      imp1.WHtCylVolume,						imp2.WHtCylVolume,						imp3.WHtCylVolume,						imp4.WHtCylVolume,						imp5.WHtCylVolume);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Cylinder Insulation Type",   WHtCylInsType,base.WHtCylInsType,					      imp1.WHtCylInsType,						imp2.WHtCylInsType,						imp3.WHtCylInsType,						imp4.WHtCylInsType,						imp5.WHtCylInsType);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n","Cylinder Insulation Thickness", WHtCylInsThickness,base.WHtCylInsThickness,   imp1.WHtCylInsThickness,					imp2.WHtCylInsThickness,				imp3.WHtCylInsThickness,				imp4.WHtCylInsThickness,				imp5.WHtCylInsThickness);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Cylinder Thermostat",   WHtCylThermostat,base.WHtCylThermostat,					      imp1.WHtCylThermostat,					imp2.WHtCylThermostat,					imp3.WHtCylThermostat,					imp4.WHtCylThermostat,					imp5.WHtCylThermostat);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Is Cylinder in Heated Space",   WHtCylInHeatedSpace,	base.WHtCylInHeatedSpace,			  imp1.WHtCylInHeatedSpace,					imp2.WHtCylInHeatedSpace,				imp3.WHtCylInHeatedSpace,				imp4.WHtCylInHeatedSpace,				imp5.WHtCylInHeatedSpace);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Cylinder Primary Pipework Insulated",   WHtCylPrimaryPipeworkInsulated,base.WHtCylPrimaryPipeworkInsulated,   imp1.WHtCylPrimaryPipeworkInsulated,   imp2.WHtCylPrimaryPipeworkInsulated,imp3.WHtCylPrimaryPipeworkInsulated,    imp4.WHtCylPrimaryPipeworkInsulated,    imp5.WHtCylPrimaryPipeworkInsulated);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Cylinder Pumped Primary System",   WHtCylPumpedPrimarySystem, base.WHtCylPumpedPrimarySystem,      imp1.WHtCylPumpedPrimarySystem,			imp2.WHtCylPumpedPrimarySystem,			imp3.WHtCylPumpedPrimarySystem,			imp4.WHtCylPumpedPrimarySystem,		    imp5.WHtCylPumpedPrimarySystem);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n","Water Heating Eff",WHtEff,	base.WHtEff,							   imp1.WHtEff,								imp2.WHtEff,							imp3.WHtEff,							imp4.WHtEff,						    imp5.WHtEff);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Therm Storage and CPSU inSingleUnit",   WHtTSnCPSUinSingleUnit,base.WHtTSnCPSUinSingleUnit,    imp1.WHtTSnCPSUinSingleUnit,				imp2.WHtTSnCPSUinSingleUnit,			imp3.WHtTSnCPSUinSingleUnit,			imp4.WHtTSnCPSUinSingleUnit,			imp5.WHtTSnCPSUinSingleUnit);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","TSnCPSUPrimaryPipeworkLT1_5m",  WHtTSnCPSUPrimaryPipeworkLT1_5m, base.WHtTSnCPSUPrimaryPipeworkLT1_5m,  imp1.WHtTSnCPSUPrimaryPipeworkLT1_5m,		imp2.WHtTSnCPSUPrimaryPipeworkLT1_5m,   imp3.WHtTSnCPSUPrimaryPipeworkLT1_5m,   imp4.WHtTSnCPSUPrimaryPipeworkLT1_5m,   imp5.WHtTSnCPSUPrimaryPipeworkLT1_5m);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Therm Storage and CPSU store In Air Cupbrd",  WHtTSnCPSUstoreInAirCupbrd, base.WHtTSnCPSUstoreInAirCupbrd,   imp1.WHtTSnCPSUstoreInAirCupbrd,imp2.WHtTSnCPSUstoreInAirCupbrd,		imp3.WHtTSnCPSUstoreInAirCupbrd,		imp4.WHtTSnCPSUstoreInAirCupbrd,		imp5.WHtTSnCPSUstoreInAirCupbrd);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Combi Keep Hot YN",   WHtCombiKeepHotYN,base.WHtCombiKeepHotYN,						   imp1.WHtCombiKeepHotYN,					imp2.WHtCombiKeepHotYN,					imp3.WHtCombiKeepHotYN,					imp4.WHtCombiKeepHotYN,					imp5.WHtCombiKeepHotYN);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","DHW From Community Scheme",   DHWfromCommunityScheme,base.DHWfromCommunityScheme,			   imp1.DHWfromCommunityScheme,				imp2.DHWfromCommunityScheme,			imp3.DHWfromCommunityScheme,			imp4.DHWfromCommunityScheme,			imp5.DHWfromCommunityScheme);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Water Heat Pump Uses Immersion",  WHtHeatPumpUsesImmer,  base.WHtHeatPumpUsesImmer,           imp1.WHtHeatPumpUsesImmer,				imp2.WHtHeatPumpUsesImmer,				imp3.WHtHeatPumpUsesImmer,				imp4.WHtHeatPumpUsesImmer,				imp5.WHtHeatPumpUsesImmer);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Water Heating Uses Summer Immersion",  WHtUsesSummerImmer,  base.WHtUsesSummerImmer,        imp1.WHtUsesSummerImmer,					imp2.WHtUsesSummerImmer,				imp3.WHtUsesSummerImmer,				imp4.WHtUsesSummerImmer,				imp5.WHtUsesSummerImmer);
	
	//------------------------------------------
	// RENEWABLES
	//------------------------------------------
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","is SHW Present",  isSHWPresent,	 base.isSHWPresent,							  imp1.isSHWPresent,			imp2.isSHWPresent,			  imp3.isSHWPresent,			imp4.isSHWPresent,				imp5.isSHWPresent);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Collector Type",   SHWCollectorType, base.SHWCollectorType,						  imp1.SHWCollectorType,		imp2.SHWCollectorType,		  imp3.SHWCollectorType,		imp4.SHWCollectorType,			imp5.SHWCollectorType);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Collector Orientation",  SHWCollectorOrientation,	 base.SHWCollectorOrientation,			  imp1.SHWCollectorOrientation, imp2.SHWCollectorOrientation, imp3.SHWCollectorOrientation, imp4.SHWCollectorOrientation,   imp5.SHWCollectorOrientation);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Collector Tilt",   SHWCollectorTilt,	base.SHWCollectorTilt,						  imp1.SHWCollectorTilt,		imp2.SHWCollectorTilt,		  imp3.SHWCollectorTilt,		imp4.SHWCollectorTilt,			imp5.SHWCollectorTilt);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Overshading",   SHWOvershading,	base.SHWOvershading,								  imp1.SHWOvershading,			imp2.SHWOvershading,		  imp3.SHWOvershading,			imp4.SHWOvershading,			imp5.SHWOvershading);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Is Area Gross",   isSHWAreaGross,base.isSHWAreaGross,							  imp1.isSHWAreaGross,			imp2.isSHWAreaGross,		  imp3. isSHWAreaGross,			imp4.isSHWAreaGross,			imp5.isSHWAreaGross);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","Gross Area", SHWApertureArea,	base.SHWApertureArea,						  imp1.SHWApertureArea,			imp2.SHWApertureArea,			  imp3.SHWApertureArea,			imp4.SHWApertureArea,				imp5.SHWApertureArea);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n","ZL Collector Eff", SHW_ZLCE,	base.SHW_ZLCE,					  imp1.SHW_ZLCE,				imp2.SHW_ZLCE,				  imp3.SHW_ZLCE,				imp4.SHW_ZLCE,					imp5.SHW_ZLCE);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n","HL Coefficient", SHW_HeatLossCoefficient,base.SHW_HeatLossCoefficient,		  imp1.SHW_HeatLossCoefficient, imp2.SHW_HeatLossCoefficient, imp3.SHW_HeatLossCoefficient, imp4.SHW_HeatLossCoefficient,	imp5.SHW_HeatLossCoefficient);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Is Solar StoreCombined",   isSHWSolarStoreCombined,base.isSHWSolarStoreCombined,			  imp1.isSHWSolarStoreCombined, imp2.isSHWSolarStoreCombined, imp3.isSHWSolarStoreCombined, imp4.isSHWSolarStoreCombined,   imp5.isSHWSolarStoreCombined);
	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n","Dedicated Solar Store Volume", SHWDedSolStoreVol,base.SHWDedSolStoreVol, imp1.SHWDedSolStoreVol,		imp2.SHWDedSolStoreVol,		  imp3.SHWDedSolStoreVol,		imp4.SHWDedSolStoreVol,			imp5.SHWDedSolStoreVol);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Solar Circulating Pump",   SHWSolarCircPump,	base.SHWSolarCircPump,				  imp1.SHWSolarCircPump,		imp2.SHWSolarCircPump,		  imp3.SHWSolarCircPump,		imp4.SHWSolarCircPump,			imp5.SHWSolarCircPump);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Is PV Present",  isPVPresent, base.isPVPresent,								  imp1.isPVPresent,				imp2.isPVPresent,			  imp3.isPVPresent,				imp4.isPVPresent,				imp5.isPVPresent);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","Installed Peak Power", installedPVPeakPower,base.installedPVPeakPower,	  imp1.installedPVPeakPower,	imp2.installedPVPeakPower,    imp3.installedPVPeakPower,	imp4.installedPVPeakPower,		imp5.installedPVPeakPower);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Collector Orientation",   PVCollectorOrientation,base.PVCollectorOrientation,			  imp1.PVCollectorOrientation,  imp2.PVCollectorOrientation,  imp3.PVCollectorOrientation,  imp4.PVCollectorOrientation,    imp5.PVCollectorOrientation);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Collector Tilt",  PVCollectorTilt,	 base.PVCollectorTilt,							  imp1.PVCollectorTilt,			imp2.PVCollectorTilt,         imp3.PVCollectorTilt,			imp4.PVCollectorTilt,			imp5.PVCollectorTilt);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Overshading",  PVOvershading, base.PVOvershading,								  imp1.PVOvershading,			imp2.PVOvershading,           imp3.PVOvershading,			imp4.PVOvershading,				imp5.PVOvershading);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n","Is WT Present",   isWTPresent,base.isWTPresent,								  imp1.isWTPresent,				imp2.isWTPresent,			  imp3.isWTPresent,				imp4.isWTPresent,				imp5.isWTPresent);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n","Num Of WTs",   WTNumOf,base.WTNumOf,										  imp1.WTNumOf,					imp2.WTNumOf,				  imp3.WTNumOf,					imp4.WTNumOf,					imp5.WTNumOf);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","Diameter", WTDiameter,base.WTDiameter,							  imp1.WTDiameter,				imp2.WTDiameter,			  imp3.WTDiameter,				imp4.WTDiameter,				imp5.WTDiameter);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n","Height", WTHeight,	base.WTHeight,								  imp1.WTHeight,				imp2.WTHeight,				  imp3.WTHeight,				imp4.WTHeight,					imp5.WTHeight);

	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Is uHydro  present", uHydroyn,	base.uHydroyn,							      imp1.uHydroyn,				imp2.uHydroyn,				  imp3.uHydroyn,				imp4.uHydroyn,					imp5.uHydroyn);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "uHydro AnnualAvg Head", uHydroAnnualAvgHead, base.uHydroAnnualAvgHead,     imp1.uHydroAnnualAvgHead,		imp2.uHydroAnnualAvgHead,	  imp3.uHydroAnnualAvgHead,		imp4.uHydroAnnualAvgHead,		imp5.uHydroAnnualAvgHead);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Annual Avg Flow",uHydroAnnualAvgFlow,	base.uHydroAnnualAvgFlow,		      imp1.uHydroAnnualAvgFlow,		imp2.uHydroAnnualAvgFlow,     imp3.uHydroAnnualAvgFlow,		imp4.uHydroAnnualAvgFlow,		imp5.uHydroAnnualAvgFlow);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Efficiency",uHydroEff,	base.uHydroEff,						      imp1.uHydroEff,uHydroEff,		imp2.uHydroEff,               imp3.uHydroEff,				imp4.uHydroEff,					imp5.uHydroEff);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Is CHP  present", uCHPyn,base.uCHPyn,								      imp1.uCHPyn,					imp2.uCHPyn,				  imp3.uCHPyn,					imp4.uCHPyn,					imp5.uCHPyn);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "CHP Heat To Power Ratio",uCHPheatToPowerRatio, base.uCHPheatToPowerRatio,   imp1.uCHPheatToPowerRatio,	imp2.uCHPheatToPowerRatio,	  imp3.uCHPheatToPowerRatio,	imp4.uCHPheatToPowerRatio,		imp5.uCHPheatToPowerRatio);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Electric Efficiency",uCHPElectricEff,	base.uCHPElectricEff,		      imp1.uCHPElectricEff,			imp2.uCHPElectricEff,		  imp3.uCHPElectricEff,			imp4.uCHPElectricEff,			imp5.uCHPElectricEff);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",	"Fuel",CHPFuel,	base.CHPFuel,											  imp1.CHPFuel,					imp2.CHPFuel,				  imp3.CHPFuel,					imp4.CHPFuel,					imp5.CHPFuel);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Heating Efficiency",uCHPHeatingEff,base.uCHPHeatingEff,			  imp1.uCHPHeatingEff,			imp2.uCHPHeatingEff,		  imp3.uCHPHeatingEff,			imp4.uCHPHeatingEff,			imp5.uCHPHeatingEff);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Heating Fraction",uCHPHeatingFraction,base.uCHPHeatingFraction,		      imp1.uCHPHeatingFraction,		imp2.uCHPHeatingFraction,	  imp3.uCHPHeatingFraction,		imp4.uCHPHeatingFraction,		imp5.uCHPHeatingFraction);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Is MVHR  present", MVHRyn,base.MVHRyn,								      imp1.MVHRyn,					imp2.MVHRyn,				  imp3.MVHRyn,					imp4.MVHRyn,					imp5.MVHRyn);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "MVHR Thermal Efficiency",MVHRThermalEff,	base.MVHRThermalEff,	      imp1.MVHRThermalEff,			imp2.MVHRThermalEff,	      imp3.MVHRThermalEff,			imp4.MVHRThermalEff,			imp5.MVHRThermalEff);

	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Is WWHRS present"                       , WWHRSpresent           , base.WWHRSpresent          , imp1.WWHRSpresent          , imp2.WWHRSpresent          , imp3.WWHRSpresent          , imp4.WWHRSpresent           , imp5.WWHRSpresent);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Number of rooms with bath and or shower", WWHRSnumOfRooms        , base.WWHRSnumOfRooms       , imp1.WWHRSnumOfRooms       , imp2.WWHRSnumOfRooms       , imp3.WWHRSnumOfRooms       , imp4.WWHRSnumOfRooms        , imp5.WWHRSnumOfRooms);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Make"                                   , WWHRS1Make              , base.WWHRS1Make            , imp1.WWHRS1Make            , imp2.WWHRS1Make            , imp3.WWHRS1Make            , imp4.WWHRS1Make             , imp5.WWHRS1Make);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Model"                                  , WWHRS1Model             , base.WWHRS1Model       , imp1.WWHRS1Model       , imp2.WWHRS1Model       , imp3.WWHRS1Model       , imp4.WWHRS1Model        , imp5.WWHRS1Model);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Model qualifier"                        , WWHRS1ModelQualifier        , base.WWHRS1ModelQualifier       , imp1.WWHRS1ModelQualifier       , imp2.WWHRS1ModelQualifier       , imp3.WWHRS1ModelQualifier       , imp4.WWHRS1ModelQualifier        , imp5.WWHRS1ModelQualifier);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Number of mixer showers with bath"      , WWHRSnumMixerShowersWithBath1    , base.WWHRSnumMixerShowersWithBath1    , imp1.WWHRSnumMixerShowersWithBath1    , imp2.WWHRSnumMixerShowersWithBath1    , imp3.WWHRSnumMixerShowersWithBath1    , imp4.WWHRSnumMixerShowersWithBath1    , imp5.WWHRSnumMixerShowersWithBath1);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Number of mixer showers without bath"   , WWHRSnumMixerShowersWithoutBath1 , base.WWHRSnumMixerShowersWithoutBath1 , imp1.WWHRSnumMixerShowersWithoutBath1 , imp2.WWHRSnumMixerShowersWithoutBath1 , imp3.WWHRSnumMixerShowersWithoutBath1 , imp4.WWHRSnumMixerShowersWithoutBath1 , imp5.WWHRSnumMixerShowersWithoutBath1);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Make"                                   , WWHRS2Make              , base.WWHRS2Make            , imp1.WWHRS2Make            , imp2.WWHRS2Make            , imp3.WWHRS2Make            , imp4.WWHRS2Make             , imp5.WWHRS2Make);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Model"                                  , WWHRS2Model             , base.WWHRS2Model       , imp1.WWHRS2Model       , imp2.WWHRS2Model       , imp3.WWHRS2Model       , imp4.WWHRS2Model        , imp5.WWHRS2Model);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Model qualifier"                        , WWHRS2ModelQualifier        , base.WWHRS2ModelQualifier       , imp1.WWHRS2ModelQualifier       , imp2.WWHRS2ModelQualifier       , imp3.WWHRS2ModelQualifier       , imp4.WWHRS2ModelQualifier        , imp5.WWHRS2ModelQualifier);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Number of mixer showers with bath"      , WWHRSnumMixerShowersWithBath2    , base.WWHRSnumMixerShowersWithBath2    , imp1.WWHRSnumMixerShowersWithBath2    , imp2.WWHRSnumMixerShowersWithBath2    , imp3.WWHRSnumMixerShowersWithBath2    , imp4.WWHRSnumMixerShowersWithBath2    , imp5.WWHRSnumMixerShowersWithBath2);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Number of mixer showers without bath"   , WWHRSnumMixerShowersWithoutBath2 , base.WWHRSnumMixerShowersWithoutBath2 , imp1.WWHRSnumMixerShowersWithoutBath2 , imp2.WWHRSnumMixerShowersWithoutBath2 , imp3.WWHRSnumMixerShowersWithoutBath2 , imp4.WWHRSnumMixerShowersWithoutBath2 , imp5.WWHRSnumMixerShowersWithoutBath2);

	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "FGHRS",                            FGHRSpresent           , base.FGHRSpresent          , imp1.FGHRSpresent          , imp2.FGHRSpresent          , imp3.FGHRSpresent          , imp4.FGHRSpresent           , imp5.FGHRSpresent);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "Is store present",                 FGHRSstore           , base.FGHRSstore          , imp1.FGHRSstore          , imp2.FGHRSstore          , imp3.FGHRSstore          , imp4.FGHRSstore           , imp5.FGHRSstore);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Store Volume",                     FGHRSstoreVolume     , base.FGHRSstoreVolume    , imp1.FGHRSstoreVolume    , imp2.FGHRSstoreVolume    , imp3.FGHRSstoreVolume    , imp4.FGHRSstoreVolume     , imp5.FGHRSstoreVolume);
	fprintf(fptr,"%s,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f\n", "Useful Fracion of Heat Recovered", FGHRSusefulFracHtRec_kf1 , base.FGHRSusefulFracHtRec_kf1, imp1.FGHRSusefulFracHtRec_kf1, imp2.FGHRSusefulFracHtRec_kf1, imp3.FGHRSusefulFracHtRec_kf1, imp4.FGHRSusefulFracHtRec_kf1 , imp5.FGHRSusefulFracHtRec_kf1);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "Fitted to Main Heating",           FGHRSfittedMain      , base.FGHRSfittedMain     , imp1.FGHRSfittedMain	   , imp2.FGHRSfittedMain     , imp3.FGHRSfittedMain     , imp4.FGHRSfittedMain      , imp5.FGHRSfittedMain);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "Fitted to Secondary Heating",      FGHRSfittedSec       , base.FGHRSfittedSec      , imp1.FGHRSfittedSec      , imp2.FGHRSfittedSec      , imp3.FGHRSfittedSec      , imp4.FGHRSfittedSec       , imp5.FGHRSfittedSec);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "Type",                             FGHRStype            , base.FGHRStype           , imp1.FGHRStype           , imp2.FGHRStype           , imp3.FGHRStype           , imp4.FGHRStype            , imp5.FGHRStype);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "Type",                             determineFGHRStype   , base.determineFGHRStype  , imp1.determineFGHRStype  , imp2.determineFGHRStype  , imp3.determineFGHRStype  , imp4.determineFGHRStype   , imp5.determineFGHRStype);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Total Fractin of Heat Recovered",  FGHRStotFracHeatRec_kf2  , base.FGHRStotFracHeatRec_kf2 , imp1.FGHRStotFracHeatRec_kf2 , imp2.FGHRStotFracHeatRec_kf2 , imp3.FGHRStotFracHeatRec_kf2 , imp4.FGHRStotFracHeatRec_kf2  , imp5.FGHRStotFracHeatRec_kf2);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Electric Power Requirement",       FGHRSauxelec   , base.FGHRSauxelec  , imp1.FGHRSauxelec  , imp2.FGHRSauxelec  , imp3.FGHRSauxelec  , imp4.FGHRSauxelec   , imp5.FGHRSauxelec);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "Is there PV Powered Heating",      FGHRSpvPoweredHt     , base.FGHRSpvPoweredHt    , imp1.FGHRSpvPoweredHt    , imp2.FGHRSpvPoweredHt    , imp3.FGHRSpvPoweredHt    , imp4.FGHRSpvPoweredHt     , imp5.FGHRSpvPoweredHt);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "PV Peak Power",                    FGHRSpvPkPower       , base.FGHRSpvPkPower      , imp1.FGHRSpvPkPower      , imp2.FGHRSpvPkPower      , imp3.FGHRSpvPkPower      , imp4.FGHRSpvPkPower       , imp5.FGHRSpvPkPower);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "PV Orientation",                   FGHRSpvOrientation , base.FGHRSpvOrientation, imp1.FGHRSpvOrientation, imp2.FGHRSpvOrientation, imp3.FGHRSpvOrientation, imp4.FGHRSpvOrientation , imp5.FGHRSpvOrientation);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "PV Tilt",                          FGHRSpvTilt          , base.FGHRSpvTilt         , imp1.FGHRSpvTilt         , imp2.FGHRSpvTilt         , imp3.FGHRSpvTilt         , imp4.FGHRSpvTilt          , imp5.FGHRSpvTilt);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n",               "PV Overshading",                   FGHRSpvOvershading   , base.FGHRSpvOvershading  , imp1.FGHRSpvOvershading  , imp2.FGHRSpvOvershading  , imp3.FGHRSpvOvershading  , imp4.FGHRSpvOvershading   , imp5.FGHRSpvOvershading);
	fprintf(fptr,"%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f\n", "Cable Loss",                       FGHRScableLoss       , base.FGHRScableLoss      , imp1.FGHRScableLoss      , imp2.FGHRScableLoss      , imp3.FGHRScableLoss      , imp4.FGHRScableLoss       , imp5.FGHRScableLoss);
		
	//------------------------------------------
	// HEM DIALOG INPUTS
	//------------------------------------------
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "House type",hemHouseType,base.hemHouseType,							imp1.hemHouseType,				imp2.hemHouseType,				imp3.hemHouseType,				imp4.hemHouseType,				imp5.hemHouseType);
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s,%s\n", "Year Of Build",hemYearOfBuild,base.hemYearOfBuild,						imp1.hemYearOfBuild,			imp2.hemYearOfBuild,			imp3.hemYearOfBuild,			imp4.hemYearOfBuild,			imp5.hemYearOfBuild);

	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Insulation input",chkInsulation,base.chkInsulation,					imp1.chkInsulation,				imp2.chkInsulation,				imp3.chkInsulation,				imp4.chkInsulation,				imp5.chkInsulation);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Slider Position",hemI_insulationSliderPos,	base.hemI_insulationSliderPos,			imp1.hemI_insulationSliderPos,	imp2.hemI_insulationSliderPos,	imp3.hemI_insulationSliderPos,  imp4.hemI_insulationSliderPos,  imp5.hemI_insulationSliderPos);

	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Air change input",chkAirtightness,base.chkAirtightness,					imp1.chkAirtightness,			imp2.chkAirtightness,			imp3.chkAirtightness,			imp4.chkAirtightness,			imp5.chkAirtightness);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Slider Position",hemA_achSliderPos,	base.hemA_achSliderPos,					imp1.hemA_achSliderPos,			imp2.hemA_achSliderPos,			imp3.hemA_achSliderPos,			imp4.hemA_achSliderPos,			imp5.hemA_achSliderPos);
	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Capacity input",chkCapacity,base.chkCapacity,						imp1.chkCapacity,				imp2.chkCapacity,				imp3.chkCapacity,				imp4.chkCapacity,				imp5.chkCapacity);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Slider Position",hemC_capacitySliderPos,base.hemC_capacitySliderPos,			imp1.hemC_capacitySliderPos,	imp2.hemC_capacitySliderPos,    imp3.hemC_capacitySliderPos,	imp4.hemC_capacitySliderPos,	imp5.hemC_capacitySliderPos);
	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "SolarIngress input",chkSolarIngress,base.chkSolarIngress,				imp1.chkSolarIngress,			imp2.chkSolarIngress,			imp3.chkSolarIngress,			imp4.chkSolarIngress,			imp5.chkSolarIngress);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Slider Position",hemS_solarGainsSliderPos,	base.hemS_solarGainsSliderPos,			imp1.hemS_solarGainsSliderPos,	imp2.hemS_solarGainsSliderPos,  imp3.hemS_solarGainsSliderPos,	imp4.hemS_solarGainsSliderPos,	imp5.hemS_solarGainsSliderPos);

	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Occupancy input",chkOccupancy,base.chkOccupancy,						imp1.chkOccupancy,				imp2.chkOccupancy,				imp3.chkOccupancy,				imp4.chkOccupancy,				imp5.chkOccupancy);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Slider Position",hemO_OCCDensitySliderPos,	base.hemO_OCCDensitySliderPos,		    imp1.hemO_OCCDensitySliderPos,  imp2.hemO_OCCDensitySliderPos,	imp3.hemO_OCCDensitySliderPos,	imp4.hemO_OCCDensitySliderPos,	imp5.hemO_OCCDensitySliderPos);

	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "ControlledSpace input",chkControlledSpace,base.chkControlledSpace,			imp1.chkControlledSpace,		imp2.chkControlledSpace,		imp3.chkControlledSpace,		imp4.chkControlledSpace,		imp5.chkControlledSpace);
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "Slider Position",hemL_LAFracSliderPos,	base.hemL_LAFracSliderPos,				imp1.hemL_LAFracSliderPos,		imp2.hemL_LAFracSliderPos,		imp3.hemL_LAFracSliderPos,		imp4.hemL_LAFracSliderPos,		imp5.hemL_LAFracSliderPos);

	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "SDHW input",chkSDHW,base.chkSDHW,	imp1.chkSDHW,	imp2.chkSDHW,	imp3.chkSDHW,	imp4.chkSDHW,	imp5.chkSDHW);	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "PV input",chkPV,base.chkPV,		imp1.chkPV,		imp2.chkPV,		imp3.chkPV,		imp4.chkPV,		imp5.chkPV);	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "WT input",chkWT,base.chkWT,		imp1.chkWT,		imp2.chkWT,		imp3.chkWT,		imp4.chkWT,		imp5.chkWT);	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "CHP input",chkuCHP,	base.chkuCHP,		imp1.chkuCHP,	imp2.chkuCHP,	imp3.chkuCHP,	imp4.chkuCHP,	imp5.chkuCHP);	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "uHydro input",chkuHydro,base.chkuHydro,imp1.chkuHydro, imp2.chkuHydro,	imp3.chkuHydro,	imp4.chkuHydro,	imp5.chkuHydro);	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "PCM input",chkPCM,base.chkPCM,		imp1.chkPCM,	imp2.chkPCM,	imp3.chkPCM,	imp4.chkPCM,	imp5.chkPCM);	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "MVHR input",chkMVHR,base.chkMVHR,	imp1.chkMVHR,	imp2.chkMVHR,	imp3.chkMVHR,	imp4.chkMVHR,	imp5.chkMVHR);	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "FGHRS input",chkFGHRS,base.chkFGHRS,	imp1.chkFGHRS,	imp2.chkFGHRS,	imp3.chkFGHRS,	imp4.chkFGHRS,	imp5.chkFGHRS);	
	fprintf(fptr,"%s,%d,%d,%d,%d,%d,%d,%d\n", "WWHRS input",chkWWHRS,base.chkWWHRS,	imp1.chkWWHRS,	imp2.chkWWHRS,	imp3.chkWWHRS,	imp4.chkWWHRS,	imp5.chkWWHRS);	

	fclose(fptr);
}

//----------------------------------------------------------------------------------------
// This function will be used to overcome the problem of strtok() while reading csv file
// strtok() ignores two consecutive tokens(comma in this case)
// The function will look for two consecutive commas and insert space character
// to avoid any errors
//----------------------------------------------------------------------------------------
static void insertSpaceInDoubleCommas(char *srcStr, char *destStr, int sizeOfDestStrBuff)
{
	int count = 0;
	while ( (*srcStr != NULL) && (count < (sizeOfDestStrBuff - 3)))
	{
		*destStr = *srcStr;
		srcStr++;
		destStr++;
		count++;

		if ( (*srcStr == ',') && (*(srcStr-1) == ',') )
		{
			*destStr = ' ';
			destStr++;
			count++;
		}
	}
	*destStr = NULL;
}

void CSAPP1Dlg::DeleteUntitledTab()
{
	TCITEM tcItem;
	CString pszString;
	int numCurTabItem = 0;

	numCurTabItem = m_tabCtrlProjects.GetCurSel();

	//  Get text for the tab item.
	GetDlgItemText(IDC_TAB2, pszString);

	//  Get the current tab item text.
	char buffer[5000] = {0};
	tcItem.pszText = buffer;
	tcItem.cchTextMax = 256;
	tcItem.mask = TCIF_TEXT;
	m_tabCtrlProjects.GetItem(numCurTabItem, &tcItem);

	//------------------------------------------------
	// If opened tab is untitled, delete it
	//------------------------------------------------
	// Read title of selected tab
	//------------------------------------------------
	if(strcmp(tcItem.pszText,"Untitled")==0)				
	{
		if(is_save_dialg_called == true)
		{
			is_save_dialg_called = false;

			//  Set the new text for the item.
			strcpy(tcItem.pszText,projectFileNameNoExt);

			//  Set the item in the tab control.
			m_tabCtrlProjects.SetItem(numCurTabItem, &tcItem);

			// Now add this ne info to vector
	
		}
		else
		{
			m_tabCtrlProjects.DeleteItem(numCurTabItem);
		}
	}
}


void CSAPP1Dlg::OnFileOpen()
{
	unsigned int sizeuu = 0;
	unsigned int vectorSize = 0;
	CString tempString;
	projectFileNamesInTabs tempEntry;
	estateFileNameVector tempFileEntry;
	is_results_values_read_first_time = false;

	//--------------------------------------------------------------------
	// Enable all these falgs so all sliders etc are updated properly
	enable_user_to_change_tab = true;

	//--------------------------------------------------------------------
	// Open dialog to read the project name
	CFileDialog m_idFile( true, "proj", NULL, OFN_HIDEREADONLY, // false to open
		"Project files (*.csv)|*.csv|*.csv|", AfxGetMainWnd());
	m_idFile.m_ofn.lpstrInitialDir = "..\\projects"; // default directory os one step up the executable

	// If user choses to Open File..
	if (m_idFile.DoModal()==IDOK)
	{
		CString strPathName = m_idFile.GetPathName();
		projectFileName     = m_idFile.GetPathName();// GetFileName();
		projectFileNameNoPath = m_idFile.GetFileName();

		//-------------------------------------------------------------------------
		// Save name of project files in array, to be disppalyed in Add to Estate doalog
		tempEntry.nameWithPath = projectFileName;
		tempEntry.nameNoPath   = projectFileNameNoPath;
		projectFileNamesInTabs_1.push_back(tempEntry);

		AfxExtractSubString(projectFileNameNoExt, projectFileNameNoPath, 0, '.'); 

		// Check file name database to see if file is already open, if so return from function
		for( vectorSize=0; vectorSize < estateFileNameVector1.size(); vectorSize++)
		{
			if(strcmp(projectFileName,estateFileNameVector1[vectorSize].fileName)==0)
			{
				MessageBox( "Cannot reopen a file!", "Error",  MB_OK);
				return;									
			}		
		}

		//------------------------------------------------
		// If opened tab is untitled, delete it
		//------------------------------------------------
		// Read title of selected tab
		//------------------------------------------------
		DeleteUntitledTab();

		// Open saved project
		OpenProjectFile();	
		}
		else
		{
			return;
		}	

	titleBarText = versionText + " " + "-" + " " + projectFileNameNoExt;
	SetWindowText(titleBarText);
}

void CSAPP1Dlg::OnClickProjectsTab(NMHDR *pNMHDR, LRESULT *pResult)
{
	CString tempString1;
	unsigned int vectorSize = 0;
	int curTabNumber = 0;

	do_not_populate_vector_while_changing_tabs = true;

	lastTabNumber;

	TCITEM tcItem;
	CString pszString;

	//------------------------------------------------
	//  Get text for the tab item
	GetDlgItemText(IDC_TAB2, pszString);

	//------------------------------------------------
	//  Get the last tab item text and
	// display warning message if its untitled
	char buffer[5000] = {0};
	tcItem.pszText = buffer;
	tcItem.cchTextMax = 256;
	tcItem.mask = TCIF_TEXT;
	m_tabCtrlProjects.GetItem(lastTabNumber, &tcItem);

	//------------------------------------------------
	if(strcmp(tcItem.pszText,"Untitled")==0)				
	{
		MessageBox("Information will be lost if you navigate from this page.\n    Please save project before you proceed.", "Warning", MB_OK);
	}

	//------------------------------------------------------------
	// Set flag to true, will be used in file OpenProjectFile function
	//------------------------------------------------------------
	is_file_opened_if_changing_tabs = true;

	curTabNumber = m_tabCtrlProjects.GetCurSel();
	m_tabCtrlProjects.GetItem(curTabNumber, &tcItem);
	
	vectorSize = projectInfo.size();

	for(vectorSize = 0; vectorSize < projectInfo.size(); vectorSize++)
	{
		if(strcmp(tcItem.pszText,projectInfo[vectorSize].projectFileNameNoExt)==0)				
		{
			tempString1           = projectInfo[vectorSize].projectFileNameNoPath;
			projectFileName       = projectInfo[vectorSize].projectFileName;
			projectFileNameNoPath = projectInfo[vectorSize].projectFileNameNoPath;
			projectFileNameNoExt  = projectInfo[vectorSize].projectFileNameNoExt;

			titleBarText = versionText + " " + "-" + " " + projectFileNameNoExt;
			SetWindowText(titleBarText);
			break;
		}
	}	

	//------------------------------------------------------------
	// Read file name for associated tab
	// Read data for file
	// Populate ALL dialog boxes with this info
	// Recraete dialogs and display by using OpenProjectFile()
	//------------------------------------------------------------
	OpenProjectFile();		

	*pResult = 0;
}

void OpenProjectFile_2()
{
	//--------------------------------------------
	// Clear vector before writing data
	stringsWithValues.clear();

	FILE *fptr;
	char tempStr[1000];
	char tempStr2[1000];
	char *pError;
	char *pch;
	LineEntryInfo tempCBoxEntry;
	bool isOk = TRUE;
	int linesRead = 0;
	CString tempString;
	unsigned int vectorSize = 0;
	CString tempString1;
	estateFileNameVector tempEntry;
	
	//------------------------------------------------
	// Set different flags
	is_file_opened    = true;  
	file_new_selected = false;
	is_base_selected  = false;
	is_imp1_selected  = false;
	is_imp2_selected  = false;
	is_imp3_selected  = false;
	is_imp4_selected  = false;
	is_imp5_selected  = false;

	is_base_saved = false;
	is_imp1_saved = false;
	is_imp2_saved = false;
	is_imp3_saved = false;
	is_imp4_saved = false;
	is_imp5_saved = false;

	is_climate_changed_from_results    = true;
	is_house_type_changed_from_results = true;
	is_year_of_build_changed           = true;
	enable_user_to_change_tab          = true;
	is_ins_slider_moved_due_to_house_type_change = false;
	is_ins_slider_moved_due_to_year_bilud_change = true;
	
	char text[500];

	//--------------------------------------------------------------------------
	// If file opened while changing tabs do not display error message
	if(do_not_populate_vector_while_changing_tabs == true)
	{
		; // do nothing
	}
	else
	{
		for( vectorSize=0; vectorSize < estateFileNameVector1.size(); vectorSize++)
		{
			if(strcmp(projectFileName,estateFileNameVector1[vectorSize].fileName)==0)
			{
				MessageBox(NULL, "Cannot reopen a file!", "Error",  MB_OK);
				return;									
			}	
		}
	}

	//--------------------------------------------------------------------------	
	// Open the file
	fptr = fopen(projectFileName,"r");
	sprintf(text,"Error opening file: %s", projectFileName);

	//--------------------------------------------------------------------------
	// Display error message and return if file not found
	if (fptr == NULL)
	{
		MessageBox( NULL, text, "Error", MB_OK);
		fileFound = 0;		
		return;
	}

	//--------------------------------------------------------------------------
	// If file opened while chaning tabs do not populate vecot again with file name
	if(do_not_populate_vector_while_changing_tabs == true)
	{
		do_not_populate_vector_while_changing_tabs = false;
	}
	else
	{
		// Add project file name to a vector 
		// This will be used to avoid reopening of project file
		tempEntry.fileName = projectFileName;
		estateFileNameVector1.push_back(tempEntry);
	}
	
	fileFound = 1; //this varible will be used to create new tab

	// Keep on reading (and proessing) each line from the CSV file
	// until reached end of file OR some error occured	
	while (TRUE)
	{
		// Read a line from a CSV file
		pError = fgets(tempStr2,1000,fptr);
		insertSpaceInDoubleCommas ( tempStr2, tempStr, 1000 ); // Call this function to avoid strtok() error for consecutives delimiters

		linesRead ++;

		// if reached end of file
		if(pError == NULL)
		{	
			break;
		}

		if(linesRead>1) // Skip first line for headings
		{
#if TRUE
			if(linesRead == 290)
			{	
				linesRead = linesRead * 1;				
			}
#endif
			//--------------------------------------------------------------------
			// A.	Read the "entry label" for the combo box
			pch = strtok (tempStr, ",");

			// If some error has occured
			if (pch == NULL)
			{
				isOk = FALSE;
				MessageBox( NULL, text, "Error", MB_OK);
				fileFound = 0;
				return;
			}
			strcpy(tempCBoxEntry.entryLabel,pch);

			//--------------------------------------------------------------------
			// 1.	Read the "entry string" for this base
			pch = strtok (NULL, ",");

			// If some error has occured
			if (pch == NULL)
			{
				//isOk = FALSE;
				//break;
				isOk = FALSE;
				MessageBox( NULL, text, "Error", MB_OK);
				fileFound = 0;
				return;
			}
			strcpy(tempCBoxEntry.entryString,pch );

			//--------------------------------------------------------------------
			// 1.	Read the "entry string" for this base
			pch = strtok (NULL, ",");

			// If some error has occured
			if (pch == NULL)
			{
				isOk = FALSE;
				MessageBox( NULL, text, "Error", MB_OK);
                fileFound = 0;
				return;
			}
			strcpy(tempCBoxEntry.entryStringBase,pch );
			
			//--------------------------------------------------------------------
			// 2.	Read the string for improvement1
			pch = strtok (NULL, ",");

			// If some error has occured
			if (pch == NULL)
			{
				isOk = FALSE;
				MessageBox( NULL, text, "Error", MB_OK);
				fileFound = 0;
				return;
			}
			strcpy(tempCBoxEntry.entryStringImp1,pch );
			
			// If have read end-of-line character, replace it with null
			if (tempCBoxEntry.entryStringImp1[strlen(pch)-1] == 0x0A)
			{
				tempCBoxEntry.entryStringImp1[strlen(pch)-1] = 0;
			}

			//--------------------------------------------------------------------
			// 3.	Read the string for improvement2
			pch = strtok (NULL, ",");

			// If some error has occured
			if (pch == NULL)
			{
				isOk = FALSE;
				MessageBox( NULL, text, "Error", MB_OK);
				fileFound = 0;
				return;
			}
			strcpy(tempCBoxEntry.entryStringImp2,pch );

			
			// If have read end-of-line character, replace it with null
			if (tempCBoxEntry.entryStringImp2[strlen(pch)-1] == 0x0A)
			{
				tempCBoxEntry.entryStringImp2[strlen(pch)-1] = 0;
			}

			//--------------------------------------------------------------------
			// 4.	Read the string for improvement3
			pch = strtok (NULL, ",");

			// If some error has occured
			if (pch == NULL)
			{
				isOk = FALSE;
				MessageBox( NULL, text, "Error", MB_OK);
				fileFound = 0;
				return;
			}
			strcpy(tempCBoxEntry.entryStringImp3,pch );			

			// If have read end-of-line character, replace it with null
			if (tempCBoxEntry.entryStringImp3[strlen(pch)-1] == 0x0A)
			{
				tempCBoxEntry.entryStringImp3[strlen(pch)-1] = 0;
			}

			//--------------------------------------------------------------------
			// 5.	Read the string for improvement3
			pch = strtok (NULL, ",");

			// If some error has occured
			if (pch == NULL)
			{
				isOk = FALSE;
				MessageBox( NULL, text, "Error", MB_OK);
				fileFound = 0;
				return;
			}
			strcpy(tempCBoxEntry.entryStringImp4,pch );			

			// If have read end-of-line character, replace it with null
			if (tempCBoxEntry.entryStringImp4[strlen(pch)-1] == 0x0A)
			{
				tempCBoxEntry.entryStringImp4[strlen(pch)-1] = 0;
			}

			//--------------------------------------------------------------------
			// 6.	Read the string for improvement3
			pch = strtok (NULL, ",");

			// If some error has occured
			if (pch == NULL)
			{
				isOk = FALSE;
				MessageBox( NULL, text, "Error", MB_OK);
				fileFound = 0;
				return;
			}
			strcpy(tempCBoxEntry.entryStringImp5,pch );			

			// If have read end-of-line character, replace it with null
			if (tempCBoxEntry.entryStringImp5[strlen(pch)-1] == 0x0A)
			{
				tempCBoxEntry.entryStringImp5[strlen(pch)-1] = 0;
			}

			//--------------------------------------------------------------------
			// Enter this information in the vector
			stringsWithValues.push_back(tempCBoxEntry);
		}
	}
	
	//--------------------------------------------------  
	// Close the CSV file
	fclose(fptr);

	if (isOk == FALSE)
	{
		fileFound = 0;
	}

	int i = 0;
	unsigned int sizeee = 0;
	sizeee = stringsWithValues.size();

	//------------------------------------------------------
	// JOB DETAILS
	//------------------------------------------------------
	baseSelected = atoi(stringsWithValues[i].entryString);
    baseSelected = atoi(stringsWithValues[i].entryStringBase);
    imp1Selected = atoi(stringsWithValues[i].entryStringImp1);
    imp2Selected = atoi(stringsWithValues[i].entryStringImp2);
    imp3Selected = atoi(stringsWithValues[i].entryStringImp3);
    imp4Selected = atoi(stringsWithValues[i].entryStringImp4);
    imp5Selected = atoi(stringsWithValues[i++].entryStringImp5);

	JobDetRefNum = stringsWithValues[i].entryString;
	base.JobDetRefNum = stringsWithValues[i].entryStringBase;
	imp1.JobDetRefNum = stringsWithValues[i].entryStringImp1;
	imp2.JobDetRefNum = stringsWithValues[i].entryStringImp2;
	imp3.JobDetRefNum = stringsWithValues[i].entryStringImp3;
	imp4.JobDetRefNum = stringsWithValues[i].entryStringImp4;
	imp5.JobDetRefNum = stringsWithValues[i++].entryStringImp5;
	
	assessorName = stringsWithValues[i].entryString;
	base.assessorName = stringsWithValues[i].entryStringBase;
	imp1.assessorName = stringsWithValues[i].entryStringImp1;
	imp2.assessorName = stringsWithValues[i].entryStringImp2;
	imp3.assessorName = stringsWithValues[i].entryStringImp3;
	imp4.assessorName = stringsWithValues[i].entryStringImp4;
	imp5.assessorName = stringsWithValues[i++].entryStringImp5;

	JobDetComments = stringsWithValues[i].entryString;
	base.JobDetComments = stringsWithValues[i].entryStringBase;
	imp1.JobDetComments = stringsWithValues[i].entryStringImp1;
	imp2.JobDetComments = stringsWithValues[i].entryStringImp2;
	imp3.JobDetComments = stringsWithValues[i].entryStringImp3;
	imp4.JobDetComments = stringsWithValues[i].entryStringImp4;
	imp5.JobDetComments = stringsWithValues[i++].entryStringImp5;

	propertyFlatNameorNum = stringsWithValues[i].entryString;
	base.propertyFlatNameorNum = stringsWithValues[i].entryStringBase;
	imp1.propertyFlatNameorNum = stringsWithValues[i].entryStringImp1;
	imp2.propertyFlatNameorNum = stringsWithValues[i].entryStringImp2;
	imp3.propertyFlatNameorNum = stringsWithValues[i].entryStringImp3;
	imp4.propertyFlatNameorNum = stringsWithValues[i].entryStringImp4;
	imp5.propertyFlatNameorNum = stringsWithValues[i++].entryStringImp5;

	propertyLetter  = stringsWithValues[i].entryString;
	base.propertyLetter  = stringsWithValues[i].entryStringBase;
	imp1.propertyLetter  = stringsWithValues[i].entryStringImp1;
	imp2.propertyLetter  = stringsWithValues[i].entryStringImp2;
	imp3.propertyLetter  = stringsWithValues[i].entryStringImp3;
	imp4.propertyLetter  = stringsWithValues[i].entryStringImp4;
	imp5.propertyLetter  = stringsWithValues[i++].entryStringImp5;

	propertyHouseNum= stringsWithValues[i].entryString;
	base.propertyHouseNum= stringsWithValues[i].entryStringBase;
	imp1.propertyHouseNum= stringsWithValues[i].entryStringImp1;
	imp2.propertyHouseNum= stringsWithValues[i].entryStringImp2;
	imp3.propertyHouseNum= stringsWithValues[i].entryStringImp3;
	imp4.propertyHouseNum= stringsWithValues[i].entryStringImp4;
	imp5.propertyHouseNum= stringsWithValues[i++].entryStringImp5;

	propertyStreet  = stringsWithValues[i].entryString;
	base.propertyStreet  = stringsWithValues[i].entryStringBase;
	imp1.propertyStreet  = stringsWithValues[i].entryStringImp1;
	imp2.propertyStreet  = stringsWithValues[i].entryStringImp2;
	imp3.propertyStreet  = stringsWithValues[i].entryStringImp3;
	imp1.propertyStreet  = stringsWithValues[i].entryStringImp4;
	imp5.propertyStreet  = stringsWithValues[i++].entryStringImp5;

	propertyLocality= stringsWithValues[i].entryString;
	base.propertyLocality= stringsWithValues[i].entryStringBase;
	imp1.propertyLocality= stringsWithValues[i].entryStringImp1;
	imp2.propertyLocality= stringsWithValues[i].entryStringImp2;
	imp3.propertyLocality= stringsWithValues[i].entryStringImp3;
	imp4.propertyLocality= stringsWithValues[i].entryStringImp4;
	imp5.propertyLocality= stringsWithValues[i++].entryStringImp5;

	propertyDistrict= stringsWithValues[i].entryString;
	base.propertyDistrict= stringsWithValues[i].entryStringBase;
	imp1.propertyDistrict= stringsWithValues[i].entryStringImp1;
	imp2.propertyDistrict= stringsWithValues[i].entryStringImp2;
	imp3.propertyDistrict= stringsWithValues[i].entryStringImp3;
	imp4.propertyDistrict= stringsWithValues[i].entryStringImp4;
	imp5.propertyDistrict= stringsWithValues[i++].entryStringImp5;

	propertyTown    = stringsWithValues[i].entryString;
	base.propertyTown    = stringsWithValues[i].entryStringBase;
	imp1.propertyTown    = stringsWithValues[i].entryStringImp1;
	imp2.propertyTown    = stringsWithValues[i].entryStringImp2;
	imp3.propertyTown    = stringsWithValues[i].entryStringImp3;
	imp4.propertyTown    = stringsWithValues[i].entryStringImp4;
	imp5.propertyTown    = stringsWithValues[i++].entryStringImp5;

	propertyCounty  = stringsWithValues[i].entryString;
	base.propertyCounty  = stringsWithValues[i].entryStringBase;
	imp1.propertyCounty  = stringsWithValues[i].entryStringImp1;
	imp2.propertyCounty  = stringsWithValues[i].entryStringImp2;
	imp3.propertyCounty  = stringsWithValues[i].entryStringImp3;
	imp4.propertyCounty  = stringsWithValues[i].entryStringImp4;
	imp5.propertyCounty  = stringsWithValues[i++].entryStringImp5;

	propertyPostCode= stringsWithValues[i].entryString;
	base.propertyPostCode= stringsWithValues[i].entryStringBase;
	imp1.propertyPostCode= stringsWithValues[i].entryStringImp1;
	imp2.propertyPostCode= stringsWithValues[i].entryStringImp2;
	imp3.propertyPostCode= stringsWithValues[i].entryStringImp3;
	imp4.propertyPostCode= stringsWithValues[i].entryStringImp4;
	imp5.propertyPostCode= stringsWithValues[i++].entryStringImp5;

	clientFlatNameorNum = stringsWithValues[i].entryString;
	base.clientFlatNameorNum = stringsWithValues[i].entryStringBase;
	imp1.clientFlatNameorNum = stringsWithValues[i].entryStringImp1;
	imp2.clientFlatNameorNum = stringsWithValues[i].entryStringImp2;
	imp3.clientFlatNameorNum = stringsWithValues[i].entryStringImp3;
	imp4.clientFlatNameorNum = stringsWithValues[i].entryStringImp4;
	imp5.clientFlatNameorNum = stringsWithValues[i++].entryStringImp5;

	clientHouseorBlockNum = stringsWithValues[i].entryString;
	base.clientHouseorBlockNum = stringsWithValues[i].entryStringBase;
	imp1.clientHouseorBlockNum = stringsWithValues[i].entryStringImp1;
	imp2.clientHouseorBlockNum = stringsWithValues[i].entryStringImp2;
	imp3.clientHouseorBlockNum = stringsWithValues[i].entryStringImp3;
	imp4.clientHouseorBlockNum = stringsWithValues[i].entryStringImp4;
	imp5.clientHouseorBlockNum = stringsWithValues[i++].entryStringImp5;

	clientLetter = stringsWithValues[i].entryString;
	base.clientLetter = stringsWithValues[i].entryStringBase;
	imp1.clientLetter = stringsWithValues[i].entryStringImp1;
	imp2.clientLetter = stringsWithValues[i].entryStringImp2;
	imp3.clientLetter = stringsWithValues[i].entryStringImp3;
	imp4.clientLetter = stringsWithValues[i].entryStringImp4;
	imp5.clientLetter = stringsWithValues[i++].entryStringImp5;

	clientStreet = stringsWithValues[i].entryString;
	base.clientStreet = stringsWithValues[i].entryStringBase;
	imp1.clientStreet = stringsWithValues[i].entryStringImp1;
	imp2.clientStreet = stringsWithValues[i].entryStringImp2;
	imp3.clientStreet = stringsWithValues[i].entryStringImp3;
	imp4.clientStreet = stringsWithValues[i].entryStringImp4;
	imp5.clientStreet = stringsWithValues[i++].entryStringImp5;

	clientLocality = stringsWithValues[i].entryString;
	base.clientLocality = stringsWithValues[i].entryStringBase;
	imp1.clientLocality = stringsWithValues[i].entryStringImp1;
	imp2.clientLocality = stringsWithValues[i].entryStringImp2;
	imp3.clientLocality = stringsWithValues[i].entryStringImp3;
	imp4.clientLocality = stringsWithValues[i].entryStringImp4;
	imp5.clientLocality = stringsWithValues[i++].entryStringImp5;

	clientDistrict = stringsWithValues[i].entryString;
	base.clientDistrict = stringsWithValues[i].entryStringBase;
	imp1.clientDistrict = stringsWithValues[i].entryStringImp1;
	imp2.clientDistrict = stringsWithValues[i].entryStringImp2;
	imp3.clientDistrict = stringsWithValues[i].entryStringImp3;
	imp4.clientDistrict = stringsWithValues[i].entryStringImp4;
	imp5.clientDistrict = stringsWithValues[i++].entryStringImp5;

	clientTown     = stringsWithValues[i].entryString;
	base.clientTown     = stringsWithValues[i].entryStringBase;
	imp1.clientTown     = stringsWithValues[i].entryStringImp1;
	imp2.clientTown     = stringsWithValues[i].entryStringImp2;
	imp3.clientTown     = stringsWithValues[i].entryStringImp3;
	imp4.clientTown     = stringsWithValues[i].entryStringImp4;
	imp5.clientTown     = stringsWithValues[i++].entryStringImp5;

	clientCounty   = stringsWithValues[i].entryString;
	base.clientCounty   = stringsWithValues[i].entryStringBase;
	imp1.clientCounty   = stringsWithValues[i].entryStringImp1;
	imp2.clientCounty   = stringsWithValues[i].entryStringImp2;
	imp3.clientCounty   = stringsWithValues[i].entryStringImp3;
	imp4.clientCounty   = stringsWithValues[i].entryStringImp4;
	imp5.clientCounty   = stringsWithValues[i++].entryStringImp5;

	clientPostCode = stringsWithValues[i].entryString;
	base.clientPostCode = stringsWithValues[i].entryStringBase;
	imp1.clientPostCode = stringsWithValues[i].entryStringImp1;
	imp2.clientPostCode = stringsWithValues[i].entryStringImp2;
	imp3.clientPostCode = stringsWithValues[i].entryStringImp3;
	imp4.clientPostCode = stringsWithValues[i].entryStringImp4;
	imp5.clientPostCode = stringsWithValues[i++].entryStringImp5;


	//------------------------------------------------------
	// BUILT FORM
	//------------------------------------------------------
	dwellingType	  = stringsWithValues[i].entryString;
	base.dwellingType = stringsWithValues[i].entryStringBase;
	imp1.dwellingType = stringsWithValues[i].entryStringImp1;
	imp2.dwellingType = stringsWithValues[i].entryStringImp2;
	imp3.dwellingType = stringsWithValues[i].entryStringImp3;
	imp4.dwellingType = stringsWithValues[i].entryStringImp4;
	imp5.dwellingType = stringsWithValues[i++].entryStringImp5;

	builtForm	  = stringsWithValues[i].entryString;
	base.builtForm = stringsWithValues[i].entryStringBase;
	imp1.builtForm = stringsWithValues[i].entryStringImp1;
	imp2.builtForm = stringsWithValues[i].entryStringImp2;
	imp3.builtForm = stringsWithValues[i].entryStringImp3;
	imp4.builtForm = stringsWithValues[i].entryStringImp4;
	imp5.builtForm = stringsWithValues[i++].entryStringImp5;

	Detachment	   = stringsWithValues[i].entryString;
	base.Detachment = stringsWithValues[i].entryStringBase;
	imp1.Detachment = stringsWithValues[i].entryStringImp1;
	imp2.Detachment = stringsWithValues[i].entryStringImp2;
	imp3.Detachment = stringsWithValues[i].entryStringImp3;
	imp4.Detachment = stringsWithValues[i].entryStringImp4;
	imp5.Detachment = stringsWithValues[i++].entryStringImp5;
	
	FlatPosition      = stringsWithValues[i].entryString;
	base.FlatPosition = stringsWithValues[i].entryStringBase;
	imp1.FlatPosition = stringsWithValues[i].entryStringImp1;
	imp2.FlatPosition = stringsWithValues[i].entryStringImp2;
	imp3.FlatPosition = stringsWithValues[i].entryStringImp3;
	imp4.FlatPosition = stringsWithValues[i].entryStringImp4;
	imp5.FlatPosition = stringsWithValues[i++].entryStringImp5;

	yearPropertBuilt      = stringsWithValues[i].entryString;
	base.yearPropertBuilt = stringsWithValues[i].entryStringBase;
	imp1.yearPropertBuilt = stringsWithValues[i].entryStringImp1;
	imp2.yearPropertBuilt = stringsWithValues[i].entryStringImp2;
	imp3.yearPropertBuilt = stringsWithValues[i].entryStringImp3;
	imp4.yearPropertBuilt = stringsWithValues[i].entryStringImp4;
	imp5.yearPropertBuilt = stringsWithValues[i++].entryStringImp5;
	
	locationString      = stringsWithValues[i].entryString;
	base.locationString = stringsWithValues[i].entryStringBase;
	imp1.locationString = stringsWithValues[i].entryStringImp1;
	imp2.locationString = stringsWithValues[i].entryStringImp2;
	imp3.locationString = stringsWithValues[i].entryStringImp3;
	imp4.locationString = stringsWithValues[i].entryStringImp4;
	imp5.locationString = stringsWithValues[i++].entryStringImp5;

    dwellingShelteredSides      = atoi(stringsWithValues[i].entryString);
	base.dwellingShelteredSides = atoi(stringsWithValues[i].entryStringBase);
	imp1.dwellingShelteredSides = atoi(stringsWithValues[i].entryStringImp1);
	imp2.dwellingShelteredSides = atoi(stringsWithValues[i].entryStringImp2);
	imp3.dwellingShelteredSides = atoi(stringsWithValues[i].entryStringImp3);
	imp4.dwellingShelteredSides = atoi(stringsWithValues[i].entryStringImp4);
	imp5.dwellingShelteredSides = atoi(stringsWithValues[i++].entryStringImp5);

	dwellingTerrain      = stringsWithValues[i].entryString;
	base.dwellingTerrain = stringsWithValues[i].entryStringBase;
	imp1.dwellingTerrain = stringsWithValues[i].entryStringImp1;
	imp2.dwellingTerrain = stringsWithValues[i].entryStringImp2;
	imp3.dwellingTerrain = stringsWithValues[i].entryStringImp3;
	imp4.dwellingTerrain = stringsWithValues[i].entryStringImp4;
	imp5.dwellingTerrain = stringsWithValues[i++].entryStringImp5;
	
	dwellingExposure      = stringsWithValues[i].entryString;
	base.dwellingExposure = stringsWithValues[i].entryStringBase;
	imp1.dwellingExposure = stringsWithValues[i].entryStringImp1;
	imp2.dwellingExposure = stringsWithValues[i].entryStringImp2;
	imp3.dwellingExposure = stringsWithValues[i].entryStringImp3;
	imp4.dwellingExposure = stringsWithValues[i].entryStringImp4;
	imp5.dwellingExposure = stringsWithValues[i++].entryStringImp5;

	storey1           =  stringsWithValues[i].entryString;
	base.storey1      = stringsWithValues[i].entryStringBase;
	imp1.storey1      =  stringsWithValues[i].entryStringImp1;
	imp2.storey1      =  stringsWithValues[i].entryStringImp2;
	imp3.storey1      =  stringsWithValues[i].entryStringImp3;
	imp4.storey1      =  stringsWithValues[i].entryStringImp4;
	imp5.storey1      =  stringsWithValues[i++].entryStringImp5;

	storey1Level = stringsWithValues[i].entryString;
	base.storey1Level = stringsWithValues[i].entryStringBase;
	imp1.storey1Level = stringsWithValues[i].entryStringImp1;
	imp2.storey1Level = stringsWithValues[i].entryStringImp2;
	imp3.storey1Level = stringsWithValues[i].entryStringImp3;
	imp4.storey1Level = stringsWithValues[i].entryStringImp4;
	imp5.storey1Level = stringsWithValues[i++].entryStringImp5;

	storey1Basement = stringsWithValues[i].entryString;
	base.storey1Basement = stringsWithValues[i].entryStringBase;
	imp1.storey1Basement = stringsWithValues[i].entryStringImp1;
	imp2.storey1Basement = stringsWithValues[i].entryStringImp2;
	imp3.storey1Basement = stringsWithValues[i].entryStringImp3;
	imp4.storey1Basement = stringsWithValues[i].entryStringImp4;
	imp5.storey1Basement = stringsWithValues[i++].entryStringImp5;

	storey1Area			= atof(stringsWithValues[i].entryString);
	base.storey1Area     = atof(stringsWithValues[i].entryStringBase);
	imp1.storey1Area     = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey1Area     = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey1Area     = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey1Area     = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey1Area     = atof(stringsWithValues[i++].entryStringImp5);

	storey1Height   = atof(stringsWithValues[i].entryString);
	base.storey1Height   = atof(stringsWithValues[i].entryStringBase);
	imp1.storey1Height   = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey1Height   = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey1Height   = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey1Height   = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey1Height   = atof(stringsWithValues[i++].entryStringImp5);

	storey2      = stringsWithValues[i].entryString;
	base.storey2 = stringsWithValues[i].entryStringBase;
	imp1.storey2 = stringsWithValues[i].entryStringImp1;
	imp2.storey2 = stringsWithValues[i].entryStringImp2;
	imp3.storey2 = stringsWithValues[i].entryStringImp3;
	imp4.storey2 = stringsWithValues[i].entryStringImp4;
	imp5.storey2 = stringsWithValues[i++].entryStringImp5;

	storey2Level = stringsWithValues[i].entryString;
	base.storey2Level = stringsWithValues[i].entryStringBase;
	imp1.storey2Level = stringsWithValues[i].entryStringImp1;
	imp2.storey2Level = stringsWithValues[i].entryStringImp2;
	imp3.storey2Level = stringsWithValues[i].entryStringImp3;
	imp4.storey2Level = stringsWithValues[i].entryStringImp4;
	imp5.storey2Level = stringsWithValues[i++].entryStringImp5;

	storey2Basement = stringsWithValues[i].entryString;
	base.storey2Basement = stringsWithValues[i].entryStringBase;
	imp1.storey2Basement = stringsWithValues[i].entryStringImp1;
	imp2.storey2Basement = stringsWithValues[i].entryStringImp2;
	imp3.storey2Basement = stringsWithValues[i].entryStringImp3;
	imp4.storey2Basement = stringsWithValues[i].entryStringImp4;
	imp5.storey2Basement = stringsWithValues[i++].entryStringImp5;

	storey2Area          = atof(stringsWithValues[i].entryString);
	base.storey2Area     = atof(stringsWithValues[i].entryStringBase);
	imp1.storey2Area     = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey2Area     = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey2Area     = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey2Area     = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey2Area     = atof(stringsWithValues[i++].entryStringImp5);
	
	storey2Height        = atof(stringsWithValues[i].entryString);
	base.storey2Height   = atof(stringsWithValues[i].entryStringBase);
	imp1.storey2Height   = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey2Height   = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey2Height   = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey2Height   = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey2Height   = atof(stringsWithValues[i++].entryStringImp5);

	storey3      = stringsWithValues[i].entryString;
	base.storey3 = stringsWithValues[i].entryStringBase;
	imp1.storey3      = stringsWithValues[i].entryStringImp1;
	imp2.storey3      = stringsWithValues[i].entryStringImp2;
	imp3.storey3      = stringsWithValues[i].entryStringImp3;
	imp4.storey3      = stringsWithValues[i].entryStringImp4;
	imp5.storey3      = stringsWithValues[i++].entryStringImp5;

	storey3Level = stringsWithValues[i].entryString;
	base.storey3Level = stringsWithValues[i].entryStringBase;
	imp1.storey3Level = stringsWithValues[i].entryStringImp1;
	imp2.storey3Level = stringsWithValues[i].entryStringImp2;
	imp3.storey3Level = stringsWithValues[i].entryStringImp3;
	imp4.storey3Level = stringsWithValues[i].entryStringImp4;
	imp5.storey3Level = stringsWithValues[i++].entryStringImp5;

	storey3Basement = stringsWithValues[i].entryString;
	base.storey3Basement = stringsWithValues[i].entryStringBase;
	imp1.storey3Basement = stringsWithValues[i].entryStringImp1;
	imp2.storey3Basement = stringsWithValues[i].entryStringImp2;
	imp3.storey3Basement = stringsWithValues[i].entryStringImp3;
	imp4.storey3Basement = stringsWithValues[i].entryStringImp4;
	imp5.storey3Basement = stringsWithValues[i++].entryStringImp5;

	storey3Area     = atof(stringsWithValues[i].entryString);
	base.storey3Area = atof(stringsWithValues[i].entryStringBase);
	imp1.storey3Area     = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey3Area     = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey3Area     = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey3Area     = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey3Area     = atof(stringsWithValues[i++].entryStringImp5);

	storey3Height   = atof(stringsWithValues[i].entryString);
	base.storey3Height = atof(stringsWithValues[i].entryStringBase);
	imp1.storey3Height   = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey3Height   = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey3Height   = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey3Height   = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey3Height   = atof(stringsWithValues[i++].entryStringImp5);

	storey4      = stringsWithValues[i].entryString;
	base.storey4 = stringsWithValues[i].entryStringBase;
	imp1.storey4      = stringsWithValues[i].entryStringImp1;
	imp2.storey4      = stringsWithValues[i].entryStringImp2;
	imp3.storey4      = stringsWithValues[i].entryStringImp3;
	imp4.storey4      = stringsWithValues[i].entryStringImp4;
	imp5.storey4      = stringsWithValues[i++].entryStringImp5;

	storey4Level = stringsWithValues[i].entryString;
	base.storey4Level = stringsWithValues[i].entryStringBase;
	imp1.storey4Level = stringsWithValues[i].entryStringImp1;
	imp2.storey4Level = stringsWithValues[i].entryStringImp2;
	imp3.storey4Level = stringsWithValues[i].entryStringImp3;
	imp4.storey4Level = stringsWithValues[i].entryStringImp4;
	imp5.storey4Level = stringsWithValues[i++].entryStringImp5;

	storey4Basement = stringsWithValues[i].entryString;
	base.storey4Basement = stringsWithValues[i].entryStringBase;
	imp1.storey4Basement = stringsWithValues[i].entryStringImp1;
	imp2.storey4Basement = stringsWithValues[i].entryStringImp2;
	imp3.storey4Basement = stringsWithValues[i].entryStringImp3;
	imp4.storey4Basement = stringsWithValues[i].entryStringImp4;
	imp5.storey4Basement = stringsWithValues[i++].entryStringImp5;

	storey4Area      = atof(stringsWithValues[i].entryString);
	base.storey4Area = atof(stringsWithValues[i].entryStringBase);
	imp1.storey4Area = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey4Area = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey4Area = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey4Area = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey4Area = atof(stringsWithValues[i++].entryStringImp5);

	storey4Height      = atof(stringsWithValues[i].entryString);
	base.storey4Height = atof(stringsWithValues[i].entryStringBase);
	imp1.storey4Height = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey4Height = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey4Height = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey4Height = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey4Height = atof(stringsWithValues[i++].entryStringImp5);

	storey5			   = stringsWithValues[i].entryString;
	base.storey5	   = stringsWithValues[i].entryStringBase;
	imp1.storey5       = stringsWithValues[i].entryStringImp1;
	imp2.storey5       = stringsWithValues[i].entryStringImp2;
	imp3.storey5       = stringsWithValues[i].entryStringImp3;
	imp4.storey5       = stringsWithValues[i].entryStringImp4;
	imp5.storey5       = stringsWithValues[i++].entryStringImp5;

	storey5Level = stringsWithValues[i].entryString;
	base.dwellingType = stringsWithValues[i].entryStringBase;
	imp1.storey5Level = stringsWithValues[i].entryStringImp1;
	imp2.storey5Level = stringsWithValues[i].entryStringImp2;
	imp3.storey5Level = stringsWithValues[i].entryStringImp3;
	imp4.storey5Level = stringsWithValues[i].entryStringImp4;
	imp5.storey5Level = stringsWithValues[i++].entryStringImp5;

	storey5Basement = stringsWithValues[i].entryString;
	base.storey5Basement = stringsWithValues[i].entryStringBase;
	imp1.storey5Basement = stringsWithValues[i].entryStringImp1;
	imp2.storey5Basement = stringsWithValues[i].entryStringImp2;
	imp3.storey5Basement = stringsWithValues[i].entryStringImp3;
	imp4.storey5Basement = stringsWithValues[i].entryStringImp4;
	imp5.storey5Basement = stringsWithValues[i++].entryStringImp5;

	storey5Area     = atof(stringsWithValues[i].entryString);
	base.storey5Area    = atof(stringsWithValues[i].entryStringBase);
	imp1.storey5Area     = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey5Area     = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey5Area     = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey5Area     = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey5Area     = atof(stringsWithValues[i++].entryStringImp5);

	storey5Height		 = atof(stringsWithValues[i].entryString);
	base.storey5Height   = atof( stringsWithValues[i].entryStringBase);
	imp1.storey5Height   = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey5Height   = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey5Height   = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey5Height   = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey5Height   = atof(stringsWithValues[i++].entryStringImp5);

	storey6              = stringsWithValues[i].entryString;
	base.storey6         = stringsWithValues[i].entryStringBase;
	imp1.storey6         = stringsWithValues[i].entryStringImp1;
	imp2.storey6         = stringsWithValues[i].entryStringImp2;
	imp3.storey6         = stringsWithValues[i].entryStringImp3;
	imp4.storey6         = stringsWithValues[i].entryStringImp4;
	imp5.storey6         = stringsWithValues[i++].entryStringImp5;

	storey6Level		  = stringsWithValues[i].entryString;
	base.storey6Level    = stringsWithValues[i].entryStringBase;
	imp1.storey6Level    = stringsWithValues[i].entryStringImp1;
	imp2.storey6Level    = stringsWithValues[i].entryStringImp2;
	imp3.storey6Level    = stringsWithValues[i].entryStringImp3;
	imp4.storey6Level    = stringsWithValues[i].entryStringImp4;
	imp5.storey6Level    = stringsWithValues[i++].entryStringImp5;

	storey6Basement		 = stringsWithValues[i].entryString;
	base.storey6Basement = stringsWithValues[i].entryStringBase;
	imp1.storey6Basement = stringsWithValues[i].entryStringImp1;
	imp2.storey6Basement = stringsWithValues[i].entryStringImp2;
	imp3.storey6Basement = stringsWithValues[i].entryStringImp3;
	imp4.storey6Basement = stringsWithValues[i].entryStringImp4;
	imp5.storey6Basement = stringsWithValues[i++].entryStringImp5;

	storey6Area			 = atof(stringsWithValues[i].entryString);
	base.storey6Area	 = atof(stringsWithValues[i].entryStringBase);
	imp1.storey6Area     = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey6Area     = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey6Area     = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey6Area     = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey6Area     = atof(stringsWithValues[i++].entryStringImp5);

	storey6Height		 = atof(stringsWithValues[i].entryString);
	base.storey6Height	 = atof(stringsWithValues[i].entryStringBase);
	imp1.storey6Height   = atof(stringsWithValues[i].entryStringImp1);
	imp2.storey6Height   = atof(stringsWithValues[i].entryStringImp2);
	imp3.storey6Height   = atof(stringsWithValues[i].entryStringImp3);
	imp4.storey6Height   = atof(stringsWithValues[i].entryStringImp4);
	imp5.storey6Height   = atof(stringsWithValues[i++].entryStringImp5);

	TFAfromHEM		= atof(stringsWithValues[i].entryString);
	base.TFAfromHEM = atof(stringsWithValues[i].entryStringBase);
	imp1.TFAfromHEM = atof(stringsWithValues[i].entryStringImp1);
	imp2.TFAfromHEM = atof(stringsWithValues[i].entryStringImp2);
	imp3.TFAfromHEM = atof(stringsWithValues[i].entryStringImp3);
	imp4.TFAfromHEM = atof(stringsWithValues[i].entryStringImp4);
	imp5.TFAfromHEM = atof(stringsWithValues[i++].entryStringImp5);

	//----------------------------------------------------------------------
	// WINDOWS
	//----------------------------------------------------------------------
	// North window
	winNArea= atof(stringsWithValues[i].entryString);
	base.winNArea= atof(stringsWithValues[i].entryStringBase);
	imp1.winNArea= atof(stringsWithValues[i].entryStringImp1);
	imp2.winNArea= atof(stringsWithValues[i].entryStringImp2);
	imp3.winNArea= atof(stringsWithValues[i].entryStringImp3);
	imp4.winNArea= atof(stringsWithValues[i].entryStringImp4);
	imp5.winNArea= atof(stringsWithValues[i++].entryStringImp5);

	winNSolTrans= atof(stringsWithValues[i].entryString);
    base.winNSolTrans= atof(stringsWithValues[i].entryStringBase);
	imp1.winNSolTrans= atof(stringsWithValues[i].entryStringImp1);
	imp2.winNSolTrans= atof(stringsWithValues[i].entryStringImp2);
	imp3.winNSolTrans= atof(stringsWithValues[i].entryStringImp3);
	imp4.winNSolTrans= atof(stringsWithValues[i].entryStringImp4);
	imp5.winNSolTrans= atof(stringsWithValues[i++].entryStringImp5);

	winNFrameFactor= atof(stringsWithValues[i].entryString);
	base.winNFrameFactor= atof(stringsWithValues[i].entryStringBase);
	imp1.winNFrameFactor= atof(stringsWithValues[i].entryStringImp1);
	imp2.winNFrameFactor= atof(stringsWithValues[i].entryStringImp2);
	imp3.winNFrameFactor= atof(stringsWithValues[i].entryStringImp3);
	imp4.winNFrameFactor= atof(stringsWithValues[i].entryStringImp4);
	imp5.winNFrameFactor= atof(stringsWithValues[i++].entryStringImp5);

	// North East window
	winNEArea= atof(stringsWithValues[i].entryString);
	base.winNEArea= atof(stringsWithValues[i].entryStringBase);
	imp1.winNEArea= atof(stringsWithValues[i].entryStringImp1);
	imp2.winNEArea= atof(stringsWithValues[i].entryStringImp2);
	imp3.winNEArea= atof(stringsWithValues[i].entryStringImp3);
	imp4.winNEArea= atof(stringsWithValues[i].entryStringImp4);
	imp5.winNEArea= atof(stringsWithValues[i++].entryStringImp5);

	winNESolTrans= atof(stringsWithValues[i].entryString);
	base.winNESolTrans= atof(stringsWithValues[i].entryStringBase);
	imp1.winNESolTrans= atof(stringsWithValues[i].entryStringImp1);
	imp2.winNESolTrans= atof(stringsWithValues[i].entryStringImp2);
	imp3.winNESolTrans= atof(stringsWithValues[i].entryStringImp3);
	imp4.winNESolTrans= atof(stringsWithValues[i].entryStringImp4);
	imp5.winNESolTrans= atof(stringsWithValues[i++].entryStringImp5);

	winNEFrameFactor =  atof(stringsWithValues[i].entryString);
	base.winNEFrameFactor =  atof(stringsWithValues[i].entryStringBase);
	imp1.winNEFrameFactor =  atof(stringsWithValues[i].entryStringImp1);
	imp2.winNEFrameFactor =  atof(stringsWithValues[i].entryStringImp2);
	imp3.winNEFrameFactor =  atof(stringsWithValues[i].entryStringImp3);
	imp4.winNEFrameFactor =  atof(stringsWithValues[i].entryStringImp4);
	imp5.winNEFrameFactor =  atof(stringsWithValues[i++].entryStringImp5);

	// East window
	winEArea= atof(stringsWithValues[i].entryString);
	base.winEArea= atof(stringsWithValues[i].entryStringBase);
	imp1.winEArea= atof(stringsWithValues[i].entryStringImp1);
	imp2.winEArea= atof(stringsWithValues[i].entryStringImp2);
	imp3.winEArea= atof(stringsWithValues[i].entryStringImp3);
	imp4.winEArea= atof(stringsWithValues[i].entryStringImp4);
	imp5.winEArea= atof(stringsWithValues[i++].entryStringImp5);

	winESolTrans= atof(stringsWithValues[i].entryString);
    base.winESolTrans= atof(stringsWithValues[i].entryStringBase);
	imp1.winESolTrans= atof(stringsWithValues[i].entryStringImp1);
	imp2.winESolTrans= atof(stringsWithValues[i].entryStringImp2);
	imp3.winESolTrans= atof(stringsWithValues[i].entryStringImp3);
	imp4.winESolTrans= atof(stringsWithValues[i].entryStringImp4);
	imp5.winESolTrans= atof(stringsWithValues[i++].entryStringImp5);

	winEFrameFactor= atof(stringsWithValues[i].entryString);
	base.winEFrameFactor= atof(stringsWithValues[i].entryStringBase);
	imp1.winEFrameFactor= atof(stringsWithValues[i].entryStringImp1);
	imp2.winEFrameFactor= atof(stringsWithValues[i].entryStringImp2);
	imp3.winEFrameFactor= atof(stringsWithValues[i].entryStringImp3);
	imp4.winEFrameFactor= atof(stringsWithValues[i].entryStringImp4);
	imp5.winEFrameFactor= atof(stringsWithValues[i++].entryStringImp5);

	// South East window
	winSEArea= atof(stringsWithValues[i].entryString);
	base.winSEArea= atof(stringsWithValues[i].entryStringBase);
	imp1.winSEArea= atof(stringsWithValues[i].entryStringImp1);
	imp2.winSEArea= atof(stringsWithValues[i].entryStringImp2);
	imp3.winSEArea= atof(stringsWithValues[i].entryStringImp3);
	imp4.winSEArea= atof(stringsWithValues[i].entryStringImp4);
	imp5.winSEArea= atof(stringsWithValues[i++].entryStringImp5);

	winSESolTrans= atof(stringsWithValues[i].entryString);
	base.winSESolTrans= atof(stringsWithValues[i].entryStringBase);
	imp1.winSESolTrans= atof(stringsWithValues[i].entryStringImp1);
	imp2.winSESolTrans= atof(stringsWithValues[i].entryStringImp2);
	imp3.winSESolTrans= atof(stringsWithValues[i].entryStringImp3);
	imp4.winSESolTrans= atof(stringsWithValues[i].entryStringImp4);
    imp5.winSESolTrans= atof(stringsWithValues[i++].entryStringImp5);

	winSEFrameFactor= atof(stringsWithValues[i].entryString);
	base.winSEFrameFactor= atof(stringsWithValues[i].entryStringBase);
	imp1.winSEFrameFactor= atof(stringsWithValues[i].entryStringImp1);
	imp2.winSEFrameFactor= atof(stringsWithValues[i].entryStringImp2);
	imp3.winSEFrameFactor= atof(stringsWithValues[i].entryStringImp3);
	imp4.winSEFrameFactor= atof(stringsWithValues[i].entryStringImp4);
	imp5.winSEFrameFactor= atof(stringsWithValues[i++].entryStringImp5);

	// South window
	winSArea= atof(stringsWithValues[i].entryString);
	base.winSArea= atof(stringsWithValues[i].entryStringBase);
	imp1.winSArea= atof(stringsWithValues[i].entryStringImp1);
	imp2.winSArea= atof(stringsWithValues[i].entryStringImp2);
	imp3.winSArea= atof(stringsWithValues[i].entryStringImp3);
	imp4.winSArea= atof(stringsWithValues[i].entryStringImp4);
	imp5.winSArea= atof(stringsWithValues[i++].entryStringImp5);
    
	winSSolTrans= atof(stringsWithValues[i].entryString);
	base.winSSolTrans= atof(stringsWithValues[i].entryStringBase);
	imp1.winSSolTrans= atof(stringsWithValues[i].entryStringImp1);
	imp2.winSSolTrans= atof(stringsWithValues[i].entryStringImp2);
	imp3.winSSolTrans= atof(stringsWithValues[i].entryStringImp3);
	imp4.winSSolTrans= atof(stringsWithValues[i].entryStringImp4);
	imp5.winSSolTrans= atof(stringsWithValues[i++].entryStringImp5);

	winSFrameFactor= atof(stringsWithValues[i].entryString);
	base.winSFrameFactor= atof(stringsWithValues[i].entryStringBase);
	imp1.winSFrameFactor= atof(stringsWithValues[i].entryStringImp1);
	imp2.winSFrameFactor= atof(stringsWithValues[i].entryStringImp2);
	imp3.winSFrameFactor= atof(stringsWithValues[i].entryStringImp3);
	imp4.winSFrameFactor= atof(stringsWithValues[i].entryStringImp4);
	imp5.winSFrameFactor= atof(stringsWithValues[i++].entryStringImp5);

	// South west window
	winSWArea= atof(stringsWithValues[i].entryString);
	base.winSWArea= atof(stringsWithValues[i].entryStringBase);
	imp1.winSWArea= atof(stringsWithValues[i].entryStringImp1);
	imp2.winSWArea= atof(stringsWithValues[i].entryStringImp2);
	imp3.winSWArea= atof(stringsWithValues[i].entryStringImp3);
	imp4.winSWArea= atof(stringsWithValues[i].entryStringImp4);
	imp5.winSWArea= atof(stringsWithValues[i++].entryStringImp5);
	
	winSWSolTrans= atof(stringsWithValues[i].entryString);
	base.winSWSolTrans= atof(stringsWithValues[i].entryStringBase);
	imp1.winSWSolTrans= atof(stringsWithValues[i].entryStringImp1);
	imp2.winSWSolTrans= atof(stringsWithValues[i].entryStringImp2);
	imp3.winSWSolTrans= atof(stringsWithValues[i].entryStringImp3);
	imp4.winSWSolTrans= atof(stringsWithValues[i].entryStringImp4);
    imp5.winSWSolTrans= atof(stringsWithValues[i++].entryStringImp5);

	winSWFrameFactor= atof(stringsWithValues[i].entryString);
	base.winSWFrameFactor= atof(stringsWithValues[i].entryStringBase);
	imp1.winSWFrameFactor= atof(stringsWithValues[i].entryStringImp1);
	imp2.winSWFrameFactor= atof(stringsWithValues[i].entryStringImp2);
	imp3.winSWFrameFactor= atof(stringsWithValues[i].entryStringImp3);
	imp4.winSWFrameFactor= atof(stringsWithValues[i].entryStringImp4);
	imp5.winSWFrameFactor= atof(stringsWithValues[i++].entryStringImp5);

	// West window
	winWArea= atof(stringsWithValues[i].entryString);
	base.winWArea= atof(stringsWithValues[i].entryStringBase);
	imp1.winWArea= atof(stringsWithValues[i].entryStringImp1);
	imp2.winWArea= atof(stringsWithValues[i].entryStringImp2);
	imp3.winWArea= atof(stringsWithValues[i].entryStringImp3);
	imp4.winWArea= atof(stringsWithValues[i].entryStringImp4);
	imp5.winWArea= atof(stringsWithValues[i++].entryStringImp5);

	winWSolTrans= atof(stringsWithValues[i].entryString);
	base.winWSolTrans= atof(stringsWithValues[i].entryStringBase);
	imp1.winWSolTrans= atof(stringsWithValues[i].entryStringImp1);
	imp2.winWSolTrans= atof(stringsWithValues[i].entryStringImp2);
	imp3.winWSolTrans= atof(stringsWithValues[i].entryStringImp3);
	imp4.winWSolTrans= atof(stringsWithValues[i].entryStringImp4);
    imp5.winWSolTrans= atof(stringsWithValues[i++].entryStringImp5);

	winWFrameFactor= atof(stringsWithValues[i].entryString);
	base.winWFrameFactor= atof(stringsWithValues[i].entryStringBase);
	imp1.winWFrameFactor= atof(stringsWithValues[i].entryStringImp1);
	imp2.winWFrameFactor= atof(stringsWithValues[i].entryStringImp2);
	imp3.winWFrameFactor= atof(stringsWithValues[i].entryStringImp3);
	imp4.winWFrameFactor= atof(stringsWithValues[i].entryStringImp4);
	imp5.winWFrameFactor= atof(stringsWithValues[i++].entryStringImp5);

	// North West window
	winNWArea= atof(stringsWithValues[i].entryString);
	base.winNWArea= atof(stringsWithValues[i].entryStringBase);
	imp1.winNWArea= atof(stringsWithValues[i].entryStringImp1);
	imp2.winNWArea= atof(stringsWithValues[i].entryStringImp2);
	imp3.winNWArea= atof(stringsWithValues[i].entryStringImp3);
	imp4.winNWArea= atof(stringsWithValues[i].entryStringImp4);
	imp5.winNWArea= atof(stringsWithValues[i++].entryStringImp5);

	winNWSolTrans= atof(stringsWithValues[i].entryString);
	base.winNWSolTrans= atof(stringsWithValues[i].entryStringBase);
	imp1.winNWSolTrans= atof(stringsWithValues[i].entryStringImp1);
	imp2.winNWSolTrans= atof(stringsWithValues[i].entryStringImp2);
	imp3.winNWSolTrans= atof(stringsWithValues[i].entryStringImp3);
	imp4.winNWSolTrans= atof(stringsWithValues[i].entryStringImp4);
    imp5.winNWSolTrans= atof(stringsWithValues[i++].entryStringImp5);

	winNWFrameFactor= atof(stringsWithValues[i].entryString);
	base.winNWFrameFactor= atof(stringsWithValues[i].entryStringBase);
	imp1.winNWFrameFactor= atof(stringsWithValues[i].entryStringImp1);
	imp2.winNWFrameFactor= atof(stringsWithValues[i].entryStringImp2);
	imp3.winNWFrameFactor= atof(stringsWithValues[i].entryStringImp3);
	imp4.winNWFrameFactor= atof(stringsWithValues[i].entryStringImp4);
    imp5.winNWFrameFactor= atof(stringsWithValues[i++].entryStringImp5);

	// Roof lights
	rooflightsArea= atof(stringsWithValues[i].entryString);
	base.rooflightsArea= atof(stringsWithValues[i].entryStringBase);
	imp1.rooflightsArea= atof(stringsWithValues[i].entryStringImp1);
	imp2.rooflightsArea= atof(stringsWithValues[i].entryStringImp2);
	imp3.rooflightsArea= atof(stringsWithValues[i].entryStringImp3);
	imp4.rooflightsArea= atof(stringsWithValues[i].entryStringImp4);
    imp5.rooflightsArea= atof(stringsWithValues[i++].entryStringImp5);

	rooflightsSolTrans= atof(stringsWithValues[i].entryString);
	base.rooflightsSolTrans= atof(stringsWithValues[i].entryStringBase);
	imp1.rooflightsSolTrans= atof(stringsWithValues[i].entryStringImp1);
	imp2.rooflightsSolTrans= atof(stringsWithValues[i].entryStringImp2);
	imp3.rooflightsSolTrans= atof(stringsWithValues[i].entryStringImp3);
	imp4.rooflightsSolTrans= atof(stringsWithValues[i].entryStringImp4);
    imp5.rooflightsSolTrans= atof(stringsWithValues[i++].entryStringImp5);

	rooflightsFrameFactor= atof(stringsWithValues[i].entryString);
	base.rooflightsFrameFactor= atof(stringsWithValues[i].entryStringBase);
	imp1.rooflightsFrameFactor= atof(stringsWithValues[i].entryStringImp1);
	imp2.rooflightsFrameFactor= atof(stringsWithValues[i].entryStringImp2);
	imp3.rooflightsFrameFactor= atof(stringsWithValues[i].entryStringImp3);
	imp4.rooflightsFrameFactor= atof(stringsWithValues[i].entryStringImp4);
    imp5.rooflightsFrameFactor= atof(stringsWithValues[i++].entryStringImp5);

	// Windows Overshading and glazing
	winOvershading= stringsWithValues[i].entryString;
	base.winOvershading= stringsWithValues[i].entryStringBase;
	imp1.winOvershading= stringsWithValues[i].entryStringImp1;
	imp2.winOvershading= stringsWithValues[i].entryStringImp2;
	imp3.winOvershading= stringsWithValues[i].entryStringImp3;
	imp4.winOvershading= stringsWithValues[i].entryStringImp4;
    imp5.winOvershading= stringsWithValues[i++].entryStringImp5;

	winGlazing= stringsWithValues[i].entryString;
	base.winGlazing= stringsWithValues[i].entryStringBase;
	imp1.winGlazing= stringsWithValues[i].entryStringImp1;
	imp2.winGlazing= stringsWithValues[i].entryStringImp2;
	imp3.winGlazing= stringsWithValues[i].entryStringImp3;
	imp4.winGlazing= stringsWithValues[i].entryStringImp4;
    imp5.winGlazing= stringsWithValues[i++].entryStringImp5;

	//------------------------------------------------------
	// AREAS AND U-VALUES
	//------------------------------------------------------
	// Gross areas
	grossAreaWall1= atof(stringsWithValues[i].entryString);
	base.grossAreaWall1= atof(stringsWithValues[i].entryStringBase);
	imp1.grossAreaWall1= atof(stringsWithValues[i].entryStringImp1);
	imp2.grossAreaWall1= atof(stringsWithValues[i].entryStringImp2);
	imp3.grossAreaWall1= atof(stringsWithValues[i].entryStringImp3);
	imp4.grossAreaWall1= atof(stringsWithValues[i].entryStringImp4);
    imp5.grossAreaWall1= atof(stringsWithValues[i++].entryStringImp5);

	groosAreaRoof1= atof(stringsWithValues[i].entryString);
	base.groosAreaRoof1= atof(stringsWithValues[i].entryStringBase);
	imp1.groosAreaRoof1= atof(stringsWithValues[i].entryStringImp1);
	imp2.groosAreaRoof1= atof(stringsWithValues[i].entryStringImp2);
	imp3.groosAreaRoof1= atof(stringsWithValues[i].entryStringImp3);
	imp4.groosAreaRoof1= atof(stringsWithValues[i].entryStringImp4);
    imp5.groosAreaRoof1= atof(stringsWithValues[i++].entryStringImp5);

	// Net areas
	netAreaDoors= atof(stringsWithValues[i].entryString);
	base.netAreaDoors= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaDoors= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaDoors= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaDoors= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaDoors= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaDoors= atof(stringsWithValues[i++].entryStringImp5);

	netAreaWindows= atof(stringsWithValues[i].entryString);
	base.netAreaWindows= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaWindows= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaWindows= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaWindows= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaWindows= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaWindows= atof(stringsWithValues[i++].entryStringImp5);
	
	netAreaRoofLights= atof(stringsWithValues[i].entryString);
	base.netAreaRoofLights= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaRoofLights= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaRoofLights= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaRoofLights= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaRoofLights= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaRoofLights= atof(stringsWithValues[i++].entryStringImp5);

	//------------------------------------------------------
	//	LIGHTS
	//------------------------------------------------------
	fractionLEL= atof(stringsWithValues[i].entryString);
	base.fractionLEL= atof(stringsWithValues[i].entryStringBase);
	imp1.fractionLEL= atof(stringsWithValues[i].entryStringImp1);
	imp2.fractionLEL= atof(stringsWithValues[i].entryStringImp2);
	imp3.fractionLEL= atof(stringsWithValues[i].entryStringImp3);
	imp4.fractionLEL= atof(stringsWithValues[i].entryStringImp4);
    imp5.fractionLEL= atof(stringsWithValues[i++].entryStringImp5);

	netAreaGF= atof(stringsWithValues[i].entryString);
	base.netAreaGF= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaGF= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaGF= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaGF= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaGF= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaGF= atof(stringsWithValues[i++].entryStringImp5);
		
	netAreaExFloor= atof(stringsWithValues[i].entryString);
	base.netAreaExFloor= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaExFloor= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaExFloor= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaExFloor= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaExFloor= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaExFloor= atof(stringsWithValues[i++].entryStringImp5);

	netAreaWallType1= atof(stringsWithValues[i].entryString);
	base.netAreaWallType1= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaWallType1= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaWallType1= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaWallType1= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaWallType1= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaWallType1= atof(stringsWithValues[i++].entryStringImp5);

	netAreaWallType2= atof(stringsWithValues[i].entryString);
	base.netAreaWallType2= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaWallType2= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaWallType2= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaWallType2= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaWallType2= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaWallType2= atof(stringsWithValues[i++].entryStringImp5);

	netAreaRoofType1= atof(stringsWithValues[i].entryString);
	base.netAreaRoofType1= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaRoofType1= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaRoofType1= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaRoofType1= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaRoofType1= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaRoofType1= atof(stringsWithValues[i++].entryStringImp5);

	netAreaRoofType2= atof(stringsWithValues[i].entryString);
	base.netAreaRoofType2= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaRoofType2= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaRoofType2= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaRoofType2= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaRoofType2= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaRoofType2= atof(stringsWithValues[i++].entryStringImp5);

	netAreaPartyWall= atof(stringsWithValues[i].entryString);
	base.netAreaPartyWall= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaPartyWall= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaPartyWall= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaPartyWall= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaPartyWall= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaPartyWall= atof(stringsWithValues[i++].entryStringImp5);

	netAreaPartyFloor= atof(stringsWithValues[i].entryString);
	base.netAreaPartyFloor= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaPartyFloor= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaPartyFloor= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaPartyFloor= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaPartyFloor= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaPartyFloor= atof(stringsWithValues[i++].entryStringImp5);

	netAreaPartyCeiling= atof(stringsWithValues[i].entryString);
	base.netAreaPartyCeiling= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaPartyCeiling= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaPartyCeiling= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaPartyCeiling= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaPartyCeiling= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaPartyCeiling= atof(stringsWithValues[i++].entryStringImp5);

	netAreaInternalWall= atof(stringsWithValues[i].entryString);
	base.netAreaInternalWall= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaInternalWall= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaInternalWall= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaInternalWall= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaInternalWall= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaInternalWall= atof(stringsWithValues[i++].entryStringImp5);

	netAreaInternalFloor= atof(stringsWithValues[i].entryString);
	base.netAreaInternalFloor= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaInternalFloor= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaInternalFloor= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaInternalFloor= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaInternalFloor= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaInternalFloor= atof(stringsWithValues[i++].entryStringImp5);

	netAreaInternalCeiling= atof(stringsWithValues[i].entryString);
	base.netAreaInternalCeiling= atof(stringsWithValues[i].entryStringBase);
	imp1.netAreaInternalCeiling= atof(stringsWithValues[i].entryStringImp1);
	imp2.netAreaInternalCeiling= atof(stringsWithValues[i].entryStringImp2);
	imp3.netAreaInternalCeiling= atof(stringsWithValues[i].entryStringImp3);
	imp4.netAreaInternalCeiling= atof(stringsWithValues[i].entryStringImp4);
    imp5.netAreaInternalCeiling= atof(stringsWithValues[i++].entryStringImp5);

	// U-values
	UvalueDoors= atof(stringsWithValues[i].entryString);
	base.UvalueDoors= atof(stringsWithValues[i].entryStringBase);
	imp1.UvalueDoors= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvalueDoors= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvalueDoors= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvalueDoors= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvalueDoors= atof(stringsWithValues[i++].entryStringImp5);

	UvalueWindows= atof(stringsWithValues[i].entryString);
	base.UvalueWindows= atof(stringsWithValues[i].entryStringBase);
	imp1.UvalueWindows= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvalueWindows= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvalueWindows= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvalueWindows= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvalueWindows= atof(stringsWithValues[i++].entryStringImp5);

	UvalueRooflights= atof(stringsWithValues[i].entryString);
	base.UvalueRooflights= atof(stringsWithValues[i].entryStringBase);
	imp1.UvalueRooflights= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvalueRooflights= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvalueRooflights= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvalueRooflights= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvalueRooflights= atof(stringsWithValues[i++].entryStringImp5);

	UvalueGF= atof(stringsWithValues[i].entryString);
	base.UvalueGF= atof(stringsWithValues[i].entryStringBase);
	imp1.UvalueGF= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvalueGF= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvalueGF= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvalueGF= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvalueGF= atof(stringsWithValues[i++].entryStringImp5);

	UvalueExposedFloor= atof(stringsWithValues[i].entryString);
	base.UvalueExposedFloor= atof(stringsWithValues[i].entryStringBase);
	imp1.UvalueExposedFloor= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvalueExposedFloor= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvalueExposedFloor= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvalueExposedFloor= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvalueExposedFloor= atof(stringsWithValues[i++].entryStringImp5);

	UvalueWallType1= atof(stringsWithValues[i].entryString);
	base.UvalueWallType1= atof(stringsWithValues[i].entryStringBase);
	imp1.UvalueWallType1= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvalueWallType1= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvalueWallType1= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvalueWallType1= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvalueWallType1= atof(stringsWithValues[i++].entryStringImp5);

	UvalueWallType2= atof(stringsWithValues[i].entryString);
	base.UvalueWallType2= atof(stringsWithValues[i].entryStringBase);
	imp1.UvalueWallType2= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvalueWallType2= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvalueWallType2= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvalueWallType2= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvalueWallType2= atof(stringsWithValues[i++].entryStringImp5);

	UvalueRoofTYpe1= atof(stringsWithValues[i].entryString);
	base.UvalueRoofTYpe1= atof(stringsWithValues[i].entryStringBase);
	imp1.UvalueRoofTYpe1= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvalueRoofTYpe1= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvalueRoofTYpe1= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvalueRoofTYpe1= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvalueRoofTYpe1= atof(stringsWithValues[i++].entryStringImp5);

	UvalueRoofType2= atof(stringsWithValues[i].entryString);
	base.UvalueRoofType2= atof(stringsWithValues[i].entryStringBase);
	imp1.UvalueRoofType2= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvalueRoofType2= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvalueRoofType2= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvalueRoofType2= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvalueRoofType2= atof(stringsWithValues[i++].entryStringImp5);

	UvaluePartyWall= atof(stringsWithValues[i].entryString);
	base.UvaluePartyWall= atof(stringsWithValues[i].entryStringBase);
	imp1.UvaluePartyWall= atof(stringsWithValues[i].entryStringImp1);
	imp2.UvaluePartyWall= atof(stringsWithValues[i].entryStringImp2);
	imp3.UvaluePartyWall= atof(stringsWithValues[i].entryStringImp3);
	imp4.UvaluePartyWall= atof(stringsWithValues[i].entryStringImp4);
    imp5.UvaluePartyWall= atof(stringsWithValues[i++].entryStringImp5);

	// K-values
	kValueGF= atof(stringsWithValues[i].entryString);
	base.kValueGF= atof(stringsWithValues[i].entryStringBase);
	imp1.kValueGF= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValueGF= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValueGF= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValueGF= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValueGF= atof(stringsWithValues[i++].entryStringImp5);

	kValueExpFloor= atof(stringsWithValues[i].entryString);
	base.kValueExpFloor= atof(stringsWithValues[i].entryStringBase);
	imp1.kValueExpFloor= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValueExpFloor= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValueExpFloor= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValueExpFloor= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValueExpFloor= atof(stringsWithValues[i++].entryStringImp5);

	kValueWallType1= atof(stringsWithValues[i].entryString);
	base.kValueWallType1= atof(stringsWithValues[i].entryStringBase);
	imp1.kValueWallType1= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValueWallType1= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValueWallType1= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValueWallType1= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValueWallType1= atof(stringsWithValues[i++].entryStringImp5);

	kValueWallType2= atof(stringsWithValues[i].entryString);
	base.kValueWallType2= atof(stringsWithValues[i].entryStringBase);
	imp1.kValueWallType2= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValueWallType2= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValueWallType2= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValueWallType2= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValueWallType2= atof(stringsWithValues[i++].entryStringImp5);

	kValueRoofType1= atof(stringsWithValues[i].entryString);
	base.kValueRoofType1= atof(stringsWithValues[i].entryStringBase);
	imp1.kValueRoofType1= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValueRoofType1= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValueRoofType1= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValueRoofType1= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValueRoofType1= atof(stringsWithValues[i++].entryStringImp5);

	kValueRoofType2= atof(stringsWithValues[i].entryString);
	base.kValueRoofType2= atof(stringsWithValues[i].entryStringBase);
	imp1.kValueRoofType2= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValueRoofType2= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValueRoofType2= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValueRoofType2= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValueRoofType2= atof(stringsWithValues[i++].entryStringImp5);

	kValuePartyWall= atof(stringsWithValues[i].entryString);
	base.kValuePartyWall= atof(stringsWithValues[i].entryStringBase);
	imp1.kValuePartyWall= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValuePartyWall= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValuePartyWall= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValuePartyWall= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValuePartyWall= atof(stringsWithValues[i++].entryStringImp5);

	kValuePartyFloor= atof(stringsWithValues[i].entryString);
	base.kValuePartyFloor= atof(stringsWithValues[i].entryStringBase);
	imp1.kValuePartyFloor= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValuePartyFloor= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValuePartyFloor= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValuePartyFloor= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValuePartyFloor= atof(stringsWithValues[i++].entryStringImp5);

	kValuePartyCeiling= atof(stringsWithValues[i].entryString);
	base.kValuePartyCeiling= atof(stringsWithValues[i].entryStringBase);
	imp1.kValuePartyCeiling= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValuePartyCeiling= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValuePartyCeiling= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValuePartyCeiling= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValuePartyCeiling= atof(stringsWithValues[i++].entryStringImp5);

	kValueIntWall= atof(stringsWithValues[i].entryString);
	base.kValueIntWall= atof(stringsWithValues[i].entryStringBase);
	imp1.kValueIntWall= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValueIntWall= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValueIntWall= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValueIntWall= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValueIntWall= atof(stringsWithValues[i++].entryStringImp5);

	kValueIntFloor= atof(stringsWithValues[i].entryString);
	base.kValueIntFloor= atof(stringsWithValues[i].entryStringBase);
	imp1.kValueIntFloor= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValueIntFloor= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValueIntFloor= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValueIntFloor= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValueIntFloor= atof(stringsWithValues[i++].entryStringImp5);

	kValueIntCeiling= atof(stringsWithValues[i].entryString);
	base.kValueIntCeiling= atof(stringsWithValues[i].entryStringBase);
	imp1.kValueIntCeiling= atof(stringsWithValues[i].entryStringImp1);
	imp2.kValueIntCeiling= atof(stringsWithValues[i].entryStringImp2);
	imp3.kValueIntCeiling= atof(stringsWithValues[i].entryStringImp3);
	imp4.kValueIntCeiling= atof(stringsWithValues[i].entryStringImp4);
    imp5.kValueIntCeiling= atof(stringsWithValues[i++].entryStringImp5);

    //Thermal mass parameter
	thermalMassParameter= atof(stringsWithValues[i].entryString);
	base.thermalMassParameter= atof(stringsWithValues[i].entryStringBase);
	imp1.thermalMassParameter= atof(stringsWithValues[i].entryStringImp1);
	imp2.thermalMassParameter= atof(stringsWithValues[i].entryStringImp2);
	imp3.thermalMassParameter= atof(stringsWithValues[i].entryStringImp3);
	imp4.thermalMassParameter= atof(stringsWithValues[i].entryStringImp4);
    imp5.thermalMassParameter= atof(stringsWithValues[i++].entryStringImp5);

	// Living room fraction
	livingRoomFraction= atof(stringsWithValues[i].entryString);
	base.livingRoomFraction= atof(stringsWithValues[i].entryStringBase);
	imp1.livingRoomFraction= atof(stringsWithValues[i].entryStringImp1);
	imp2.livingRoomFraction= atof(stringsWithValues[i].entryStringImp2);
	imp3.livingRoomFraction= atof(stringsWithValues[i].entryStringImp3);
	imp4.livingRoomFraction= atof(stringsWithValues[i].entryStringImp4);
    imp5.livingRoomFraction= atof(stringsWithValues[i++].entryStringImp5);

	//------------------------------------------------------
	// THERMAL BRIDGES
	//------------------------------------------------------
	// Y-value
	enterYValue= atoi(stringsWithValues[i].entryString);
	base.enterYValue= atoi(stringsWithValues[i].entryStringBase);
	imp1.enterYValue= atoi(stringsWithValues[i].entryStringImp1);
	imp2.enterYValue= atoi(stringsWithValues[i].entryStringImp2);
	imp3.enterYValue= atoi(stringsWithValues[i].entryStringImp3);
	imp4.enterYValue= atoi(stringsWithValues[i].entryStringImp4);
    imp5.enterYValue= atoi(stringsWithValues[i++].entryStringImp5);

	yValueEntry= atof(stringsWithValues[i].entryString);
	base.yValueEntry= atof(stringsWithValues[i].entryStringBase);
	imp1.yValueEntry= atof(stringsWithValues[i].entryStringImp1);
	imp2.yValueEntry= atof(stringsWithValues[i].entryStringImp2);
	imp3.yValueEntry= atof(stringsWithValues[i].entryStringImp3);
	imp4.yValueEntry= atof(stringsWithValues[i].entryStringImp4);
    imp5.yValueEntry= atof(stringsWithValues[i++].entryStringImp5);

	// Ground floor
	ThermBGFPerimeter= atof(stringsWithValues[i].entryString);
	base.ThermBGFPerimeter= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBGFPerimeter= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBGFPerimeter= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBGFPerimeter= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBGFPerimeter= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBGFPerimeter= atof(stringsWithValues[i++].entryStringImp5);

	ThermBGFPerimeterUserDef= stringsWithValues[i].entryString;
	base.ThermBGFPerimeterUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBGFPerimeterUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBGFPerimeterUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBGFPerimeterUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBGFPerimeterUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBGFPerimeterUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBGFPerimeterSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBGFPerimeterSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBGFPerimeterSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBGFPerimeterSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBGFPerimeterSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBGFPerimeterSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBGFPerimeterSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBGFPerimeterResult= atof(stringsWithValues[i].entryString);
	base.ThermBGFPerimeterResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBGFPerimeterResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBGFPerimeterResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBGFPerimeterResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBGFPerimeterResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBGFPerimeterResult= atof(stringsWithValues[i++].entryStringImp5);

	// Floor Within Dwelling 
	ThermBFloorWithingDwellinPerimeter= atof(stringsWithValues[i].entryString);
	base.ThermBFloorWithingDwellinPerimeter= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBFloorWithingDwellinPerimeter= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBFloorWithingDwellinPerimeter= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBFloorWithingDwellinPerimeter= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBFloorWithingDwellinPerimeter= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBFloorWithingDwellinPerimeter= atof(stringsWithValues[i++].entryStringImp5);

	ThermBFloorWithinDwellingUserDef= stringsWithValues[i].entryString;
	base.ThermBFloorWithinDwellingUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBFloorWithinDwellingUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBFloorWithinDwellingUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBFloorWithinDwellingUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBFloorWithinDwellingUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBFloorWithinDwellingUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBFloorWithinDwellingSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBFloorWithinDwellingSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBFloorWithinDwellingSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBFloorWithinDwellingSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBFloorWithinDwellingSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBFloorWithinDwellingSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBFloorWithinDwellingSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBFloorWithinDwellingPerimeterResult= atof(stringsWithValues[i].entryString);
	base.ThermBFloorWithinDwellingPerimeterResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBFloorWithinDwellingPerimeterResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBFloorWithinDwellingPerimeterResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBFloorWithinDwellingPerimeterResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBFloorWithinDwellingPerimeterResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBFloorWithinDwellingPerimeterResult= atof(stringsWithValues[i++].entryStringImp5);

	// Floor Between Dwelling
	ThermBFloorBetweenDwellinPerimeter= atof(stringsWithValues[i].entryString);
	base.ThermBFloorBetweenDwellinPerimeter= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBFloorBetweenDwellinPerimeter= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBFloorBetweenDwellinPerimeter= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBFloorBetweenDwellinPerimeter= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBFloorBetweenDwellinPerimeter= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBFloorBetweenDwellinPerimeter= atof(stringsWithValues[i++].entryStringImp5);

	ThermBFloorBwDwellingUserDef= stringsWithValues[i].entryString;
	base.ThermBFloorBwDwellingUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBFloorBwDwellingUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBFloorBwDwellingUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBFloorBwDwellingUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBFloorBwDwellingUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBFloorBwDwellingUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBFloorBetweenDwellingSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBFloorBetweenDwellingSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBFloorBetweenDwellingSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBFloorBetweenDwellingSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBFloorBetweenDwellingSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBFloorBetweenDwellingSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBFloorBetweenDwellingSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBFloorBetweenDwellingPerimeterResult= atof(stringsWithValues[i].entryString);
	base.ThermBFloorBetweenDwellingPerimeterResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBFloorBetweenDwellingPerimeterResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBFloorBetweenDwellingPerimeterResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBFloorBetweenDwellingPerimeterResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBFloorBetweenDwellingPerimeterResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBFloorBetweenDwellingPerimeterResult= atof(stringsWithValues[i++].entryStringImp5);

	// Balcony Within Dwelling
	ThermBBalconyWithingDwellingLength= atof(stringsWithValues[i].entryString);
	base.ThermBBalconyWithingDwellingLength= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBBalconyWithingDwellingLength= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBBalconyWithingDwellingLength= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBBalconyWithingDwellingLength= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBBalconyWithingDwellingLength= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBBalconyWithingDwellingLength= atof(stringsWithValues[i++].entryStringImp5);

	ThermBBalcWithinDwellingLengthUserDef= stringsWithValues[i].entryString;
	base.ThermBBalcWithinDwellingLengthUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBBalcWithinDwellingLengthUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBBalcWithinDwellingLengthUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBBalcWithinDwellingLengthUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBBalcWithinDwellingLengthUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBBalcWithinDwellingLengthUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBBalconyWithinDwellingSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBBalconyWithinDwellingSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBBalconyWithinDwellingSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBBalconyWithinDwellingSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBBalconyWithinDwellingSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBBalconyWithinDwellingSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBBalconyWithinDwellingSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBBalcWithDwellingLengthResult= atof(stringsWithValues[i].entryString);
	base.ThermBBalcWithDwellingLengthResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBBalcWithDwellingLengthResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBBalcWithDwellingLengthResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBBalcWithDwellingLengthResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBBalcWithDwellingLengthResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBBalcWithDwellingLengthResult= atof(stringsWithValues[i++].entryStringImp5);

	// Balcony Between Dwelling
	ThermBBalconyBetweenDwellingLength= atof(stringsWithValues[i].entryString);
	base.ThermBBalconyBetweenDwellingLength= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBBalconyBetweenDwellingLength= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBBalconyBetweenDwellingLength= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBBalconyBetweenDwellingLength= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBBalconyBetweenDwellingLength= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBBalconyBetweenDwellingLength= atof(stringsWithValues[i++].entryStringImp5);

	ThermBBalcBwDwellingLengthUserDef= stringsWithValues[i].entryString;
	base.ThermBBalcBwDwellingLengthUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBBalcBwDwellingLengthUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBBalcBwDwellingLengthUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBBalcBwDwellingLengthUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBBalcBwDwellingLengthUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBBalcBwDwellingLengthUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBBalconyBwDwellingSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBBalconyBwDwellingSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBBalconyBwDwellingSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBBalconyBwDwellingSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBBalconyBwDwellingSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBBalconyBwDwellingSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBBalconyBwDwellingSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBBalconyBwDwellingLengthResult= atof(stringsWithValues[i].entryString);
	base.ThermBBalconyBwDwellingLengthResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBBalconyBwDwellingLengthResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBBalconyBwDwellingLengthResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBBalconyBwDwellingLengthResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBBalconyBwDwellingLengthResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBBalconyBwDwellingLengthResult= atof(stringsWithValues[i++].entryStringImp5);

	// Eaves at ceiling
	ThermBEavesAtCeiling= atof(stringsWithValues[i].entryString);
	base.ThermBEavesAtCeiling= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBEavesAtCeiling= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBEavesAtCeiling= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBEavesAtCeiling= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBEavesAtCeiling= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBEavesAtCeiling= atof(stringsWithValues[i++].entryStringImp5);

	ThermBEavesInsAtCeilingUserDef= stringsWithValues[i].entryString;
	base.ThermBEavesInsAtCeilingUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBEavesInsAtCeilingUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBEavesInsAtCeilingUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBEavesInsAtCeilingUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBEavesInsAtCeilingUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBEavesInsAtCeilingUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBEavesInsAtCelingSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBEavesInsAtCelingSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBEavesInsAtCelingSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBEavesInsAtCelingSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBEavesInsAtCelingSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBEavesInsAtCelingSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBEavesInsAtCelingSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBEavesInsCeilingResult= atof(stringsWithValues[i].entryString);
	base.ThermBEavesInsCeilingResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBEavesInsCeilingResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBEavesInsCeilingResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBEavesInsCeilingResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBEavesInsCeilingResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBEavesInsCeilingResult= atof(stringsWithValues[i++].entryStringImp5);

	// Eaves at rafter
	ThermBEavesAtRafter= atof(stringsWithValues[i].entryString);
	base.ThermBEavesAtRafter= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBEavesAtRafter= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBEavesAtRafter= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBEavesAtRafter= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBEavesAtRafter= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBEavesAtRafter= atof(stringsWithValues[i++].entryStringImp5);

	ThermBEavesInsAtRafterUserDef= stringsWithValues[i].entryString;
	base.ThermBEavesInsAtRafterUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBEavesInsAtRafterUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBEavesInsAtRafterUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBEavesInsAtRafterUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBEavesInsAtRafterUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBEavesInsAtRafterUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBEavesInsAtRafterSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBEavesInsAtRafterSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBEavesInsAtRafterSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBEavesInsAtRafterSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBEavesInsAtRafterSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBEavesInsAtRafterSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBEavesInsAtRafterSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBEavesInsRafterResult= atof(stringsWithValues[i].entryString);
	base.ThermBEavesInsRafterResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBEavesInsRafterResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBEavesInsRafterResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBEavesInsRafterResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBEavesInsRafterResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBEavesInsRafterResult= atof(stringsWithValues[i++].entryStringImp5);

	// Gable at ceiling
	ThermBGableAtCeiling= atof(stringsWithValues[i].entryString);
	base.ThermBGableAtCeiling= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBGableAtCeiling= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBGableAtCeiling= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBGableAtCeiling= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBGableAtCeiling= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBGableAtCeiling= atof(stringsWithValues[i++].entryStringImp5);

	ThermBGableInsAtCeilingUserDef= stringsWithValues[i].entryString;
	base.ThermBGableInsAtCeilingUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBGableInsAtCeilingUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBGableInsAtCeilingUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBGableInsAtCeilingUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBGableInsAtCeilingUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBGableInsAtCeilingUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBGableInsAtCeilingSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBGableInsAtCeilingSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBGableInsAtCeilingSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBGableInsAtCeilingSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBGableInsAtCeilingSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBGableInsAtCeilingSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBGableInsAtCeilingSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBGableInsCeilingResult= atof(stringsWithValues[i].entryString);
	base.ThermBGableInsCeilingResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBGableInsCeilingResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBGableInsCeilingResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBGableInsCeilingResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBGableInsCeilingResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBGableInsCeilingResult= atof(stringsWithValues[i++].entryStringImp5);

	// Gable at rafter
	ThermBGableAtRafter= atof(stringsWithValues[i].entryString);
	base.ThermBGableAtRafter= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBGableAtRafter= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBGableAtRafter= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBGableAtRafter= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBGableAtRafter= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBGableAtRafter= atof(stringsWithValues[i++].entryStringImp5);

	ThermBGableInsAtRafetUserDef= stringsWithValues[i].entryString;
	base.ThermBGableInsAtRafetUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBGableInsAtRafetUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBGableInsAtRafetUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBGableInsAtRafetUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBGableInsAtRafetUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBGableInsAtRafetUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBGableInsAtRafterSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBGableInsAtRafterSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBGableInsAtRafterSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBGableInsAtRafterSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBGableInsAtRafterSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBGableInsAtRafterSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBGableInsAtRafterSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBGableInsRafterResult= atof(stringsWithValues[i].entryString);
	base.ThermBGableInsRafterResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBGableInsRafterResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBGableInsRafterResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBGableInsRafterResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBGableInsRafterResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBGableInsRafterResult= atof(stringsWithValues[i++].entryStringImp5);

	// Length normal corners
	ThermBLengthNormalCorners= atof(stringsWithValues[i].entryString);
	base.ThermBLengthNormalCorners= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBLengthNormalCorners= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBLengthNormalCorners= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBLengthNormalCorners= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBLengthNormalCorners= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBLengthNormalCorners= atof(stringsWithValues[i++].entryStringImp5);

	ThermBLengthOfNormalCornersUserDef= stringsWithValues[i].entryString;
	base.ThermBLengthOfNormalCornersUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBLengthOfNormalCornersUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBLengthOfNormalCornersUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBLengthOfNormalCornersUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBLengthOfNormalCornersUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBLengthOfNormalCornersUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBLengthOfNormalCornersSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBLengthOfNormalCornersSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBLengthOfNormalCornersSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBLengthOfNormalCornersSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBLengthOfNormalCornersSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBLengthOfNormalCornersSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBLengthOfNormalCornersSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBLengthNormalCornersResult= atof(stringsWithValues[i].entryString);
	base.ThermBLengthNormalCornersResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBLengthNormalCornersResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBLengthNormalCornersResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBLengthNormalCornersResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBLengthNormalCornersResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBLengthNormalCornersResult= atof(stringsWithValues[i++].entryStringImp5);

	// Length inverted corners
	ThermBLengthInvertedCorners= atof(stringsWithValues[i].entryString);
	base.ThermBLengthInvertedCorners= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBLengthInvertedCorners= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBLengthInvertedCorners= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBLengthInvertedCorners= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBLengthInvertedCorners= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBLengthInvertedCorners= atof(stringsWithValues[i++].entryStringImp5);

	ThermBLengthOfInvertedCornersUserDef= stringsWithValues[i].entryString;
	base.ThermBLengthOfInvertedCornersUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBLengthOfInvertedCornersUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBLengthOfInvertedCornersUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBLengthOfInvertedCornersUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBLengthOfInvertedCornersUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBLengthOfInvertedCornersUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBLengthOfInvertedCornersSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBLengthOfInvertedCornersSiValue= atof(stringsWithValues[i].entryString);
	imp1.ThermBLengthOfInvertedCornersSiValue= atof(stringsWithValues[i].entryStringBase);
	imp2.ThermBLengthOfInvertedCornersSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBLengthOfInvertedCornersSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBLengthOfInvertedCornersSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBLengthOfInvertedCornersSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBLengthInvertedCornersResult= atof(stringsWithValues[i].entryString);
	base.ThermBLengthInvertedCornersResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBLengthInvertedCornersResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBLengthInvertedCornersResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBLengthInvertedCornersResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBLengthInvertedCornersResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBLengthInvertedCornersResult= atof(stringsWithValues[i++].entryStringImp5);

	// Party wall
	ThermBPartWallBetweenDwelling= atof(stringsWithValues[i].entryString);
	base.ThermBPartWallBetweenDwelling= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBPartWallBetweenDwelling= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBPartWallBetweenDwelling= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBPartWallBetweenDwelling= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBPartWallBetweenDwelling= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBPartWallBetweenDwelling= atof(stringsWithValues[i++].entryStringImp5);

	ThermBPartWallBetweenDwellingUserDef= stringsWithValues[i].entryString;
	base.ThermBPartWallBetweenDwellingUserDef= stringsWithValues[i].entryStringBase;
	imp1.ThermBPartWallBetweenDwellingUserDef= stringsWithValues[i].entryStringImp1;
	imp2.ThermBPartWallBetweenDwellingUserDef= stringsWithValues[i].entryStringImp2;
	imp3.ThermBPartWallBetweenDwellingUserDef= stringsWithValues[i].entryStringImp3;
	imp4.ThermBPartWallBetweenDwellingUserDef= stringsWithValues[i].entryStringImp4;
    imp5.ThermBPartWallBetweenDwellingUserDef= stringsWithValues[i++].entryStringImp5;

	ThermBPartBwDwellingLengthSiValue= atof(stringsWithValues[i].entryString);
	base.ThermBPartBwDwellingLengthSiValue= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBPartBwDwellingLengthSiValue= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBPartBwDwellingLengthSiValue= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBPartBwDwellingLengthSiValue= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBPartBwDwellingLengthSiValue= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBPartBwDwellingLengthSiValue= atof(stringsWithValues[i++].entryStringImp5);

	ThermBPartyWallBwDwellingResult= atof(stringsWithValues[i].entryString);
	base.ThermBPartyWallBwDwellingResult= atof(stringsWithValues[i].entryStringBase);
	imp1.ThermBPartyWallBwDwellingResult= atof(stringsWithValues[i].entryStringImp1);
	imp2.ThermBPartyWallBwDwellingResult= atof(stringsWithValues[i].entryStringImp2);
	imp3.ThermBPartyWallBwDwellingResult= atof(stringsWithValues[i].entryStringImp3);
	imp4.ThermBPartyWallBwDwellingResult= atof(stringsWithValues[i].entryStringImp4);
    imp5.ThermBPartyWallBwDwellingResult= atof(stringsWithValues[i++].entryStringImp5);

	//------------------------------------------------------
	// VENTILATION
	//------------------------------------------------------
	// Fireplaces
	numsOpenFirePlaces= atoi(stringsWithValues[i].entryString);
	base.numsOpenFirePlaces= atoi(stringsWithValues[i].entryStringBase);
	imp1.numsOpenFirePlaces= atoi(stringsWithValues[i].entryStringImp1);
	imp2.numsOpenFirePlaces= atoi(stringsWithValues[i].entryStringImp2);
	imp3.numsOpenFirePlaces= atoi(stringsWithValues[i].entryStringImp3);
	imp4.numsOpenFirePlaces= atoi(stringsWithValues[i].entryStringImp4);
    imp5.numsOpenFirePlaces= atoi(stringsWithValues[i++].entryStringImp5);

	// Flues
	numsOpenFlues= atoi(stringsWithValues[i].entryString);
	base.numsOpenFlues= atoi(stringsWithValues[i].entryStringBase);
	imp1.numsOpenFlues= atoi(stringsWithValues[i].entryStringImp1);
	imp2.numsOpenFlues= atoi(stringsWithValues[i].entryStringImp2);
	imp3.numsOpenFlues= atoi(stringsWithValues[i].entryStringImp3);
	imp4.numsOpenFlues= atoi(stringsWithValues[i].entryStringImp4);
    imp5.numsOpenFlues= atoi(stringsWithValues[i++].entryStringImp5);

	// Flueless Gas Fires
	numsFluelessGasFires= atoi(stringsWithValues[i].entryString);
	base.numsFluelessGasFires= atoi(stringsWithValues[i].entryStringBase);
	imp1.numsFluelessGasFires= atoi(stringsWithValues[i].entryStringImp1);
	imp2.numsFluelessGasFires= atoi(stringsWithValues[i].entryStringImp2);
	imp3.numsFluelessGasFires= atoi(stringsWithValues[i].entryStringImp3);
	imp4.numsFluelessGasFires= atoi(stringsWithValues[i].entryStringImp4);
    imp5.numsFluelessGasFires= atoi(stringsWithValues[i++].entryStringImp5);

	// Extract fans
	numsExtractFans= atoi(stringsWithValues[i].entryString);
	base.numsExtractFans= atoi(stringsWithValues[i].entryStringBase);
	imp1.numsExtractFans= atoi(stringsWithValues[i].entryStringImp1);
	imp2.numsExtractFans= atoi(stringsWithValues[i].entryStringImp2);
	imp3.numsExtractFans= atoi(stringsWithValues[i].entryStringImp3);
	imp4.numsExtractFans= atoi(stringsWithValues[i].entryStringImp4);
    imp5.numsExtractFans= atoi(stringsWithValues[i++].entryStringImp5);

	// Passive vents
	numsPassiveVents= atoi(stringsWithValues[i].entryString);
	base.numsPassiveVents= atoi(stringsWithValues[i].entryStringBase);
	imp1.numsPassiveVents= atoi(stringsWithValues[i].entryStringImp1);
	imp2.numsPassiveVents= atoi(stringsWithValues[i].entryStringImp2);
	imp3.numsPassiveVents= atoi(stringsWithValues[i].entryStringImp3);
	imp4.numsPassiveVents= atoi(stringsWithValues[i].entryStringImp4);
    imp5.numsPassiveVents= atof(stringsWithValues[i++].entryStringImp5);

	// Mechanical ventilation inputs
	mechVentType= stringsWithValues[i].entryString;
	base.mechVentType= stringsWithValues[i].entryStringBase;
	imp1.mechVentType= stringsWithValues[i].entryStringImp1;
	imp2.mechVentType= stringsWithValues[i].entryStringImp2;
	imp3.mechVentType= stringsWithValues[i].entryStringImp3;
	imp4.mechVentType= stringsWithValues[i].entryStringImp4;
    imp5.mechVentType= stringsWithValues[i++].entryStringImp5;

	MVHRThermalEff= atof(stringsWithValues[i].entryString);
	base.MVHRThermalEff= atof(stringsWithValues[i].entryStringBase);
	imp1.MVHRThermalEff= atof(stringsWithValues[i].entryStringImp1);
	imp2.MVHRThermalEff= atof(stringsWithValues[i].entryStringImp2);
	imp3.MVHRThermalEff= atof(stringsWithValues[i].entryStringImp3);
	imp4.MVHRThermalEff= atof(stringsWithValues[i].entryStringImp4);
    imp5.MVHRThermalEff= atof(stringsWithValues[i++].entryStringImp5);

	SFP= atof(stringsWithValues[i].entryString);
	base.SFP= atof(stringsWithValues[i].entryStringBase);
	imp1.SFP= atof(stringsWithValues[i].entryStringImp1);
	imp2.SFP= atof(stringsWithValues[i].entryStringImp2);
	imp3.SFP= atof(stringsWithValues[i].entryStringImp3);
	imp4.SFP= atof(stringsWithValues[i].entryStringImp4);
    imp5.SFP= atof(stringsWithValues[i++].entryStringImp5);

	// Pressure test inputs
	pressureTestYN= stringsWithValues[i].entryString;
	base.pressureTestYN= stringsWithValues[i].entryStringBase;
	imp1.pressureTestYN= stringsWithValues[i].entryStringImp1;
	imp2.pressureTestYN= stringsWithValues[i].entryStringImp2;
	imp3.pressureTestYN= stringsWithValues[i].entryStringImp3;
	imp4.pressureTestYN= stringsWithValues[i].entryStringImp4;
    imp5.pressureTestYN= stringsWithValues[i++].entryStringImp5;

	measuredQ50= atof(stringsWithValues[i].entryString);
	base.measuredQ50= atof(stringsWithValues[i].entryStringBase);
	imp1.measuredQ50= atof(stringsWithValues[i].entryStringImp1);
	imp2.measuredQ50= atof(stringsWithValues[i].entryStringImp2);
	imp3.measuredQ50= atof(stringsWithValues[i].entryStringImp3);
	imp4.measuredQ50= atof(stringsWithValues[i].entryStringImp4);
    imp5.measuredQ50= atof(stringsWithValues[i++].entryStringImp5);

	numOfStoreys= atoi(stringsWithValues[i].entryString);
	base.numOfStoreys= atoi(stringsWithValues[i].entryStringBase);
	imp1.numOfStoreys= atoi(stringsWithValues[i].entryStringImp1);
	imp2.numOfStoreys= atoi(stringsWithValues[i].entryStringImp2);
	imp3.numOfStoreys= atoi(stringsWithValues[i].entryStringImp3);
	imp4.numOfStoreys= atoi(stringsWithValues[i].entryStringImp4);
    imp5.numOfStoreys= atoi(stringsWithValues[i++].entryStringImp5);

	structInf= atof(stringsWithValues[i].entryString);
	base.structInf= atof(stringsWithValues[i].entryStringBase);
	imp1.structInf= atof(stringsWithValues[i].entryStringImp1);
	imp2.structInf= atof(stringsWithValues[i].entryStringImp2);
	imp3.structInf= atof(stringsWithValues[i].entryStringImp3);
	imp4.structInf= atof(stringsWithValues[i].entryStringImp4);
    imp5.structInf= atof(stringsWithValues[i++].entryStringImp5);

	floorInf= atof(stringsWithValues[i].entryString);
	base.floorInf= atof(stringsWithValues[i].entryStringBase);
	imp1.floorInf= atof(stringsWithValues[i].entryStringImp1);
	imp2.floorInf= atof(stringsWithValues[i].entryStringImp2);
	imp3.floorInf= atof(stringsWithValues[i].entryStringImp3);
	imp4.floorInf= atof(stringsWithValues[i].entryStringImp4);
    imp5.floorInf= atof(stringsWithValues[i++].entryStringImp5);

	draughtLobby= stringsWithValues[i].entryString;
	base.draughtLobby= stringsWithValues[i].entryStringBase;
	imp1.draughtLobby= stringsWithValues[i].entryStringImp1;
	imp2.draughtLobby= stringsWithValues[i].entryStringImp2;
	imp3.draughtLobby= stringsWithValues[i].entryStringImp3;
	imp4.draughtLobby= stringsWithValues[i].entryStringImp4;
    imp5.draughtLobby= stringsWithValues[i++].entryStringImp5;

	perWindowDraughtStripped= atoi(stringsWithValues[i].entryString);
	base.perWindowDraughtStripped= atoi(stringsWithValues[i].entryStringBase);
	imp1.perWindowDraughtStripped= atoi(stringsWithValues[i].entryStringImp1);
	imp2.perWindowDraughtStripped= atoi(stringsWithValues[i].entryStringImp2);
	imp3.perWindowDraughtStripped= atoi(stringsWithValues[i].entryStringImp3);
	imp4.perWindowDraughtStripped= atoi(stringsWithValues[i].entryStringImp4);
    imp5.perWindowDraughtStripped= atoi(stringsWithValues[i++].entryStringImp5);

	numOfShelteredSides= atoi(stringsWithValues[i].entryString);
	base.numOfShelteredSides= atoi(stringsWithValues[i].entryStringBase);
	imp1.numOfShelteredSides= atoi(stringsWithValues[i].entryStringImp1);
	imp2.numOfShelteredSides= atoi(stringsWithValues[i].entryStringImp2);
	imp3.numOfShelteredSides= atoi(stringsWithValues[i].entryStringImp3);
	imp4.numOfShelteredSides= atoi(stringsWithValues[i].entryStringImp4);
    imp5.numOfShelteredSides= atoi(stringsWithValues[i++].entryStringImp5);

	//------------------------------------------------------
	// MAIN HEATING
	//------------------------------------------------------
	electricityTarrif= stringsWithValues[i].entryString;
	base.electricityTarrif= stringsWithValues[i].entryStringBase;
	imp1.electricityTarrif= stringsWithValues[i].entryStringImp1;
	imp2.electricityTarrif= stringsWithValues[i].entryStringImp2;
	imp3.electricityTarrif= stringsWithValues[i].entryStringImp3;
	imp4.electricityTarrif= stringsWithValues[i].entryStringImp4;
    imp5.electricityTarrif= stringsWithValues[i++].entryStringImp5;

	mainHtType= stringsWithValues[i].entryString;
	base.mainHtType= stringsWithValues[i].entryStringBase;
	imp1.mainHtType= stringsWithValues[i].entryStringImp1;
	imp2.mainHtType= stringsWithValues[i].entryStringImp2;
	imp3.mainHtType= stringsWithValues[i].entryStringImp3;
	imp4.mainHtType= stringsWithValues[i].entryStringImp4;
    imp5.mainHtType= stringsWithValues[i++].entryStringImp5;

	mainHtEffFrom= stringsWithValues[i].entryString;
	base.mainHtEffFrom= stringsWithValues[i].entryStringBase;
	imp1.mainHtEffFrom= stringsWithValues[i].entryStringImp1;
	imp2.mainHtEffFrom= stringsWithValues[i].entryStringImp2;
	imp3.mainHtEffFrom= stringsWithValues[i].entryStringImp3;
	imp4.mainHtEffFrom= stringsWithValues[i].entryStringImp4;
    imp5.mainHtEffFrom= stringsWithValues[i++].entryStringImp5;

	boilerType= stringsWithValues[i].entryString;
	base.boilerType= stringsWithValues[i].entryStringBase;
	imp1.boilerType= stringsWithValues[i].entryStringImp1;
	imp2.boilerType= stringsWithValues[i].entryStringImp2;
	imp3.boilerType= stringsWithValues[i].entryStringImp3;
	imp4.boilerType= stringsWithValues[i].entryStringImp4;
    imp5.boilerType= stringsWithValues[i++].entryStringImp5;

	mainFuel= stringsWithValues[i].entryString;
	base.mainFuel= stringsWithValues[i].entryStringBase;
	imp1.mainFuel= stringsWithValues[i].entryStringImp1;
	imp2.mainFuel= stringsWithValues[i].entryStringImp2;
	imp3.mainFuel= stringsWithValues[i].entryStringImp3;
	imp4.mainFuel= stringsWithValues[i].entryStringImp4;
    imp5.mainFuel= stringsWithValues[i++].entryStringImp5;

	isFanFluePresent= stringsWithValues[i].entryString;
	base.isFanFluePresent= stringsWithValues[i].entryStringBase;
	imp1.isFanFluePresent= stringsWithValues[i].entryStringImp1;
	imp2.isFanFluePresent= stringsWithValues[i].entryStringImp2;
	imp3.isFanFluePresent= stringsWithValues[i].entryStringImp3;
	imp4.isFanFluePresent= stringsWithValues[i].entryStringImp4;
    imp5.isFanFluePresent= stringsWithValues[i++].entryStringImp5;

	mainHtSystem= stringsWithValues[i].entryString;
	base.mainHtSystem= stringsWithValues[i].entryStringBase;
	imp1.mainHtSystem= stringsWithValues[i].entryStringImp1;
	imp2.mainHtSystem= stringsWithValues[i].entryStringImp2;
	imp3.mainHtSystem= stringsWithValues[i].entryStringImp3;
	imp4.mainHtSystem= stringsWithValues[i].entryStringImp4;
    imp5.mainHtSystem= stringsWithValues[i++].entryStringImp5;

	mainHtControls= stringsWithValues[i].entryString;
	base.mainHtControls= stringsWithValues[i].entryStringBase;
	imp1.mainHtControls= stringsWithValues[i].entryStringImp1;
	imp2.mainHtControls= stringsWithValues[i].entryStringImp2;
	imp3.mainHtControls= stringsWithValues[i].entryStringImp3;
	imp4.mainHtControls= stringsWithValues[i].entryStringImp4;
    imp5.mainHtControls= stringsWithValues[i++].entryStringImp5;

	mainHtEmitter= stringsWithValues[i].entryString;
	base.mainHtEmitter= stringsWithValues[i].entryStringBase;
	imp1.mainHtEmitter= stringsWithValues[i].entryStringImp1;
	imp2.mainHtEmitter= stringsWithValues[i].entryStringImp2;
	imp3.mainHtEmitter= stringsWithValues[i].entryStringImp3;
	imp4.mainHtEmitter= stringsWithValues[i].entryStringImp4;
    imp5.mainHtEmitter= stringsWithValues[i++].entryStringImp5;

	isIterlockPresent= stringsWithValues[i].entryString;
	base.isIterlockPresent= stringsWithValues[i].entryStringBase;
	imp1.isIterlockPresent= stringsWithValues[i].entryStringImp1;
	imp2.isIterlockPresent= stringsWithValues[i].entryStringImp2;
	imp3.isIterlockPresent= stringsWithValues[i].entryStringImp3;
	imp4.isIterlockPresent= stringsWithValues[i].entryStringImp4;
    imp5.isIterlockPresent= stringsWithValues[i++].entryStringImp5;

	mainHtCompensator= stringsWithValues[i].entryString;
	base.mainHtCompensator= stringsWithValues[i].entryStringBase;
	imp1.mainHtCompensator= stringsWithValues[i].entryStringImp1;
	imp2.mainHtCompensator= stringsWithValues[i].entryStringImp2;
	imp3.mainHtCompensator= stringsWithValues[i].entryStringImp3;
	imp4.mainHtCompensator= stringsWithValues[i].entryStringImp4;
    imp5.mainHtCompensator= stringsWithValues[i++].entryStringImp5;

	isPumpInHeatedSpace= stringsWithValues[i].entryString;
	base.isPumpInHeatedSpace= stringsWithValues[i].entryStringBase;
	imp1.isPumpInHeatedSpace= stringsWithValues[i].entryStringImp1;
	imp2.isPumpInHeatedSpace= stringsWithValues[i].entryStringImp2;
	imp3.isPumpInHeatedSpace= stringsWithValues[i].entryStringImp3;
	imp4.isPumpInHeatedSpace= stringsWithValues[i].entryStringImp4;
    imp5.isPumpInHeatedSpace= stringsWithValues[i++].entryStringImp5;

	mainHtManufacturerDesc= stringsWithValues[i].entryString;
	base.mainHtManufacturerDesc= stringsWithValues[i].entryStringBase;
	imp1.mainHtManufacturerDesc= stringsWithValues[i].entryStringImp1;
	imp2.mainHtManufacturerDesc= stringsWithValues[i].entryStringImp2;
	imp3.mainHtManufacturerDesc= stringsWithValues[i].entryStringImp3;
	imp4.mainHtManufacturerDesc= stringsWithValues[i].entryStringImp4;
    imp5.mainHtManufacturerDesc= stringsWithValues[i++].entryStringImp5;

	mainHtTestMethod= stringsWithValues[i].entryString;
	base.mainHtTestMethod= stringsWithValues[i].entryStringBase;
	imp1.mainHtTestMethod= stringsWithValues[i].entryStringImp1;
	imp2.mainHtTestMethod= stringsWithValues[i].entryStringImp2;
	imp3.mainHtTestMethod= stringsWithValues[i].entryStringImp3;
	imp4.mainHtTestMethod= stringsWithValues[i].entryStringImp4;
    imp5.mainHtTestMethod= stringsWithValues[i++].entryStringImp5;

	/*mainHtEff= atof(stringsWithValues[i].entryString);
		base.mainHtEff= atof(stringsWithValues[i].entryStringBase);
	imp1.mainHtEff= atof(stringsWithValues[i].entryStringImp1);
	imp2.mainHtEff= atof(stringsWithValues[i].entryStringImp2);
	imp3.mainHtEff= atof(stringsWithValues[i].entryStringImp3);
	imp4.mainHtEff= atof(stringsWithValues[i].entryStringImp4);
    imp5.mainHtEff= atof(stringsWithValues[i++].entryStringImp5);
	*/
	mainHtEffNominal= atof(stringsWithValues[i].entryString); //@min
	base.mainHtEffNominal= atof(stringsWithValues[i].entryStringBase);
	imp1.mainHtEffNominal= atof(stringsWithValues[i].entryStringImp1);
	imp2.mainHtEffNominal= atof(stringsWithValues[i].entryStringImp2);
	imp3.mainHtEffNominal= atof(stringsWithValues[i].entryStringImp3);
	imp4.mainHtEffNominal= atof(stringsWithValues[i].entryStringImp4);
    imp5.mainHtEffNominal= atof(stringsWithValues[i++].entryStringImp5);

	mainHtFractionSupplied= atof(stringsWithValues[i].entryString);
	base.mainHtFractionSupplied= atof(stringsWithValues[i].entryStringBase);
	imp1.mainHtFractionSupplied= atof(stringsWithValues[i].entryStringImp1);
	imp2.mainHtFractionSupplied= atof(stringsWithValues[i].entryStringImp2);
	imp3.mainHtFractionSupplied= atof(stringsWithValues[i].entryStringImp3);
	imp4.mainHtFractionSupplied= atof(stringsWithValues[i].entryStringImp4);
    imp5.mainHtFractionSupplied= atof(stringsWithValues[i++].entryStringImp5);

	//------------------------------------------------------
	// MAIN HETAING DETAILS
	//------------------------------------------------------
	oilPumpInHeatedSpace= stringsWithValues[i].entryString;
	base.oilPumpInHeatedSpace= stringsWithValues[i].entryStringBase;
	imp1.oilPumpInHeatedSpace= stringsWithValues[i].entryStringImp1;
	imp2.oilPumpInHeatedSpace= stringsWithValues[i].entryStringImp2;
	imp3.oilPumpInHeatedSpace= stringsWithValues[i].entryStringImp3;
	imp4.oilPumpInHeatedSpace= stringsWithValues[i].entryStringImp4;
    imp5.oilPumpInHeatedSpace= stringsWithValues[i++].entryStringImp5;

	oilBoilerInstalled= stringsWithValues[i].entryString;
	base.oilBoilerInstalled= stringsWithValues[i].entryStringBase;
	imp1.oilBoilerInstalled= stringsWithValues[i].entryStringImp1;
	imp2.oilBoilerInstalled= stringsWithValues[i].entryStringImp2;
	imp3.oilBoilerInstalled= stringsWithValues[i].entryStringImp3;
	imp4.oilBoilerInstalled= stringsWithValues[i].entryStringImp4;
    imp5.oilBoilerInstalled= stringsWithValues[i++].entryStringImp5;

	CPSUoperatingTemp= atof(stringsWithValues[i].entryString);
	base.CPSUoperatingTemp= atof(stringsWithValues[i].entryStringBase);
	imp1.CPSUoperatingTemp= atof(stringsWithValues[i].entryStringImp1);
	imp2.CPSUoperatingTemp= atof(stringsWithValues[i].entryStringImp2);
	imp3.CPSUoperatingTemp= atof(stringsWithValues[i].entryStringImp3);
	imp4.CPSUoperatingTemp= atof(stringsWithValues[i].entryStringImp4);
    imp5.CPSUoperatingTemp= atof(stringsWithValues[i++].entryStringImp5);

	heatEmmFromCase= atof(stringsWithValues[i].entryString);
	base.heatEmmFromCase= atof(stringsWithValues[i].entryStringBase);
	imp1.heatEmmFromCase= atof(stringsWithValues[i].entryStringImp1);
	imp2.heatEmmFromCase= atof(stringsWithValues[i].entryStringImp2);
	imp3.heatEmmFromCase= atof(stringsWithValues[i].entryStringImp3);
	imp4.heatEmmFromCase= atof(stringsWithValues[i].entryStringImp4);
    imp5.heatEmmFromCase= atof(stringsWithValues[i++].entryStringImp5);

	heatTransferredToWater= atof(stringsWithValues[i].entryString);
	base.heatTransferredToWater= atof(stringsWithValues[i].entryStringBase);
	imp1.heatTransferredToWater= atof(stringsWithValues[i].entryStringImp1);
	imp2.heatTransferredToWater= atof(stringsWithValues[i].entryStringImp2);
	imp3.heatTransferredToWater= atof(stringsWithValues[i].entryStringImp3);
	imp4.heatTransferredToWater= atof(stringsWithValues[i].entryStringImp4);
    imp5.heatTransferredToWater= atof(stringsWithValues[i++].entryStringImp5);

	isThereCHP= stringsWithValues[i].entryString;
	base.isThereCHP= stringsWithValues[i].entryStringBase;
	imp1.isThereCHP= stringsWithValues[i].entryStringImp1;
	imp2.isThereCHP= stringsWithValues[i].entryStringImp2;
	imp3.isThereCHP= stringsWithValues[i].entryStringImp3;
	imp4.isThereCHP= stringsWithValues[i].entryStringImp4;
    imp5.isThereCHP= stringsWithValues[i++].entryStringImp5;

	CHPfuel= stringsWithValues[i].entryString;
	base.CHPfuel= stringsWithValues[i].entryStringBase;
	imp1.CHPfuel= stringsWithValues[i].entryStringImp1;
	imp2.CHPfuel= stringsWithValues[i].entryStringImp2;
	imp3.CHPfuel= stringsWithValues[i].entryStringImp3;
	imp4.CHPfuel= stringsWithValues[i].entryStringImp4;
    imp5.CHPfuel= stringsWithValues[i++].entryStringImp5;

	fractOfHtFromCHP= atof(stringsWithValues[i].entryString);
	base.fractOfHtFromCHP= atof(stringsWithValues[i].entryStringBase);
	imp1.fractOfHtFromCHP= atof(stringsWithValues[i].entryStringImp1);
	imp2.fractOfHtFromCHP= atof(stringsWithValues[i].entryStringImp2);
	imp3.fractOfHtFromCHP= atof(stringsWithValues[i].entryStringImp3);
	imp4.fractOfHtFromCHP= atof(stringsWithValues[i].entryStringImp4);
    imp5.fractOfHtFromCHP= atof(stringsWithValues[i++].entryStringImp5);

	elecEffOfCHP= atof(stringsWithValues[i].entryString);
	base.elecEffOfCHP= atof(stringsWithValues[i].entryStringBase);
	imp1.elecEffOfCHP= atof(stringsWithValues[i].entryStringImp1);
	imp2.elecEffOfCHP= atof(stringsWithValues[i].entryStringImp2);
	imp3.elecEffOfCHP= atof(stringsWithValues[i].entryStringImp3);
	imp4.elecEffOfCHP= atof(stringsWithValues[i].entryStringImp4);
    imp5.elecEffOfCHP= atof(stringsWithValues[i++].entryStringImp5);

	heatingEffOfCHP= atof(stringsWithValues[i].entryString);
	base.heatingEffOfCHP= atof(stringsWithValues[i].entryStringBase);
	imp1.heatingEffOfCHP= atof(stringsWithValues[i].entryStringImp1);
	imp2.heatingEffOfCHP= atof(stringsWithValues[i].entryStringImp2);
	imp3.heatingEffOfCHP= atof(stringsWithValues[i].entryStringImp3);
	imp4.heatingEffOfCHP= atof(stringsWithValues[i].entryStringImp4);
    imp5.heatingEffOfCHP= atof(stringsWithValues[i++].entryStringImp5);

	//------------------------------------------------------
	// SECONDARY HEATING
	//------------------------------------------------------
	isThereSecHeating= stringsWithValues[i].entryString;
	base.isThereSecHeating= stringsWithValues[i].entryStringBase;
	imp1.isThereSecHeating= stringsWithValues[i].entryStringImp1;
	imp2.isThereSecHeating= stringsWithValues[i].entryStringImp2;
	imp3.isThereSecHeating= stringsWithValues[i].entryStringImp3;
	imp4.isThereSecHeating= stringsWithValues[i].entryStringImp4;
    imp5.isThereSecHeating= stringsWithValues[i++].entryStringImp5;

	secHtOpenFlueChimney= stringsWithValues[i].entryString;
	base.secHtOpenFlueChimney= stringsWithValues[i].entryStringBase;
	imp1.secHtOpenFlueChimney= stringsWithValues[i].entryStringImp1;
	imp2.secHtOpenFlueChimney= stringsWithValues[i].entryStringImp2;
	imp3.secHtOpenFlueChimney= stringsWithValues[i].entryStringImp3;
	imp4.secHtOpenFlueChimney= stringsWithValues[i].entryStringImp4;
    imp5.secHtOpenFlueChimney= stringsWithValues[i++].entryStringImp5;

	secHtUnconnectedGasPoint= stringsWithValues[i].entryString;
	base.secHtUnconnectedGasPoint= stringsWithValues[i].entryStringBase;
	imp1.secHtUnconnectedGasPoint= stringsWithValues[i].entryStringImp1;
	imp2.secHtUnconnectedGasPoint= stringsWithValues[i].entryStringImp2;
	imp3.secHtUnconnectedGasPoint= stringsWithValues[i].entryStringImp3;
	imp4.secHtUnconnectedGasPoint= stringsWithValues[i].entryStringImp4;
    imp5.secHtUnconnectedGasPoint= stringsWithValues[i++].entryStringImp5;

	secHtEffFrom= stringsWithValues[i].entryString;
	base.secHtEffFrom= stringsWithValues[i].entryStringBase;
	imp1.secHtEffFrom= stringsWithValues[i].entryStringImp1;
	imp2.secHtEffFrom= stringsWithValues[i].entryStringImp2;
	imp3.secHtEffFrom= stringsWithValues[i].entryStringImp3;
	imp4.secHtEffFrom= stringsWithValues[i].entryStringImp4;
    imp5.secHtEffFrom= stringsWithValues[i++].entryStringImp5;

	secHtFuel= stringsWithValues[i].entryString;
	base.secHtFuel= stringsWithValues[i].entryStringBase;
	imp1.secHtFuel= stringsWithValues[i].entryStringImp1;
	imp2.secHtFuel= stringsWithValues[i].entryStringImp2;
	imp3.secHtFuel= stringsWithValues[i].entryStringImp3;
	imp4.secHtFuel= stringsWithValues[i].entryStringImp4;
    imp5.secHtFuel= stringsWithValues[i++].entryStringImp5;

	secHtSystem= stringsWithValues[i].entryString;
	base.secHtSystem= stringsWithValues[i].entryStringBase;
	imp1.secHtSystem= stringsWithValues[i].entryStringImp1;
	imp2.secHtSystem= stringsWithValues[i].entryStringImp2;
	imp3.secHtSystem= stringsWithValues[i].entryStringImp3;
	imp4.secHtSystem= stringsWithValues[i].entryStringImp4;
    imp5.secHtSystem= stringsWithValues[i++].entryStringImp5;

	secHtManufactDesc= stringsWithValues[i].entryString;
	base.secHtManufactDesc= stringsWithValues[i].entryStringBase;
	imp1.secHtManufactDesc= stringsWithValues[i].entryStringImp1;
	imp2.secHtManufactDesc= stringsWithValues[i].entryStringImp2;
	imp3.secHtManufactDesc= stringsWithValues[i].entryStringImp3;
	imp4.secHtManufactDesc= stringsWithValues[i].entryStringImp4;
    imp5.secHtManufactDesc= stringsWithValues[i++].entryStringImp5;

	secHtTestMethod= stringsWithValues[i].entryString;
	base.secHtTestMethod= stringsWithValues[i].entryStringBase;
	imp1.secHtTestMethod= stringsWithValues[i].entryStringImp1;
	imp2.secHtTestMethod= stringsWithValues[i].entryStringImp2;
	imp3.secHtTestMethod= stringsWithValues[i].entryStringImp3;
	imp4.secHtTestMethod= stringsWithValues[i].entryStringImp4;
    imp5.secHtTestMethod= stringsWithValues[i++].entryStringImp5;

	secHtEff= atof(stringsWithValues[i].entryString);
	base.secHtEff= atof(stringsWithValues[i].entryStringBase);
	imp1.secHtEff= atof(stringsWithValues[i].entryStringImp1);
	imp2.secHtEff= atof(stringsWithValues[i].entryStringImp2);
	imp3.secHtEff= atof(stringsWithValues[i].entryStringImp3);
	imp4.secHtEff= atof(stringsWithValues[i].entryStringImp4);
    imp5.secHtEff= atof(stringsWithValues[i++].entryStringImp5);

	secHtFraction= atof(stringsWithValues[i].entryString);
	base.secHtFraction= atof(stringsWithValues[i].entryStringBase);
	imp1.secHtFraction= atof(stringsWithValues[i].entryStringImp1);
	imp2.secHtFraction= atof(stringsWithValues[i].entryStringImp2);
	imp3.secHtFraction= atof(stringsWithValues[i].entryStringImp3);
	imp4.secHtFraction= atof(stringsWithValues[i].entryStringImp4);
    imp5.secHtFraction= atof(stringsWithValues[i++].entryStringImp5);

	//------------------------------------------------------
	// WATER HEATING
	//------------------------------------------------------
	btnWaterHtFromMainState      = atoi(stringsWithValues[i].entryString);
	base.btnWaterHtFromMainState = atoi(stringsWithValues[i].entryStringBase);
	imp1.btnWaterHtFromMainState = atoi(stringsWithValues[i].entryStringImp1);
	imp2.btnWaterHtFromMainState = atoi(stringsWithValues[i].entryStringImp2);
	imp3.btnWaterHtFromMainState = atoi(stringsWithValues[i].entryStringImp3);
	imp4.btnWaterHtFromMainState = atoi(stringsWithValues[i].entryStringImp4);
    imp5.btnWaterHtFromMainState = atoi(stringsWithValues[i++].entryStringImp5);

	WHtype      = stringsWithValues[i].entryString;
	base.WHtype = stringsWithValues[i].entryStringBase;
	imp1.WHtype = stringsWithValues[i].entryStringImp1;
	imp2.WHtype = stringsWithValues[i].entryStringImp2;
	imp3.WHtype = stringsWithValues[i].entryStringImp3;
	imp4.WHtype = stringsWithValues[i].entryStringImp4;
    imp5.WHtype = stringsWithValues[i++].entryStringImp5;

	WHtCylinderWithinDwelling      = stringsWithValues[i].entryString;
	base.WHtCylinderWithinDwelling = stringsWithValues[i].entryStringBase;
	imp1.WHtCylinderWithinDwelling = stringsWithValues[i].entryStringImp1;
	imp2.WHtCylinderWithinDwelling = stringsWithValues[i].entryStringImp2;
	imp3.WHtCylinderWithinDwelling = stringsWithValues[i].entryStringImp3;
	imp4.WHtCylinderWithinDwelling = stringsWithValues[i].entryStringImp4;
    imp5.WHtCylinderWithinDwelling = stringsWithValues[i++].entryStringImp5;

	WHtFuel      = stringsWithValues[i].entryString;
	base.WHtFuel = stringsWithValues[i].entryStringBase;
	imp1.WHtFuel = stringsWithValues[i].entryStringImp1;
	imp2.WHtFuel = stringsWithValues[i].entryStringImp2;
	imp3.WHtFuel = stringsWithValues[i].entryStringImp3;
	imp4.WHtFuel = stringsWithValues[i].entryStringImp4;
    imp5.WHtFuel = stringsWithValues[i++].entryStringImp5;

	WHtWaterSepTimed      = stringsWithValues[i].entryString;
	base.WHtWaterSepTimed = stringsWithValues[i].entryStringBase;
	imp1.WHtWaterSepTimed = stringsWithValues[i].entryStringImp1;
	imp2.WHtWaterSepTimed = stringsWithValues[i].entryStringImp2;
	imp3.WHtWaterSepTimed = stringsWithValues[i].entryStringImp3;
	imp4.WHtWaterSepTimed = stringsWithValues[i].entryStringImp4;
    imp5.WHtWaterSepTimed = stringsWithValues[i++].entryStringImp5;

	WHtCylManufactLossFactor      = stringsWithValues[i].entryString;
	base.WHtCylManufactLossFactor = stringsWithValues[i].entryStringBase;
	imp1.WHtCylManufactLossFactor = stringsWithValues[i].entryStringImp1;
	imp2.WHtCylManufactLossFactor = stringsWithValues[i].entryStringImp2;
	imp3.WHtCylManufactLossFactor = stringsWithValues[i].entryStringImp3;
	imp4.WHtCylManufactLossFactor = stringsWithValues[i].entryStringImp4;
    imp5.WHtCylManufactLossFactor = stringsWithValues[i++].entryStringImp5;

	WHtCylDeclaredFactor      = atof(stringsWithValues[i].entryString);
	base.WHtCylDeclaredFactor = atof(stringsWithValues[i].entryStringBase);
	imp1.WHtCylDeclaredFactor = atof(stringsWithValues[i].entryStringImp1);
	imp2.WHtCylDeclaredFactor = atof(stringsWithValues[i].entryStringImp2);
	imp3.WHtCylDeclaredFactor = atof(stringsWithValues[i].entryStringImp3);
	imp4.WHtCylDeclaredFactor = atof(stringsWithValues[i].entryStringImp4);
    imp5.WHtCylDeclaredFactor = atof(stringsWithValues[i++].entryStringImp5);

	WHtCylVolume      = atof(stringsWithValues[i].entryString);
	base.WHtCylVolume = atof(stringsWithValues[i].entryStringBase);
	imp1.WHtCylVolume = atof(stringsWithValues[i].entryStringImp1);
	imp2.WHtCylVolume = atof(stringsWithValues[i].entryStringImp2);
	imp3.WHtCylVolume = atof(stringsWithValues[i].entryStringImp3);
	imp4.WHtCylVolume = atof(stringsWithValues[i].entryStringImp4);
    imp5.WHtCylVolume = atof(stringsWithValues[i++].entryStringImp5);

	WHtCylInsType      = stringsWithValues[i].entryString;
	base.WHtCylInsType = stringsWithValues[i].entryStringBase;
	imp1.WHtCylInsType = stringsWithValues[i].entryStringImp1;
	imp2.WHtCylInsType = stringsWithValues[i].entryStringImp2;
	imp3.WHtCylInsType = stringsWithValues[i].entryStringImp3;
	imp4.WHtCylInsType = stringsWithValues[i].entryStringImp4;
    imp5.WHtCylInsType = stringsWithValues[i++].entryStringImp5;

	WHtCylInsThickness      = atof(stringsWithValues[i].entryString);
	base.WHtCylInsThickness = atof(stringsWithValues[i].entryStringBase);
	imp1.WHtCylInsThickness = atof(stringsWithValues[i].entryStringImp1);
	imp2.WHtCylInsThickness = atof(stringsWithValues[i].entryStringImp2);
	imp3.WHtCylInsThickness = atof(stringsWithValues[i].entryStringImp3);
	imp4.WHtCylInsThickness = atof(stringsWithValues[i].entryStringImp4);
    imp5.WHtCylInsThickness = atof(stringsWithValues[i++].entryStringImp5);

	WHtCylThermostat      = stringsWithValues[i].entryString;
	base.WHtCylThermostat = stringsWithValues[i].entryStringBase;
	imp1.WHtCylThermostat = stringsWithValues[i].entryStringImp1;
	imp2.WHtCylThermostat = stringsWithValues[i].entryStringImp2;
	imp3.WHtCylThermostat = stringsWithValues[i].entryStringImp3;
	imp4.WHtCylThermostat = stringsWithValues[i].entryStringImp4;
    imp5.WHtCylThermostat = stringsWithValues[i++].entryStringImp5;

	WHtCylInHeatedSpace      = stringsWithValues[i].entryString;
	base.WHtCylInHeatedSpace = stringsWithValues[i].entryStringBase;
	imp1.WHtCylInHeatedSpace = stringsWithValues[i].entryStringImp1;
	imp2.WHtCylInHeatedSpace = stringsWithValues[i].entryStringImp2;
	imp3.WHtCylInHeatedSpace = stringsWithValues[i].entryStringImp3;
	imp4.WHtCylInHeatedSpace = stringsWithValues[i].entryStringImp4;
    imp5.WHtCylInHeatedSpace = stringsWithValues[i++].entryStringImp5;

	WHtCylPrimaryPipeworkInsulated      = stringsWithValues[i].entryString;
	base.WHtCylPrimaryPipeworkInsulated = stringsWithValues[i].entryStringBase;
	imp1.WHtCylPrimaryPipeworkInsulated = stringsWithValues[i].entryStringImp1;
	imp2.WHtCylPrimaryPipeworkInsulated = stringsWithValues[i].entryStringImp2;
	imp3.WHtCylPrimaryPipeworkInsulated = stringsWithValues[i].entryStringImp3;
	imp4.WHtCylPrimaryPipeworkInsulated = stringsWithValues[i].entryStringImp4;
    imp5.WHtCylPrimaryPipeworkInsulated = stringsWithValues[i++].entryStringImp5;

	WHtCylPumpedPrimarySystem      = stringsWithValues[i].entryString;
	base.WHtCylPumpedPrimarySystem = stringsWithValues[i].entryStringBase;
	imp1.WHtCylPumpedPrimarySystem = stringsWithValues[i].entryStringImp1;
	imp2.WHtCylPumpedPrimarySystem = stringsWithValues[i].entryStringImp2;
	imp3.WHtCylPumpedPrimarySystem = stringsWithValues[i].entryStringImp3;
	imp4.WHtCylPumpedPrimarySystem = stringsWithValues[i].entryStringImp4;
    imp5.WHtCylPumpedPrimarySystem = stringsWithValues[i++].entryStringImp5;

	WHtEff      = atof(stringsWithValues[i].entryString);
	base.WHtEff = atof(stringsWithValues[i].entryStringBase);
	imp1.WHtEff = atof(stringsWithValues[i].entryStringImp1);
	imp2.WHtEff = atof(stringsWithValues[i].entryStringImp2);
	imp3.WHtEff = atof(stringsWithValues[i].entryStringImp3);
	imp4.WHtEff = atof(stringsWithValues[i].entryStringImp4);
    imp5.WHtEff = atof(stringsWithValues[i++].entryStringImp5);

	WHtTSnCPSUinSingleUnit      = stringsWithValues[i].entryString;
	base.WHtTSnCPSUinSingleUnit = stringsWithValues[i].entryStringBase;
	imp1.WHtTSnCPSUinSingleUnit = stringsWithValues[i].entryStringImp1;
	imp2.WHtTSnCPSUinSingleUnit = stringsWithValues[i].entryStringImp2;
	imp3.WHtTSnCPSUinSingleUnit = stringsWithValues[i].entryStringImp3;
	imp4.WHtTSnCPSUinSingleUnit = stringsWithValues[i].entryStringImp4;
    imp5.WHtTSnCPSUinSingleUnit = stringsWithValues[i++].entryStringImp5;

	WHtTSnCPSUPrimaryPipeworkLT1_5m      = stringsWithValues[i].entryString;
	base.WHtTSnCPSUPrimaryPipeworkLT1_5m = stringsWithValues[i].entryStringBase;
	imp1.WHtTSnCPSUPrimaryPipeworkLT1_5m = stringsWithValues[i].entryStringImp1;
	imp2.WHtTSnCPSUPrimaryPipeworkLT1_5m = stringsWithValues[i].entryStringImp2;
	imp3.WHtTSnCPSUPrimaryPipeworkLT1_5m = stringsWithValues[i].entryStringImp3;
	imp4.WHtTSnCPSUPrimaryPipeworkLT1_5m = stringsWithValues[i].entryStringImp4;
    imp5.WHtTSnCPSUPrimaryPipeworkLT1_5m = stringsWithValues[i++].entryStringImp5;

	WHtTSnCPSUstoreInAirCupbrd      = stringsWithValues[i].entryString;
	base.WHtTSnCPSUstoreInAirCupbrd = stringsWithValues[i].entryStringBase;
	imp1.WHtTSnCPSUstoreInAirCupbrd = stringsWithValues[i].entryStringImp1;
	imp2.WHtTSnCPSUstoreInAirCupbrd = stringsWithValues[i].entryStringImp2;
	imp3.WHtTSnCPSUstoreInAirCupbrd = stringsWithValues[i].entryStringImp3;
	imp4.WHtTSnCPSUstoreInAirCupbrd = stringsWithValues[i].entryStringImp4;
    imp5.WHtTSnCPSUstoreInAirCupbrd = stringsWithValues[i++].entryStringImp5;

	WHtCombiKeepHotYN      = stringsWithValues[i].entryString;
	base.WHtCombiKeepHotYN = stringsWithValues[i].entryStringBase;
	imp1.WHtCombiKeepHotYN = stringsWithValues[i].entryStringImp1;
	imp2.WHtCombiKeepHotYN = stringsWithValues[i].entryStringImp2;
	imp3.WHtCombiKeepHotYN = stringsWithValues[i].entryStringImp3;
	imp4.WHtCombiKeepHotYN = stringsWithValues[i].entryStringImp4;
    imp5.WHtCombiKeepHotYN = stringsWithValues[i++].entryStringImp5;

	DHWfromCommunityScheme      = stringsWithValues[i].entryString;
	base.DHWfromCommunityScheme = stringsWithValues[i].entryStringBase;
	imp1.DHWfromCommunityScheme = stringsWithValues[i].entryStringImp1;
	imp2.DHWfromCommunityScheme = stringsWithValues[i].entryStringImp2;
	imp3.DHWfromCommunityScheme = stringsWithValues[i].entryStringImp3;
	imp4.DHWfromCommunityScheme = stringsWithValues[i].entryStringImp4;
    imp5.DHWfromCommunityScheme = stringsWithValues[i++].entryStringImp5;

	WHtHeatPumpUsesImmer      = stringsWithValues[i].entryString;
	base.WHtHeatPumpUsesImmer = stringsWithValues[i].entryStringBase;
	imp1.WHtHeatPumpUsesImmer = stringsWithValues[i].entryStringImp1;
	imp2.WHtHeatPumpUsesImmer = stringsWithValues[i].entryStringImp2;
	imp3.WHtHeatPumpUsesImmer = stringsWithValues[i].entryStringImp3;
	imp4.WHtHeatPumpUsesImmer = stringsWithValues[i].entryStringImp4;
    imp5.WHtHeatPumpUsesImmer = stringsWithValues[i++].entryStringImp5;

	WHtUsesSummerImmer      = stringsWithValues[i].entryString;
	base.WHtUsesSummerImmer = stringsWithValues[i].entryStringBase;
	imp1.WHtUsesSummerImmer = stringsWithValues[i].entryStringImp1;
	imp2.WHtUsesSummerImmer = stringsWithValues[i].entryStringImp2;
	imp3.WHtUsesSummerImmer = stringsWithValues[i].entryStringImp3;
	imp4.WHtUsesSummerImmer = stringsWithValues[i].entryStringImp4;
    imp5.WHtUsesSummerImmer = stringsWithValues[i++].entryStringImp5;

	//------------------------------------------------------
	//	RENEWABLES
	//------------------------------------------------------
	isSHWPresent      = stringsWithValues[i].entryString;
	base.isSHWPresent = stringsWithValues[i].entryStringBase;
	imp1.isSHWPresent = stringsWithValues[i].entryStringImp1;
	imp2.isSHWPresent = stringsWithValues[i].entryStringImp2;
	imp3.isSHWPresent = stringsWithValues[i].entryStringImp3;
	imp4.isSHWPresent = stringsWithValues[i].entryStringImp4;
    imp5.isSHWPresent = stringsWithValues[i++].entryStringImp5;

	SHWCollectorType      = stringsWithValues[i].entryString;
	base.SHWCollectorType = stringsWithValues[i].entryStringBase;
	imp1.SHWCollectorType = stringsWithValues[i].entryStringImp1;
	imp2.SHWCollectorType = stringsWithValues[i].entryStringImp2;
	imp3.SHWCollectorType = stringsWithValues[i].entryStringImp3;
	imp4.SHWCollectorType = stringsWithValues[i].entryStringImp4;
    imp5.SHWCollectorType = stringsWithValues[i++].entryStringImp5;

	SHWCollectorOrientation      = stringsWithValues[i].entryString;
	base.SHWCollectorOrientation = stringsWithValues[i].entryStringBase;
	imp1.SHWCollectorOrientation = stringsWithValues[i].entryStringImp1;
	imp2.SHWCollectorOrientation = stringsWithValues[i].entryStringImp2;
	imp3.SHWCollectorOrientation = stringsWithValues[i].entryStringImp3;
	imp4.SHWCollectorOrientation = stringsWithValues[i].entryStringImp4;
    imp5.SHWCollectorOrientation = stringsWithValues[i++].entryStringImp5;

	SHWCollectorTilt      = stringsWithValues[i].entryString;
	base.SHWCollectorTilt = stringsWithValues[i].entryStringBase;
	imp1.SHWCollectorTilt = stringsWithValues[i].entryStringImp1;
	imp2.SHWCollectorTilt = stringsWithValues[i].entryStringImp2;
	imp3.SHWCollectorTilt = stringsWithValues[i].entryStringImp3;
	imp4.SHWCollectorTilt = stringsWithValues[i].entryStringImp4;
    imp5.SHWCollectorTilt = stringsWithValues[i++].entryStringImp5;

	SHWOvershading      = stringsWithValues[i].entryString;
	base.SHWOvershading = stringsWithValues[i].entryStringBase;
	imp1.SHWOvershading = stringsWithValues[i].entryStringImp1;
	imp2.SHWOvershading = stringsWithValues[i].entryStringImp2;
	imp3.SHWOvershading = stringsWithValues[i].entryStringImp3;
	imp4.SHWOvershading = stringsWithValues[i].entryStringImp4;
    imp5.SHWOvershading = stringsWithValues[i++].entryStringImp5;

	isSHWAreaGross      = stringsWithValues[i].entryString;
	base.isSHWAreaGross = stringsWithValues[i].entryStringBase;
	imp1.isSHWAreaGross = stringsWithValues[i].entryStringImp1;
	imp2.isSHWAreaGross = stringsWithValues[i].entryStringImp2;
	imp3.isSHWAreaGross = stringsWithValues[i].entryStringImp3;
	imp4.isSHWAreaGross = stringsWithValues[i].entryStringImp4;
    imp5.isSHWAreaGross = stringsWithValues[i++].entryStringImp5;

	SHWApertureArea      = atof(stringsWithValues[i].entryString);
	base.SHWApertureArea = atof(stringsWithValues[i].entryStringBase);
	imp1.SHWApertureArea = atof(stringsWithValues[i].entryStringImp1);
	imp2.SHWApertureArea = atof(stringsWithValues[i].entryStringImp2);
	imp3.SHWApertureArea = atof(stringsWithValues[i].entryStringImp3);
	imp4.SHWApertureArea = atof(stringsWithValues[i].entryStringImp4);
    imp5.SHWApertureArea = atof(stringsWithValues[i++].entryStringImp5);

	SHW_ZLCE      = atof(stringsWithValues[i].entryString);
	base.SHW_ZLCE = atof(stringsWithValues[i].entryStringBase);
	imp1.SHW_ZLCE = atof(stringsWithValues[i].entryStringImp1);
	imp2.SHW_ZLCE = atof(stringsWithValues[i].entryStringImp2);
	imp3.SHW_ZLCE = atof(stringsWithValues[i].entryStringImp3);
	imp4.SHW_ZLCE = atof(stringsWithValues[i].entryStringImp4);
    imp5.SHW_ZLCE = atof(stringsWithValues[i++].entryStringImp5);

	SHW_HeatLossCoefficient      = atof(stringsWithValues[i].entryString);
	base.SHW_HeatLossCoefficient = atof(stringsWithValues[i].entryStringBase);
	imp1.SHW_HeatLossCoefficient = atof(stringsWithValues[i].entryStringImp1);
	imp2.SHW_HeatLossCoefficient = atof(stringsWithValues[i].entryStringImp2);
	imp3.SHW_HeatLossCoefficient = atof(stringsWithValues[i].entryStringImp3);
	imp4.SHW_HeatLossCoefficient = atof(stringsWithValues[i].entryStringImp4);
    imp5.SHW_HeatLossCoefficient = atof(stringsWithValues[i++].entryStringImp5);

	isSHWSolarStoreCombined      = stringsWithValues[i].entryString;
	base.isSHWSolarStoreCombined = stringsWithValues[i].entryStringBase;
	imp1.isSHWSolarStoreCombined = stringsWithValues[i].entryStringImp1;
	imp2.isSHWSolarStoreCombined = stringsWithValues[i].entryStringImp2;
	imp3.isSHWSolarStoreCombined = stringsWithValues[i].entryStringImp3;
	imp4.isSHWSolarStoreCombined = stringsWithValues[i].entryStringImp4;
    imp5.isSHWSolarStoreCombined = stringsWithValues[i++].entryStringImp5;

	SHWDedSolStoreVol      = atof(stringsWithValues[i].entryString);
	base.SHWDedSolStoreVol = atof(stringsWithValues[i].entryStringBase);
	imp1.SHWDedSolStoreVol = atof(stringsWithValues[i].entryStringImp1);
	imp2.SHWDedSolStoreVol = atof(stringsWithValues[i].entryStringImp2);
	imp3.SHWDedSolStoreVol = atof(stringsWithValues[i].entryStringImp3);
	imp4.SHWDedSolStoreVol = atof(stringsWithValues[i].entryStringImp4);
    imp5.SHWDedSolStoreVol = atof(stringsWithValues[i++].entryStringImp5);

	SHWSolarCircPump      = stringsWithValues[i].entryString;
	base.SHWSolarCircPump = stringsWithValues[i].entryStringBase;
	imp1.SHWSolarCircPump = stringsWithValues[i].entryStringImp1;
	imp2.SHWSolarCircPump = stringsWithValues[i].entryStringImp2;
	imp3.SHWSolarCircPump = stringsWithValues[i].entryStringImp3;
	imp4.SHWSolarCircPump = stringsWithValues[i].entryStringImp4;
    imp5.SHWSolarCircPump = stringsWithValues[i++].entryStringImp5;

	isPVPresent      = stringsWithValues[i].entryString;
	base.isPVPresent = stringsWithValues[i].entryStringBase;
	imp1.isPVPresent = stringsWithValues[i].entryStringImp1;
	imp2.isPVPresent = stringsWithValues[i].entryStringImp2;
	imp3.isPVPresent = stringsWithValues[i].entryStringImp3;
	imp4.isPVPresent = stringsWithValues[i].entryStringImp4;
    imp5.isPVPresent = stringsWithValues[i++].entryStringImp5;

	installedPVPeakPower      = atof(stringsWithValues[i].entryString);
	base.installedPVPeakPower = atof(stringsWithValues[i].entryStringBase);
	imp1.installedPVPeakPower = atof(stringsWithValues[i].entryStringImp1);
	imp2.installedPVPeakPower = atof(stringsWithValues[i].entryStringImp2);
	imp3.installedPVPeakPower = atof(stringsWithValues[i].entryStringImp3);
	imp4.installedPVPeakPower = atof(stringsWithValues[i].entryStringImp4);
    imp5.installedPVPeakPower = atof(stringsWithValues[i++].entryStringImp5);

	PVCollectorOrientation      = stringsWithValues[i].entryString;
	base.PVCollectorOrientation = stringsWithValues[i].entryStringBase;
	imp1.PVCollectorOrientation = stringsWithValues[i].entryStringImp1;
	imp2.PVCollectorOrientation = stringsWithValues[i].entryStringImp2;
	imp3.PVCollectorOrientation = stringsWithValues[i].entryStringImp3;
	imp4.PVCollectorOrientation = stringsWithValues[i].entryStringImp4;
    imp5.PVCollectorOrientation = stringsWithValues[i++].entryStringImp5;

	PVCollectorTilt      = stringsWithValues[i].entryString;
	base.PVCollectorTilt = stringsWithValues[i].entryStringBase;
	imp1.PVCollectorTilt = stringsWithValues[i].entryStringImp1;
	imp2.PVCollectorTilt = stringsWithValues[i].entryStringImp2;
	imp3.PVCollectorTilt = stringsWithValues[i].entryStringImp3;
	imp4.PVCollectorTilt = stringsWithValues[i].entryStringImp4;
    imp5.PVCollectorTilt = stringsWithValues[i++].entryStringImp5;

	PVOvershading      = stringsWithValues[i].entryString;
	base.PVOvershading = stringsWithValues[i].entryStringBase;
	imp1.PVOvershading = stringsWithValues[i].entryStringImp1;
	imp2.PVOvershading = stringsWithValues[i].entryStringImp2;
	imp3.PVOvershading = stringsWithValues[i].entryStringImp3;
	imp4.PVOvershading = stringsWithValues[i].entryStringImp4;
    imp5.PVOvershading = stringsWithValues[i++].entryStringImp5;

	isWTPresent      = stringsWithValues[i].entryString;
	base.isWTPresent = stringsWithValues[i].entryStringBase;
	imp1.isWTPresent = stringsWithValues[i].entryStringImp1;
	imp2.isWTPresent = stringsWithValues[i].entryStringImp2;
	imp3.isWTPresent = stringsWithValues[i].entryStringImp3;
	imp4.isWTPresent = stringsWithValues[i].entryStringImp4;
    imp5.isWTPresent = stringsWithValues[i++].entryStringImp5;

	WTNumOf      = atoi(stringsWithValues[i].entryString);
	base.WTNumOf = atoi(stringsWithValues[i].entryStringBase);
	imp1.WTNumOf = atoi(stringsWithValues[i].entryStringImp1);
	imp2.WTNumOf = atoi(stringsWithValues[i].entryStringImp2);
	imp3.WTNumOf = atoi(stringsWithValues[i].entryStringImp3);
	imp4.WTNumOf = atoi(stringsWithValues[i].entryStringImp4);
    imp5.WTNumOf = atoi(stringsWithValues[i++].entryStringImp5);

	WTDiameter      = atof(stringsWithValues[i].entryString);
	base.WTDiameter = atof(stringsWithValues[i].entryStringBase);
	imp1.WTDiameter = atof(stringsWithValues[i].entryStringImp1);
	imp2.WTDiameter = atof(stringsWithValues[i].entryStringImp2);
	imp3.WTDiameter = atof(stringsWithValues[i].entryStringImp3);
	imp4.WTDiameter = atof(stringsWithValues[i].entryStringImp4);
    imp5.WTDiameter = atof(stringsWithValues[i++].entryStringImp5);

	WTHeight      = atof(stringsWithValues[i].entryString);
	base.WTHeight = atof(stringsWithValues[i].entryStringBase);
	imp1.WTHeight = atof(stringsWithValues[i].entryStringImp1);
	imp2.WTHeight = atof(stringsWithValues[i].entryStringImp2);
	imp3.WTHeight = atof(stringsWithValues[i].entryStringImp3);
	imp4.WTHeight = atof(stringsWithValues[i].entryStringImp4);
    imp5.WTHeight = atof(stringsWithValues[i++].entryStringImp5);

	uHydroyn      = stringsWithValues[i].entryString;
	base.uHydroyn = stringsWithValues[i].entryStringBase;
	imp1.uHydroyn = stringsWithValues[i].entryStringImp1;
	imp2.uHydroyn = stringsWithValues[i].entryStringImp2;
	imp3.uHydroyn = stringsWithValues[i].entryStringImp3;
	imp4.uHydroyn = stringsWithValues[i].entryStringImp4;
    imp5.uHydroyn = stringsWithValues[i++].entryStringImp5;

	uHydroAnnualAvgHead      = atof(stringsWithValues[i].entryString);
	base.uHydroAnnualAvgHead = atof(stringsWithValues[i].entryStringBase);
	imp1.uHydroAnnualAvgHead = atof(stringsWithValues[i].entryStringImp1);
	imp2.uHydroAnnualAvgHead = atof(stringsWithValues[i].entryStringImp2);
	imp3.uHydroAnnualAvgHead = atof(stringsWithValues[i].entryStringImp3);
	imp4.uHydroAnnualAvgHead = atof(stringsWithValues[i].entryStringImp4);
    imp5.uHydroAnnualAvgHead = atof(stringsWithValues[i++].entryStringImp5);

	uHydroAnnualAvgFlow      = atof(stringsWithValues[i].entryString);
	base.uHydroAnnualAvgFlow = atof(stringsWithValues[i].entryStringBase);
	imp1.uHydroAnnualAvgFlow = atof(stringsWithValues[i].entryStringImp1);
	imp2.uHydroAnnualAvgFlow = atof(stringsWithValues[i].entryStringImp2);
	imp3.uHydroAnnualAvgFlow = atof(stringsWithValues[i].entryStringImp3);
	imp4.uHydroAnnualAvgFlow = atof(stringsWithValues[i].entryStringImp4);
    imp5.uHydroAnnualAvgFlow = atof(stringsWithValues[i++].entryStringImp5);

	uHydroEff      = atof(stringsWithValues[i].entryString);
	base.uHydroEff = atof(stringsWithValues[i].entryStringBase);
	imp1.uHydroEff = atof(stringsWithValues[i].entryStringImp1);
	imp2.uHydroEff = atof(stringsWithValues[i].entryStringImp2);
	imp3.uHydroEff = atof(stringsWithValues[i].entryStringImp3);
	imp4.uHydroEff = atof(stringsWithValues[i].entryStringImp4);
    imp5.uHydroEff = atof(stringsWithValues[i++].entryStringImp5);

	uCHPyn      = stringsWithValues[i].entryString;
	base.uCHPyn = stringsWithValues[i].entryStringBase;
	imp1.uCHPyn = stringsWithValues[i].entryStringImp1;
	imp2.uCHPyn = stringsWithValues[i].entryStringImp2;
	imp3.uCHPyn = stringsWithValues[i].entryStringImp3;
	imp4.uCHPyn = stringsWithValues[i].entryStringImp4;
    imp5.uCHPyn = stringsWithValues[i++].entryStringImp5;

	uCHPheatToPowerRatio      = atof(stringsWithValues[i].entryString);
	base.uCHPheatToPowerRatio = atof(stringsWithValues[i].entryStringBase);
	imp1.uCHPheatToPowerRatio = atof(stringsWithValues[i].entryStringImp1);
	imp2.uCHPheatToPowerRatio = atof(stringsWithValues[i].entryStringImp2);
	imp3.uCHPheatToPowerRatio = atof(stringsWithValues[i].entryStringImp3);
	imp4.uCHPheatToPowerRatio = atof(stringsWithValues[i].entryStringImp4);
    imp5.uCHPheatToPowerRatio = atof(stringsWithValues[i++].entryStringImp5);

	uCHPElectricEff      = atof(stringsWithValues[i].entryString);
	base.uCHPElectricEff = atof(stringsWithValues[i].entryStringBase);
	imp1.uCHPElectricEff = atof(stringsWithValues[i].entryStringImp1);
	imp2.uCHPElectricEff = atof(stringsWithValues[i].entryStringImp2);
	imp3.uCHPElectricEff = atof(stringsWithValues[i].entryStringImp3);
	imp4.uCHPElectricEff = atof(stringsWithValues[i].entryStringImp4);
    imp5.uCHPElectricEff = atof(stringsWithValues[i++].entryStringImp5);

	CHPFuel      = stringsWithValues[i].entryString;
	base.CHPFuel = stringsWithValues[i].entryStringBase;
	imp1.CHPFuel = stringsWithValues[i].entryStringImp1;
	imp2.CHPFuel = stringsWithValues[i].entryStringImp2;
	imp3.CHPFuel = stringsWithValues[i].entryStringImp3;
	imp4.CHPFuel = stringsWithValues[i].entryStringImp4;
    imp5.CHPFuel = stringsWithValues[i++].entryStringImp5;

	uCHPHeatingEff      = atof(stringsWithValues[i].entryString);
	base.uCHPHeatingEff = atof(stringsWithValues[i].entryStringBase);
	imp1.uCHPHeatingEff = atof(stringsWithValues[i].entryStringImp1);
	imp2.uCHPHeatingEff = atof(stringsWithValues[i].entryStringImp2);
	imp3.uCHPHeatingEff = atof(stringsWithValues[i].entryStringImp3);
	imp4.uCHPHeatingEff = atof(stringsWithValues[i].entryStringImp4);
    imp5.uCHPHeatingEff = atof(stringsWithValues[i++].entryStringImp5);

	uCHPHeatingFraction= atof(stringsWithValues[i].entryString);
	base.uCHPHeatingFraction= atof(stringsWithValues[i].entryStringBase);
	imp1.uCHPHeatingFraction= atof(stringsWithValues[i].entryStringImp1);
	imp2.uCHPHeatingFraction= atof(stringsWithValues[i].entryStringImp2);
	imp3.uCHPHeatingFraction= atof(stringsWithValues[i].entryStringImp3);
	imp4.uCHPHeatingFraction= atof(stringsWithValues[i].entryStringImp4);
    imp5.uCHPHeatingFraction= atof(stringsWithValues[i++].entryStringImp5);

	MVHRyn= stringsWithValues[i].entryString;
	base.MVHRyn= stringsWithValues[i].entryStringBase;
	imp1.MVHRyn= stringsWithValues[i].entryStringImp1;
	imp2.MVHRyn= stringsWithValues[i].entryStringImp2;
	imp3.MVHRyn= stringsWithValues[i].entryStringImp3;
	imp4.MVHRyn= stringsWithValues[i].entryStringImp4;
    imp5.MVHRyn= stringsWithValues[i++].entryStringImp5;

	MVHRThermalEff= atof(stringsWithValues[i].entryString);
	base.MVHRThermalEff= atof(stringsWithValues[i].entryStringBase);
	imp1.MVHRThermalEff= atof(stringsWithValues[i].entryStringImp1);
	imp2.MVHRThermalEff= atof(stringsWithValues[i].entryStringImp2);
	imp3.MVHRThermalEff= atof(stringsWithValues[i].entryStringImp3);
	imp4.MVHRThermalEff= atof(stringsWithValues[i].entryStringImp4);
    imp5.MVHRThermalEff= atof(stringsWithValues[i++].entryStringImp5);

	WWHRSpresent = stringsWithValues[i].entryString;
	base.WWHRSpresent = stringsWithValues[i].entryStringBase;
	imp1.WWHRSpresent = stringsWithValues[i].entryStringImp1;
	imp2.WWHRSpresent = stringsWithValues[i].entryStringImp2;
	imp3.WWHRSpresent = stringsWithValues[i].entryStringImp3;
	imp4.WWHRSpresent = stringsWithValues[i].entryStringImp4;
	imp5.WWHRSpresent = stringsWithValues[i++].entryStringImp5;

	WWHRSnumOfRooms      = atoi(stringsWithValues[i].entryString);
	base.WWHRSnumOfRooms = atoi(stringsWithValues[i].entryStringBase);
	imp1.WWHRSnumOfRooms = atoi(stringsWithValues[i].entryStringImp1);
	imp2.WWHRSnumOfRooms = atoi(stringsWithValues[i].entryStringImp2);
	imp3.WWHRSnumOfRooms = atoi(stringsWithValues[i].entryStringImp3);
	imp4.WWHRSnumOfRooms = atoi(stringsWithValues[i].entryStringImp4);
	imp5.WWHRSnumOfRooms = atoi(stringsWithValues[i++].entryStringImp5);

	WWHRS1Make      = stringsWithValues[i].entryString;
	base.WWHRS1Make = stringsWithValues[i].entryStringBase;
	imp1.WWHRS1Make = stringsWithValues[i].entryStringImp1;
	imp2.WWHRS1Make = stringsWithValues[i].entryStringImp2;
	imp3.WWHRS1Make = stringsWithValues[i].entryStringImp3;
	imp4.WWHRS1Make = stringsWithValues[i].entryStringImp4;
	imp5.WWHRS1Make = stringsWithValues[i++].entryStringImp5;

	WWHRS1Model      = stringsWithValues[i].entryString;
	base.WWHRS1Model = stringsWithValues[i].entryStringBase;
	imp1.WWHRS1Model = stringsWithValues[i].entryStringImp1;
	imp2.WWHRS1Model = stringsWithValues[i].entryStringImp2;
	imp3.WWHRS1Model = stringsWithValues[i].entryStringImp3;
	imp4.WWHRS1Model = stringsWithValues[i].entryStringImp4;
	imp5.WWHRS1Model = stringsWithValues[i++].entryStringImp4;

	WWHRS1ModelQualifier      = stringsWithValues[i].entryString;
	base.WWHRS1ModelQualifier = stringsWithValues[i].entryStringBase;
	imp1.WWHRS1ModelQualifier = stringsWithValues[i].entryStringImp1;
	imp2.WWHRS1ModelQualifier = stringsWithValues[i].entryStringImp2;
	imp3.WWHRS1ModelQualifier = stringsWithValues[i].entryStringImp3;
	imp4.WWHRS1ModelQualifier = stringsWithValues[i].entryStringImp4;
	imp5.WWHRS1ModelQualifier = stringsWithValues[i++].entryStringImp5;

	WWHRSnumMixerShowersWithBath1      = atoi(stringsWithValues[i].entryString);
	base.WWHRSnumMixerShowersWithBath1 = atoi(stringsWithValues[i].entryStringBase);
	imp1.WWHRSnumMixerShowersWithBath1 = atoi(stringsWithValues[i].entryStringImp1);
	imp2.WWHRSnumMixerShowersWithBath1 = atoi(stringsWithValues[i].entryStringImp2);
	imp3.WWHRSnumMixerShowersWithBath1 = atoi(stringsWithValues[i].entryStringImp3);
	imp4.WWHRSnumMixerShowersWithBath1 = atoi(stringsWithValues[i].entryStringImp4);
	imp5.WWHRSnumMixerShowersWithBath1 = atoi(stringsWithValues[i++].entryStringImp5);

	WWHRSnumMixerShowersWithoutBath1      = atoi(stringsWithValues[i].entryString);
	base.WWHRSnumMixerShowersWithoutBath1 = atoi(stringsWithValues[i].entryStringBase);
	imp1.WWHRSnumMixerShowersWithoutBath1 = atoi(stringsWithValues[i].entryStringImp1);
	imp2.WWHRSnumMixerShowersWithoutBath1 = atoi(stringsWithValues[i].entryStringImp2);
	imp3.WWHRSnumMixerShowersWithoutBath1 = atoi(stringsWithValues[i].entryStringImp3);
	imp4.WWHRSnumMixerShowersWithoutBath1 = atoi(stringsWithValues[i].entryStringImp4);
	imp5.WWHRSnumMixerShowersWithoutBath1 = atoi(stringsWithValues[i++].entryStringImp5);

	WWHRS2Make      = stringsWithValues[i].entryString;
	base.WWHRS2Make = stringsWithValues[i].entryStringBase;
	imp1.WWHRS2Make = stringsWithValues[i].entryStringImp1;
	imp2.WWHRS2Make = stringsWithValues[i].entryStringImp2;
	imp3.WWHRS2Make = stringsWithValues[i].entryStringImp3;
	imp4.WWHRS2Make = stringsWithValues[i].entryStringImp4;
	imp5.WWHRS2Make = stringsWithValues[i++].entryStringImp5;

	WWHRS2Model      = stringsWithValues[i].entryString;
	base.WWHRS2Model = stringsWithValues[i].entryStringBase;
	imp1.WWHRS2Model = stringsWithValues[i].entryStringImp1;
	imp2.WWHRS2Model = stringsWithValues[i].entryStringImp2;
	imp3.WWHRS2Model = stringsWithValues[i].entryStringImp3;
	imp4.WWHRS2Model = stringsWithValues[i].entryStringImp4;
	imp5.WWHRS2Model = stringsWithValues[i++].entryStringImp5;

	WWHRS2ModelQualifier      = stringsWithValues[i].entryString;
	base.WWHRS2ModelQualifier = stringsWithValues[i].entryStringBase;
	imp1.WWHRS2ModelQualifier = stringsWithValues[i].entryStringImp1;
	imp2.WWHRS2ModelQualifier = stringsWithValues[i].entryStringImp2;
	imp3.WWHRS2ModelQualifier = stringsWithValues[i].entryStringImp3;
	imp4.WWHRS2ModelQualifier = stringsWithValues[i].entryStringImp4;
	imp5.WWHRS2ModelQualifier = stringsWithValues[i++].entryStringImp5;

	WWHRSnumMixerShowersWithBath2      = atoi(stringsWithValues[i].entryString);
	base.WWHRSnumMixerShowersWithBath2 = atoi(stringsWithValues[i].entryStringBase);
	imp1.WWHRSnumMixerShowersWithBath2 = atoi(stringsWithValues[i].entryStringImp1);
	imp2.WWHRSnumMixerShowersWithBath2 = atoi(stringsWithValues[i].entryStringImp2);
	imp3.WWHRSnumMixerShowersWithBath2 = atoi(stringsWithValues[i].entryStringImp3);
	imp4.WWHRSnumMixerShowersWithBath2 = atoi(stringsWithValues[i].entryStringImp4);
	imp5.WWHRSnumMixerShowersWithBath2 = atoi(stringsWithValues[i++].entryStringImp5);

	WWHRSnumMixerShowersWithoutBath2      = atoi(stringsWithValues[i].entryString);
	base.WWHRSnumMixerShowersWithoutBath2 = atoi(stringsWithValues[i].entryStringBase);
	imp1.WWHRSnumMixerShowersWithoutBath2 = atoi(stringsWithValues[i].entryStringImp1);
	imp2.WWHRSnumMixerShowersWithoutBath2 = atoi(stringsWithValues[i].entryStringImp2);
	imp3.WWHRSnumMixerShowersWithoutBath2 = atoi(stringsWithValues[i].entryStringImp3);
	imp4.WWHRSnumMixerShowersWithoutBath2 = atoi(stringsWithValues[i].entryStringImp4);
	imp5.WWHRSnumMixerShowersWithoutBath2 = atoi(stringsWithValues[i++].entryStringImp5);

	FGHRSpresent= stringsWithValues[i].entryString;
	base.FGHRSpresent= stringsWithValues[i].entryStringBase;
	imp1.FGHRSpresent= stringsWithValues[i].entryStringImp1;
	imp2.FGHRSpresent= stringsWithValues[i].entryStringImp2;
	imp3.FGHRSpresent= stringsWithValues[i].entryStringImp3;
	imp4.FGHRSpresent= stringsWithValues[i].entryStringImp4;
    imp5.FGHRSpresent= stringsWithValues[i++].entryStringImp5;

	FGHRSstore= stringsWithValues[i].entryString;
	base.FGHRSstore= stringsWithValues[i].entryStringBase;
	imp1.FGHRSstore= stringsWithValues[i].entryStringImp1;
	imp2.FGHRSstore= stringsWithValues[i].entryStringImp2;
	imp3.FGHRSstore= stringsWithValues[i].entryStringImp3;
	imp4.FGHRSstore= stringsWithValues[i].entryStringImp4;
    imp5.FGHRSstore= stringsWithValues[i++].entryStringImp5;

	FGHRSstoreVolume      = atof(stringsWithValues[i].entryString);
	base.FGHRSstoreVolume = atof(stringsWithValues[i].entryStringBase);
	imp1.FGHRSstoreVolume = atof(stringsWithValues[i].entryStringImp1);
	imp2.FGHRSstoreVolume = atof(stringsWithValues[i].entryStringImp2);
	imp3.FGHRSstoreVolume = atof(stringsWithValues[i].entryStringImp3);
	imp4.FGHRSstoreVolume = atof(stringsWithValues[i].entryStringImp4);
    imp5.FGHRSstoreVolume = atof(stringsWithValues[i++].entryStringImp5);

	FGHRSusefulFracHtRec_kf1      = atof(stringsWithValues[i].entryString);
	base.FGHRSusefulFracHtRec_kf1 = atof(stringsWithValues[i].entryStringBase);
	imp1.FGHRSusefulFracHtRec_kf1 = atof(stringsWithValues[i].entryStringImp1);
	imp2.FGHRSusefulFracHtRec_kf1 = atof(stringsWithValues[i].entryStringImp2);
	imp3.FGHRSusefulFracHtRec_kf1 = atof(stringsWithValues[i].entryStringImp3);
	imp4.FGHRSusefulFracHtRec_kf1 = atof(stringsWithValues[i].entryStringImp4);
    imp5.FGHRSusefulFracHtRec_kf1 = atof(stringsWithValues[i++].entryStringImp5);

	FGHRSfittedMain = stringsWithValues[i].entryStringBase;
	base.FGHRSfittedMain = stringsWithValues[i].entryStringBase;
	imp1.FGHRSfittedMain = stringsWithValues[i].entryStringImp1;
	imp2.FGHRSfittedMain = stringsWithValues[i].entryStringImp2;
	imp3.FGHRSfittedMain = stringsWithValues[i].entryStringImp3;
	imp4.FGHRSfittedMain = stringsWithValues[i].entryStringImp4;
    imp5.FGHRSfittedMain = stringsWithValues[i++].entryStringImp5;

	FGHRSfittedSec = stringsWithValues[i].entryStringBase;
	base.FGHRSfittedSec = stringsWithValues[i].entryStringBase;
	imp1.FGHRSfittedSec = stringsWithValues[i].entryStringImp1;
	imp2.FGHRSfittedSec = stringsWithValues[i].entryStringImp2;
	imp3.FGHRSfittedSec = stringsWithValues[i].entryStringImp3;
	imp4.FGHRSfittedSec = stringsWithValues[i].entryStringImp4;
    imp5.FGHRSfittedSec = stringsWithValues[i++].entryStringImp5;

	FGHRStype = stringsWithValues[i].entryStringBase;
	base.FGHRStype = stringsWithValues[i].entryStringBase;
	imp1.FGHRStype = stringsWithValues[i].entryStringImp1;
	imp2.FGHRStype = stringsWithValues[i].entryStringImp2;
	imp3.FGHRStype = stringsWithValues[i].entryStringImp3;
	imp4.FGHRStype = stringsWithValues[i].entryStringImp4;
    imp5.FGHRStype = stringsWithValues[i++].entryStringImp5;

	determineFGHRStype= stringsWithValues[i].entryStringBase;
	base.determineFGHRStype = stringsWithValues[i].entryStringBase;
	imp1.determineFGHRStype = stringsWithValues[i].entryStringImp1;
	imp2.determineFGHRStype = stringsWithValues[i].entryStringImp2;
	imp3.determineFGHRStype = stringsWithValues[i].entryStringImp3;
	imp4.determineFGHRStype = stringsWithValues[i].entryStringImp4;
    imp5.determineFGHRStype = stringsWithValues[i++].entryStringImp5;

	FGHRStotFracHeatRec_kf2      = atof(stringsWithValues[i].entryString);
	base.FGHRStotFracHeatRec_kf2 = atof(stringsWithValues[i].entryStringBase);
	imp1.FGHRStotFracHeatRec_kf2 = atof(stringsWithValues[i].entryStringImp1);
	imp2.FGHRStotFracHeatRec_kf2 = atof(stringsWithValues[i].entryStringImp2);
	imp3.FGHRStotFracHeatRec_kf2 = atof(stringsWithValues[i].entryStringImp3);
	imp4.FGHRStotFracHeatRec_kf2 = atof(stringsWithValues[i].entryStringImp4);
    imp5.FGHRStotFracHeatRec_kf2 = atof(stringsWithValues[i++].entryStringImp5);

	FGHRSauxelec     = atof(stringsWithValues[i].entryString);
	base.FGHRSauxelec= atof(stringsWithValues[i].entryStringBase);
	imp1.FGHRSauxelec= atof(stringsWithValues[i].entryStringImp1);
	imp2.FGHRSauxelec= atof(stringsWithValues[i].entryStringImp2);
	imp3.FGHRSauxelec= atof(stringsWithValues[i].entryStringImp3);
	imp4.FGHRSauxelec= atof(stringsWithValues[i].entryStringImp4);
    imp5.FGHRSauxelec= atof(stringsWithValues[i++].entryStringImp5);

	FGHRSpvPoweredHt = stringsWithValues[i].entryStringBase;
	base.FGHRSpvPoweredHt = stringsWithValues[i].entryStringBase;
	imp1.FGHRSpvPoweredHt = stringsWithValues[i].entryStringImp1;
	imp2.FGHRSpvPoweredHt = stringsWithValues[i].entryStringImp2;
	imp3.FGHRSpvPoweredHt = stringsWithValues[i].entryStringImp3;
	imp4.FGHRSpvPoweredHt = stringsWithValues[i].entryStringImp4;
    imp5.FGHRSpvPoweredHt = stringsWithValues[i++].entryStringImp5;

	FGHRSpvPkPower      = atof(stringsWithValues[i].entryString);
	base.FGHRSpvPkPower = atof(stringsWithValues[i].entryStringBase);
	imp1.FGHRSpvPkPower = atof(stringsWithValues[i].entryStringImp1);
	imp2.FGHRSpvPkPower = atof(stringsWithValues[i].entryStringImp2);
	imp3.FGHRSpvPkPower = atof(stringsWithValues[i].entryStringImp3);
	imp4.FGHRSpvPkPower = atof(stringsWithValues[i].entryStringImp4);
    imp5.FGHRSpvPkPower = atof(stringsWithValues[i++].entryStringImp5);

	FGHRSpvOrientation = stringsWithValues[i].entryStringBase;
	base.FGHRSpvOrientation = stringsWithValues[i].entryStringBase;
	imp1.FGHRSpvOrientation = stringsWithValues[i].entryStringImp1;
	imp2.FGHRSpvOrientation = stringsWithValues[i].entryStringImp2;
	imp3.FGHRSpvOrientation = stringsWithValues[i].entryStringImp3;
	imp4.FGHRSpvOrientation = stringsWithValues[i].entryStringImp4;
    imp5.FGHRSpvOrientation = stringsWithValues[i++].entryStringImp5;

	FGHRSpvTilt = stringsWithValues[i].entryStringBase;
	base.FGHRSpvTilt = stringsWithValues[i].entryStringBase;
	imp1.FGHRSpvTilt = stringsWithValues[i].entryStringImp1;
	imp2.FGHRSpvTilt = stringsWithValues[i].entryStringImp2;
	imp3.FGHRSpvTilt = stringsWithValues[i].entryStringImp3;
	imp4.FGHRSpvTilt = stringsWithValues[i].entryStringImp4;
    imp5.FGHRSpvTilt = stringsWithValues[i++].entryStringImp5;

	FGHRSpvOvershading = stringsWithValues[i].entryStringBase;
	base.FGHRSpvOvershading = stringsWithValues[i].entryStringBase;
	imp1.FGHRSpvOvershading = stringsWithValues[i].entryStringImp1;
	imp2.FGHRSpvOvershading = stringsWithValues[i].entryStringImp2;
	imp3.FGHRSpvOvershading = stringsWithValues[i].entryStringImp3;
	imp4.FGHRSpvOvershading = stringsWithValues[i].entryStringImp4;
    imp5.FGHRSpvOvershading = stringsWithValues[i++].entryStringImp5;

	FGHRScableLoss      = atof(stringsWithValues[i].entryString);
	base.FGHRScableLoss = atof(stringsWithValues[i].entryStringBase);
	imp1.FGHRScableLoss = atof(stringsWithValues[i].entryStringImp1);
	imp2.FGHRScableLoss = atof(stringsWithValues[i].entryStringImp2);
	imp3.FGHRScableLoss = atof(stringsWithValues[i].entryStringImp3);
	imp4.FGHRScableLoss = atof(stringsWithValues[i].entryStringImp4);
    imp5.FGHRScableLoss = atof(stringsWithValues[i++].entryStringImp5);

	
	//------------------------------------------------------
	//	HEM
	//------------------------------------------------------
	hemHouseType= stringsWithValues[i].entryString;
	base.hemHouseType= stringsWithValues[i].entryStringBase;
	imp1.hemHouseType= stringsWithValues[i].entryStringImp1;
	imp2.hemHouseType= stringsWithValues[i].entryStringImp2;
	imp3.hemHouseType= stringsWithValues[i].entryStringImp3;
	imp4.hemHouseType= stringsWithValues[i].entryStringImp4;
    imp5.hemHouseType= stringsWithValues[i++].entryStringImp5;

	hemYearOfBuild= stringsWithValues[i].entryString;
	base.hemYearOfBuild= stringsWithValues[i].entryStringBase;
	imp1.hemYearOfBuild= stringsWithValues[i].entryStringImp1;
	imp2.hemYearOfBuild= stringsWithValues[i].entryStringImp2;
	imp3.hemYearOfBuild= stringsWithValues[i].entryStringImp3;
	imp4.hemYearOfBuild= stringsWithValues[i].entryStringImp4;
    imp5.hemYearOfBuild= stringsWithValues[i++].entryStringImp5;

	chkInsulation= atoi(stringsWithValues[i].entryString);
	base.chkInsulation= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkInsulation= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkInsulation= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkInsulation= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkInsulation= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkInsulation= atoi(stringsWithValues[i++].entryStringImp5);

	hemI_insulationSliderPos= atoi(stringsWithValues[i].entryString);
	base.hemI_insulationSliderPos= atoi(stringsWithValues[i].entryStringBase);
	imp1.hemI_insulationSliderPos= atoi(stringsWithValues[i].entryStringImp1);
	imp2.hemI_insulationSliderPos= atoi(stringsWithValues[i].entryStringImp2);
	imp3.hemI_insulationSliderPos= atoi(stringsWithValues[i].entryStringImp3);
	imp4.hemI_insulationSliderPos= atoi(stringsWithValues[i].entryStringImp4);
    imp5.hemI_insulationSliderPos= atoi(stringsWithValues[i++].entryStringImp5);

	chkAirtightness= atoi(stringsWithValues[i].entryString);
	base.chkAirtightness= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkAirtightness= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkAirtightness= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkAirtightness= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkAirtightness= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkAirtightness= atoi(stringsWithValues[i++].entryStringImp5);

	hemA_achSliderPos= atoi(stringsWithValues[i].entryString);
	base.hemA_achSliderPos= atoi(stringsWithValues[i].entryStringBase);
	imp1.hemA_achSliderPos= atoi(stringsWithValues[i].entryStringImp1);
	imp2.hemA_achSliderPos= atoi(stringsWithValues[i].entryStringImp2);
	imp3.hemA_achSliderPos= atoi(stringsWithValues[i].entryStringImp3);
	imp4.hemA_achSliderPos= atoi(stringsWithValues[i].entryStringImp4);
    imp5.hemA_achSliderPos= atoi(stringsWithValues[i++].entryStringImp5);

	chkCapacity= atoi(stringsWithValues[i].entryString);
	base.chkCapacity= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkCapacity= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkCapacity= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkCapacity= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkCapacity= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkCapacity= atoi(stringsWithValues[i++].entryStringImp5);

	hemC_capacitySliderPos= atoi(stringsWithValues[i].entryString);
	base.hemC_capacitySliderPos= atoi(stringsWithValues[i].entryStringBase);
	imp1.hemC_capacitySliderPos= atoi(stringsWithValues[i].entryStringImp1);
	imp2.hemC_capacitySliderPos= atoi(stringsWithValues[i].entryStringImp2);
	imp3.hemC_capacitySliderPos= atoi(stringsWithValues[i].entryStringImp3);
	imp4.hemC_capacitySliderPos= atoi(stringsWithValues[i].entryStringImp4);
    imp5.hemC_capacitySliderPos= atoi(stringsWithValues[i++].entryStringImp5);

	chkSolarIngress= atoi(stringsWithValues[i].entryString);
	base.chkSolarIngress= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkSolarIngress= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkSolarIngress= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkSolarIngress= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkSolarIngress= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkSolarIngress= atoi(stringsWithValues[i++].entryStringImp5);

	hemS_solarGainsSliderPos= atoi(stringsWithValues[i].entryString);
	base.hemS_solarGainsSliderPos= atoi(stringsWithValues[i].entryStringBase);
	imp1.hemS_solarGainsSliderPos= atoi(stringsWithValues[i].entryStringImp1);
	imp2.hemS_solarGainsSliderPos= atoi(stringsWithValues[i].entryStringImp2);
	imp3.hemS_solarGainsSliderPos= atoi(stringsWithValues[i].entryStringImp3);
	imp4.hemS_solarGainsSliderPos= atoi(stringsWithValues[i].entryStringImp4);
    imp5.hemS_solarGainsSliderPos= atoi(stringsWithValues[i++].entryStringImp5);

	chkOccupancy= atoi(stringsWithValues[i].entryString);
	base.chkOccupancy= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkOccupancy= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkOccupancy= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkOccupancy= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkOccupancy= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkOccupancy= atoi(stringsWithValues[i++].entryStringImp5);

	hemO_OCCDensitySliderPos= atoi(stringsWithValues[i].entryString);
	base.hemO_OCCDensitySliderPos= atoi(stringsWithValues[i].entryStringBase);
	imp1.hemO_OCCDensitySliderPos= atoi(stringsWithValues[i].entryStringImp1);
	imp2.hemO_OCCDensitySliderPos= atoi(stringsWithValues[i].entryStringImp2);
	imp3.hemO_OCCDensitySliderPos= atoi(stringsWithValues[i].entryStringImp3);
	imp4.hemO_OCCDensitySliderPos= atoi(stringsWithValues[i].entryStringImp4);
    imp5.hemO_OCCDensitySliderPos= atoi(stringsWithValues[i++].entryStringImp5);

	chkControlledSpace= atoi(stringsWithValues[i].entryString);
	base.chkControlledSpace= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkControlledSpace= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkControlledSpace= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkControlledSpace= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkControlledSpace= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkControlledSpace= atoi(stringsWithValues[i++].entryStringImp5);

	hemL_LAFracSliderPos= atoi(stringsWithValues[i].entryString);
	base.hemL_LAFracSliderPos= atoi(stringsWithValues[i].entryStringBase);
	imp1.hemL_LAFracSliderPos= atoi(stringsWithValues[i].entryStringImp1);
	imp2.hemL_LAFracSliderPos= atoi(stringsWithValues[i].entryStringImp2);
	imp3.hemL_LAFracSliderPos= atoi(stringsWithValues[i].entryStringImp3);
	imp4.hemL_LAFracSliderPos= atoi(stringsWithValues[i].entryStringImp4);
    imp5.hemL_LAFracSliderPos= atoi(stringsWithValues[i++].entryStringImp5);

	chkSDHW= atoi(stringsWithValues[i].entryString);
	base.chkSDHW= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkSDHW= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkSDHW= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkSDHW= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkSDHW= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkSDHW= atoi(stringsWithValues[i++].entryStringImp5);

	chkPV= atoi(stringsWithValues[i].entryString);
	base.chkPV= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkPV= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkPV= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkPV= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkPV= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkPV= atoi(stringsWithValues[i++].entryStringImp5);

	chkWT= atoi(stringsWithValues[i].entryString);
	base.chkWT= atoi(stringsWithValues[i].entryString);
	imp1.chkWT= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkWT= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkWT= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkWT= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkWT= atoi(stringsWithValues[i++].entryStringImp5);

	chkuCHP= atoi(stringsWithValues[i].entryString);
	base.chkuCHP= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkuCHP= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkuCHP= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkuCHP= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkuCHP= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkuCHP= atoi(stringsWithValues[i++].entryStringImp5);

	chkuHydro= atoi(stringsWithValues[i].entryString);
	base.chkuHydro= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkuHydro= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkuHydro= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkuHydro= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkuHydro= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkuHydro= atoi(stringsWithValues[i++].entryStringImp5);

	chkPCM= atoi(stringsWithValues[i].entryString);
	base.chkPCM= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkPCM= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkPCM= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkPCM= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkPCM= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkPCM= atoi(stringsWithValues[i++].entryStringImp5);

	chkMVHR= atoi(stringsWithValues[i].entryString);
	base.chkMVHR= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkMVHR= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkMVHR= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkMVHR= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkMVHR= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkMVHR= atoi(stringsWithValues[i++].entryStringImp5);

	chkFGHRS= atoi(stringsWithValues[i].entryString);
	base.chkFGHRS= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkFGHRS= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkFGHRS= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkFGHRS= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkFGHRS= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkFGHRS= atoi(stringsWithValues[i++].entryStringImp5);

	chkWWHRS= atoi(stringsWithValues[i].entryString);
	base.chkWWHRS= atoi(stringsWithValues[i].entryStringBase);
	imp1.chkWWHRS= atoi(stringsWithValues[i].entryStringImp1);
	imp2.chkWWHRS= atoi(stringsWithValues[i].entryStringImp2);
	imp3.chkWWHRS= atoi(stringsWithValues[i].entryStringImp3);
	imp4.chkWWHRS= atoi(stringsWithValues[i].entryStringImp4);
    imp5.chkWWHRS= atoi(stringsWithValues[i++].entryStringImp5);	

	//------------------------------------------------------------------
	// Perform calculations based on all cases as defined by user in 
	// project file
	//------------------------------------------------------------------
	if( baseSelected == 1)
	{
		is_base_selected = true;
		is_base_saved  = true;
	}

	if(imp1Selected == 1)
	{
		is_imp1_selected = true;
		is_imp1_saved  = true;
	}

	if(imp2Selected == 1)
	{
		is_imp2_selected = true;
		is_imp2_saved  = true;
	}

	if(imp3Selected == 1)
	{
		is_imp3_selected = true;
		is_imp3_saved  = true;
	}

	if(imp4Selected == 1)
	{
		is_imp4_selected = true;
		is_imp4_saved  = true;
	}

	if(imp5Selected == 1)
	{
		is_imp5_selected = true;
		is_imp5_saved  = true;
	}	
}
void CSAPP1Dlg::OpenProjectFile()
{
	OpenProjectFile_2();

	RecreateAllDialogs();

	//-------------------------------------------------------------------
	// Create new tab if file opened first time
	if(is_file_opened_if_changing_tabs == false)
	{
		OpenNewTabForProjectFile();			
	}
	
	//-------------------------------------------------------------------
	// Set flag to false
	is_file_opened_if_changing_tabs = false;

	//-------------------------------------------------------------------
	// This flag ia added to ensure that estate can only display
	// saved or opened projects
	chk_if_project_saved     = true;

	lastTabNumber = m_tabCtrlProjects.GetCurSel();
}

void CSAPP1Dlg::OpenNewTabForProjectFile()
{
	unsigned int size_chk;
	CString tempString;
	int numOfItemsInTab = 0;
	int newTabNum = 0;

	//-------------------------------------------------------------------
	// Add a new tab to Projects tab control if new or saved file are 
	// opened
	//-------------------------------------------------------------------
	// Get the total number of tabs
	numOfItemsInTab = m_tabCtrlProjects.GetItemCount();	
	newTabNum       = numOfItemsInTab+1;

	if (file_new_selected == true)
	{
		m_tabCtrlProjects.InsertItem(newTabNum,"Untitled");
	}
	else
	{
		//-------------------------------------------------------------------
		// Copy file name to vector
		//-------------------------------------------------------------------
		tempEntry.projectFileName       = projectFileName;
		tempEntry.projectFileNameNoPath = projectFileNameNoPath;		
		tempEntry.projectFileNameNoExt  = projectFileNameNoExt;
		projectInfo.push_back(tempEntry);

		m_tabCtrlProjects.InsertItem(newTabNum,projectFileNameNoExt);
	}

	m_tabCtrlProjects.SetCurSel(newTabNum-1);
}

void CSAPP1Dlg::RecreateAllDialogs()
{
	int TabIndex = 0;
	//------------------------------------------------------------------
	// Get the current number of tab selected	
	TabIndex =  m_tabCtrl.GetCurSel();

	//------------------------------------------------------------------
	// Destroy windows
	//------------------------------------------------------------------
	if (!DestroyModlessDialogs()) 
	{
		return;
	}

	//------------------------------------------------------------------
	// Show new dialog selected by tab control
	//------------------------------------------------------------------
	if (TabIndex==0)
	{
		m_Results = new CDlg_Results;
		m_Results->Create(IDD_RESULTS,this);
		m_Results->ShowWindow(SW_SHOW);			
	}
	else if (TabIndex==1)
	{
		m_JobDetails = new CDlg_JobDetails;
		m_JobDetails->Create(IDD_JOBDETAILS,this);
		m_JobDetails->ShowWindow(SW_SHOW);		
	}
	else if (TabIndex==2)
	{
		m_BuiltForm = new CDlg_BuiltForm;
		m_BuiltForm->Create(IDD_BUILTFORM,this);
		m_BuiltForm->ShowWindow(SW_SHOW);	
	}	
	else if (TabIndex==3)
	{
		m_Windows = new CDlg_Windows;
		m_Windows->Create(IDD_WINDOWS,this);
		m_Windows->ShowWindow(SW_SHOW);			
	}

	else if (TabIndex==4)
	{
		m_AreaAndUvalues = new CDlg_AreaAndUvalues;
		m_AreaAndUvalues->Create(IDD_AREAUVALUES,this);
		m_AreaAndUvalues->ShowWindow(SW_SHOW);			
	}

	else if (TabIndex==5)
	{
		m_ThermalBridging = new CDlg_ThermalBridging ;
		m_ThermalBridging ->Create(IDD_THERMALBRIDGING,this);	
		m_ThermalBridging->ShowWindow(SW_SHOW);	
	}
	else if (TabIndex==6)
	{
		m_Ventilation = new CDlg_Ventilation;
		m_Ventilation->Create(IDD_VENTILATION,this);
		m_Ventilation->ShowWindow(SW_SHOW);
	}
	else if (TabIndex==7)
	{
		m_MainHeating = new CDlg_MainHeating;
		m_MainHeating->Create(IDD_MAINHEATING,this);
		m_MainHeating->ShowWindow(SW_SHOW);	
	}
	else if (TabIndex==8)
	{
		m_MainHeatingDetails = new CDlg_MainHeatingDetails;
		m_MainHeatingDetails->Create(IDD_MAINHEATINGDETAILS,this);
		m_MainHeatingDetails->ShowWindow(SW_SHOW);	
	}
	else if (TabIndex==9)
	{
		m_SecHeating = new CDlg_SecHeating;
		m_SecHeating->Create(IDD_SECONDARYHEATING,this);
		m_SecHeating->ShowWindow(SW_SHOW);	
	}
	else if (TabIndex==10)
	{
		m_WaterHeating = new CDlg_WaterHeating;
		m_WaterHeating->Create(IDD_WATERHEATING,this);
		m_WaterHeating->ShowWindow(SW_SHOW);	
	}
	else if (TabIndex==11)
	{
		m_Renewables = new CDlg_Renewables ;
		m_Renewables ->Create(IDD_RENEWABLES,this);
		m_Renewables->ShowWindow(SW_SHOW);	
	}
	else if (TabIndex==12)
	{
		m_Renewables1 = new CDlg_Renewables1 ;
		m_Renewables1 ->Create(IDD_RENEWABLES1,this);
		m_Renewables1->ShowWindow(SW_SHOW);	
	}
}



void CDlg_Results::ModifyResultsBasedOnEnergyCostOrEmissions()
{
	CString unit;

	if(chkEnergy == 1)
	{
		totalSpaceHtSupply_Disp      = totalSpaceHtSupply;
		totalSpaceCoolingSupply_Disp = totalSpaceCoolingSupply;
		domesticHotWaterSupply_Disp  = domesticHotWaterSupply;
		lightElectricity_Disp        = lightElectricity;
		auxillaryElectricity_Disp    = auxillaryElectricity;
		totalElectricalSupply_Disp   = totalElectricalSupply;
		mainSpaceHtSupply_Disp       = mainSpaceHtSupply;
		secSpaceHtSupply_Disp        = secSpaceHtSupply;
		LZCTelecSold_Disp            = LZCT_elecSold;
		LZCTelecDisp_Disp            = LZCT_elecDisplaced;
		primaryFuelUsed_Disp		 = primaryFuelUsed;
	     secFuelUsed_Disp			 = secFuelUsed;
		
		// Set unit for lables
		unit = "kWh";
	}
	else if(chkCost == 1)
	{
		totalSpaceHtSupply_Disp      = (mainSpaceHtSupply_fuelCost + secSpaceHtSupply_fuelCost);
		totalSpaceCoolingSupply_Disp = totalSpaceCoolingSupply_fuelCost;
		domesticHotWaterSupply_Disp  = domesticHotWaterSupply_fuelCost;
		lightElectricity_Disp        = lightElectricity_fuelCost;
		auxillaryElectricity_Disp    = auxillaryElectricity_fuelCost;
		totalElectricalSupply_Disp   = lightElectricity_fuelCost+ auxillaryElectricity_fuelCost;
		mainSpaceHtSupply_Disp       = mainSpaceHtSupply_fuelCost;
		secSpaceHtSupply_Disp        = secSpaceHtSupply_fuelCost;
		LZCTelecSold_Disp            = LZCT_elecSold_fuelCost;
		LZCTelecDisp_Disp            = LZCT_elecDisp_fuelCost;
		primaryFuelUsed_Disp		 = primaryFuelUsed_fuelCost;
	    secFuelUsed_Disp			 = secFuelUsed_fuelCost;


		// Set unit for lables
		unit = "£";
	}
	else if(chkEmissions == 1)
	{
		totalSpaceHtSupply_Disp      = (mainSpaceHtSupply_Emm + secSpaceHtSupply_Emm);
		totalSpaceCoolingSupply_Disp = totalSpaceCoolingSupply_Emm;
		domesticHotWaterSupply_Disp  = domesticHotWaterSupply_Emm;
		lightElectricity_Disp        = lightElectricity_Emm;
		auxillaryElectricity_Disp    = auxillaryElectricity_Emm;
		totalElectricalSupply_Disp   = lightElectricity_Emm+ auxillaryElectricity_Emm;
		mainSpaceHtSupply_Disp       = mainSpaceHtSupply_Emm;
		secSpaceHtSupply_Disp        = secSpaceHtSupply_Emm;
		LZCTelecSold_Disp            = LZCT_elecSold_Emm;
		LZCTelecDisp_Disp            = LZCT_elecDisp_Emm;	
		primaryFuelUsed_Disp        = primaryFuelUsed_Emm;	
	    secFuelUsed_Disp             = secFuelUsed_Emm;	
		primaryFuelUsed_Disp		 = primaryFuelUsed_Emm;
	     secFuelUsed_Disp			 = secFuelUsed_Emm;
	
		// Set unit for lables
		unit = "kgCO2";
	}

	// Display actual or perm2 values depending on user choice
	if(chkperm2 == 1)
	{
		totalSpaceHtSupply_Disp      = totalSpaceHtSupply_Disp/TFA;
		totalSpaceCoolingSupply_Disp = totalSpaceCoolingSupply_Disp/TFA;
		domesticHotWaterSupply_Disp  = domesticHotWaterSupply_Disp/TFA;
		lightElectricity_Disp        = lightElectricity_Disp/TFA;
		auxillaryElectricity_Disp    = auxillaryElectricity_Disp/TFA;
		totalElectricalSupply_Disp   = totalElectricalSupply_Disp/TFA;
		mainSpaceHtSupply_Disp       = mainSpaceHtSupply_Disp/TFA;
		secSpaceHtSupply_Disp        = secSpaceHtSupply_Disp/TFA;
		LZCTelecSold_Disp            = LZCTelecSold_Disp/TFA;
		LZCTelecDisp_Disp            = LZCTelecDisp_Disp/TFA;
		primaryFuelUsed_Disp		 = primaryFuelUsed_Disp/TFA;
	    secFuelUsed_Disp			 = secFuelUsed_Disp/TFA;


		// Set unit for lables
		unit = unit + "/m²";
	}

	if(( file_new_selected == true) || 
		(is_climate_changed_from_results == false) ||
		(is_house_type_changed_from_results == false) ||
		(is_year_of_build_changed == false) || (TFA == 0) )
	{
		totalSpaceHtSupply_Disp      = 0;
		totalSpaceCoolingSupply_Disp = 0;
		domesticHotWaterSupply_Disp  = 0;
		lightElectricity_Disp        = 0;
		auxillaryElectricity_Disp    = 0;
		totalElectricalSupply_Disp   = 0;
		mainSpaceHtSupply_Disp       = 0;
		secSpaceHtSupply_Disp        = 0;
		LZCTelecSold_Disp            = 0;
		LZCTelecDisp_Disp            = 0;
		primaryFuelUsed_Disp		 = 0;
	    secFuelUsed_Disp			 = 0;
	}

	m_labelBase.SetWindowText(unit);
	m_labelImp1.SetWindowText(unit);
	m_labelImp2.SetWindowText(unit);
	m_labelImp3.SetWindowText(unit);
	m_labelImp4.SetWindowText(unit);
	m_labelImp5.SetWindowText(unit);

	//-----------------------------------------------------
	// Display results in current coloumn at all times
	//-----------------------------------------------------
	str_editHtDemCurrent.Format("%.0f",totalSpaceHtSupply_Disp);
	str_editSpaceCoolingSupplyCurrent.Format("%.0f",totalSpaceCoolingSupply_Disp);
	str_editDHWCurrent.Format("%.0f",domesticHotWaterSupply_Disp);
	str_editLightCurrent.Format("%.0f",lightElectricity_Disp);
	str_editAuxElecCurrent.Format("%.0f",auxillaryElectricity_Disp);
	str_editTotalElecCurrent.Format("%.0f",totalElectricalSupply_Disp);
	str_editLZCTElecSoldCurrent.Format("%.0f",LZCTelecSold_Disp);
	str_editLZCTElecDispCurrent.Format("%.0f",LZCTelecDisp_Disp);
	str_editPrimFuelCurrent.Format("%.0f",primaryFuelUsed_Disp);
	str_editSecFuelCurrent.Format("%.0f",secFuelUsed_Disp);	

	UpdateData(FALSE);
}

void CDlg_Results::DisplayResultsInList()
{
	
	UpdateData(FALSE);
}

void CDlg_Results::DisplayBaseResultsForEnergyCostOrEmissions()
{
	if(chkEnergy == 1)
	{
		base.totalSpaceHtSupply_Disp      = base.totalSpaceHtSupply;
		base.totalSpaceCoolingSupply_Disp = base.totalSpaceCoolingSupply;
		base.domesticHotWaterSupply_Disp  = base.domesticHotWaterSupply;
		base.lightElectricity_Disp        = base.lightElectricity;
		base.auxillaryElectricity_Disp    = base.auxillaryElectricity;
		base.totalElectricalSupply_Disp   = base.totalElectricalSupply;
		base.mainSpaceHtSupply_Disp       = base.mainSpaceHtSupply;
		base.secSpaceHtSupply_Disp        = base.secSpaceHtSupply;
		base.LZCTelecSold_Disp            = base.LZCT_elecSold;
		base.LZCTelecDisp_Disp            = base.LZCT_elecDisplaced;
		base.primaryFuelUsed_Disp         = base.primaryFuelUsed;	
	    base.secFuelUsed_Disp             = base.secFuelUsed;	
	}
	else if(chkCost == 1)
	{
		base.totalSpaceHtSupply_Disp      = (base.mainSpaceHtSupply_fuelCost + base.secSpaceHtSupply_fuelCost);
		base.totalSpaceCoolingSupply_Disp = base.totalSpaceCoolingSupply_fuelCost;
		base.domesticHotWaterSupply_Disp  = base.domesticHotWaterSupply_fuelCost;
		base.lightElectricity_Disp        = base.lightElectricity_fuelCost;
		base.auxillaryElectricity_Disp    = base.auxillaryElectricity_fuelCost;
		base.totalElectricalSupply_Disp   = base.lightElectricity_fuelCost+ base.auxillaryElectricity_fuelCost;
		base.mainSpaceHtSupply_Disp       = base.mainSpaceHtSupply_fuelCost;
		base.secSpaceHtSupply_Disp        = base.secSpaceHtSupply_fuelCost;
		base.LZCTelecSold_Disp            = base.LZCTelecSold_fuelCost;
		base.LZCTelecDisp_Disp            = base.LZCTelecDisp_fuelCost;
		base.primaryFuelUsed_Disp         = base.primaryFuelUsed_fuelCost;	
	    base.secFuelUsed_Disp             = base.secFuelUsed_fuelCost;		
	}
	else if(chkEmissions == 1)
	{
		base.totalSpaceHtSupply_Disp      = (base.mainSpaceHtSupply_Emm + base.secSpaceHtSupply_Emm);
		base.totalSpaceCoolingSupply_Disp = base.totalSpaceCoolingSupply_Emm;
		base.domesticHotWaterSupply_Disp  = base.domesticHotWaterSupply_Emm;
		base.lightElectricity_Disp        = base.lightElectricity_Emm;
		base.auxillaryElectricity_Disp    = base.auxillaryElectricity_Emm;
		base.totalElectricalSupply_Disp   = base.lightElectricity_Emm+ base.auxillaryElectricity_Emm;
		base.mainSpaceHtSupply_Disp       = base.mainSpaceHtSupply_Emm;
		base.secSpaceHtSupply_Disp        = base.secSpaceHtSupply_Emm;
		base.LZCTelecSold_Disp            = base.LZCTelecSold_Emm;
		base.LZCTelecDisp_Disp            = base.LZCTelecDisp_Emm;
		base.primaryFuelUsed_Disp        = base.primaryFuelUsed_Emm;	
	    base.secFuelUsed_Disp             = base.secFuelUsed_Emm;	
	}

	// Display actual or perm2 values depending on user choice
	if(chkperm2 == 1)
	{
		base.totalSpaceHtSupply_Disp      = base.totalSpaceHtSupply_Disp/base.TFA;
		base.totalSpaceCoolingSupply_Disp = base.totalSpaceCoolingSupply_Disp/base.TFA;
		base.domesticHotWaterSupply_Disp  = base.domesticHotWaterSupply_Disp/base.TFA;
		base.lightElectricity_Disp        = base.lightElectricity_Disp/base.TFA;
		base.auxillaryElectricity_Disp    = base.auxillaryElectricity_Disp/base.TFA;
		base.totalElectricalSupply_Disp   = base.totalElectricalSupply_Disp/base.TFA;
		base.mainSpaceHtSupply_Disp       = base.mainSpaceHtSupply_Disp/base.TFA;
		base.secSpaceHtSupply_Disp        = base.secSpaceHtSupply_Disp/base.TFA;
		base.LZCTelecSold_Disp            = base.LZCTelecSold_Disp/base.TFA;
		base.LZCTelecDisp_Disp            = base.LZCTelecDisp_Disp/base.TFA;
		base.primaryFuelUsed_Disp         = base.primaryFuelUsed_Disp/base.TFA;	
	    base.secFuelUsed_Disp             = base.secFuelUsed_Disp/base.TFA;
	}

	if((file_new_selected == true) || (TFA == 0))
	{
		base.totalSpaceHtSupply_Disp      = 0;
		base.totalSpaceCoolingSupply_Disp = 0;
		base.domesticHotWaterSupply_Disp  = 0;
		base.lightElectricity_Disp        = 0;
		base.auxillaryElectricity_Disp    = 0;
		base.totalElectricalSupply_Disp   = 0;
		base.mainSpaceHtSupply_Disp       = 0;
		base.secSpaceHtSupply_Disp        = 0;
		base.LZCTelecSold_Disp            = 0;
		base.LZCTelecDisp_Disp            = 0;
		base.primaryFuelUsed_Disp         = 0;
	    base.secFuelUsed_Disp             = 0;	
	}
	// Display results in base
	str_TCID.Format("%s",base.XIACSOL_string_disp1);
	str_TCID2.Format("%s",base.XIACSOL_string_disp2);

	str_editHtDemBase.Format("%.0f",base.totalSpaceHtSupply_Disp);
	str_editSpaceCoolingSupply.Format("%.0f",base.totalSpaceCoolingSupply_Disp);

	str_editDHW.Format("%.0f",base.domesticHotWaterSupply_Disp);	
	str_editLightElec.Format("%.0f",base.lightElectricity_Disp);	
	str_editAuxElec.Format("%.0f",base.auxillaryElectricity_Disp);
	str_editTotalElec.Format("%.0f",base.totalElectricalSupply_Disp);	

	str_editPrimaryFuelBase.Format("%.0f",base.primaryFuelUsed_Disp);
	str_editSecFuelBase.Format("%.0f",base.secFuelUsed_Disp);
	str_LZCTelecSoldBase.Format("%.0f",base.LZCTelecSold_Disp);
	str_LZCTeleDispBase.Format("%.0f",base.LZCTelecDisp_Disp);

	UpdateData(false);
}

void CDlg_Results::DisplayImp1ResultsForEnergyCostOrEmissions()
{
	if(chkEnergy == 1)
	{
		imp1.totalSpaceHtSupply_Disp      = imp1.totalSpaceHtSupply;
		imp1.totalSpaceCoolingSupply_Disp = imp1.totalSpaceCoolingSupply;
		imp1.domesticHotWaterSupply_Disp  = imp1.domesticHotWaterSupply;
		imp1.lightElectricity_Disp        = imp1.lightElectricity;
		imp1.auxillaryElectricity_Disp    = imp1.auxillaryElectricity;
		imp1.totalElectricalSupply_Disp   = imp1.totalElectricalSupply;
		imp1.mainSpaceHtSupply_Disp       = imp1.mainSpaceHtSupply;
		imp1.secSpaceHtSupply_Disp        = imp1.secSpaceHtSupply;
		imp1.LZCTelecSold_Disp            = imp1.LZCT_elecSold;
		imp1.LZCTelecDisp_Disp            = imp1.LZCT_elecDisplaced;
		imp1.primaryFuelUsed_Disp         = imp1.primaryFuelUsed;
	    imp1.secFuelUsed_Disp             = imp1.secFuelUsed;
	}
	else if(chkCost == 1)
	{
		imp1.totalSpaceHtSupply_Disp      = (imp1.mainSpaceHtSupply_fuelCost + imp1.secSpaceHtSupply_fuelCost);
		imp1.totalSpaceCoolingSupply_Disp = imp1.totalSpaceCoolingSupply_fuelCost;
		imp1.domesticHotWaterSupply_Disp  = imp1.domesticHotWaterSupply_fuelCost;
		imp1.lightElectricity_Disp        = imp1.lightElectricity_fuelCost;
		imp1.auxillaryElectricity_Disp    = imp1.auxillaryElectricity_fuelCost;
		imp1.totalElectricalSupply_Disp   = imp1.lightElectricity_fuelCost+ imp1.auxillaryElectricity_fuelCost;
		imp1.mainSpaceHtSupply_Disp       = imp1.mainSpaceHtSupply_fuelCost;
		imp1.secSpaceHtSupply_Disp        = imp1.secSpaceHtSupply_fuelCost;
		imp1.LZCTelecSold_Disp            = imp1.LZCTelecSold_fuelCost;
		imp1.LZCTelecDisp_Disp            = imp1.LZCTelecDisp_fuelCost;
		imp1.primaryFuelUsed_Disp         = imp1.primaryFuelUsed_fuelCost;
	    imp1.secFuelUsed_Disp             = imp1.secFuelUsed_fuelCost;
	}
	else if(chkEmissions == 1)
	{
		imp1.totalSpaceHtSupply_Disp      = (imp1.mainSpaceHtSupply_Emm + imp1.secSpaceHtSupply_Emm);
		imp1.totalSpaceCoolingSupply_Disp = imp1.totalSpaceCoolingSupply_Emm;
		imp1.domesticHotWaterSupply_Disp  = imp1.domesticHotWaterSupply_Emm;
		imp1.lightElectricity_Disp        = imp1.lightElectricity_Emm;
		imp1.auxillaryElectricity_Disp    = imp1.auxillaryElectricity_Emm;
		imp1.totalElectricalSupply_Disp   = imp1.lightElectricity_Emm+ imp1.auxillaryElectricity_Emm;
		imp1.mainSpaceHtSupply_Disp       = imp1.mainSpaceHtSupply_Emm;
		imp1.secSpaceHtSupply_Disp        = imp1.secSpaceHtSupply_Emm;
		imp1.LZCTelecSold_Disp            = imp1.LZCTelecSold_Emm;
		imp1.LZCTelecDisp_Disp            = imp1.LZCTelecDisp_Emm;
		imp1.primaryFuelUsed_Disp         = imp1.primaryFuelUsed_Emm;
	    imp1.secFuelUsed_Disp             = imp1.secFuelUsed_Emm;
	}

	// Display actual or perm2 values depending on user choice
	if(chkperm2 == 1)
	{
		imp1.totalSpaceHtSupply_Disp      = imp1.totalSpaceHtSupply_Disp/imp1.TFA;
		imp1.totalSpaceCoolingSupply_Disp = imp1.totalSpaceCoolingSupply_Disp/imp1.TFA;
		imp1.domesticHotWaterSupply_Disp  = imp1.domesticHotWaterSupply_Disp/imp1.TFA;
		imp1.lightElectricity_Disp        = imp1.lightElectricity_Disp/imp1.TFA;
		imp1.auxillaryElectricity_Disp    = imp1.auxillaryElectricity_Disp/imp1.TFA;
		imp1.totalElectricalSupply_Disp   = imp1.totalElectricalSupply_Disp/imp1.TFA;
		imp1.mainSpaceHtSupply_Disp       = imp1.mainSpaceHtSupply_Disp/imp1.TFA;
		imp1.secSpaceHtSupply_Disp        = imp1.secSpaceHtSupply_Disp/imp1.TFA;
		imp1.LZCTelecSold_Disp            = imp1.LZCTelecSold_Disp/imp1.TFA;
		imp1.LZCTelecDisp_Disp            = imp1.LZCTelecDisp_Disp/imp1.TFA;
		imp1.primaryFuelUsed_Disp         = imp1.primaryFuelUsed_Disp/imp1.TFA;
	    imp1.secFuelUsed_Disp             = imp1.secFuelUsed_Disp/imp1.TFA;
	}

	// Display results in base
	str_editHtDemImp1.Format("%.0f",imp1.totalSpaceHtSupply_Disp);
	str_editSpaceCoolingSupplyImp1.Format("%.0f",imp1.totalSpaceCoolingSupply_Disp);

	str_editDHWImp1.Format("%.0f",imp1.domesticHotWaterSupply_Disp);	
	str_editLightElecImp1.Format("%.0f",imp1.lightElectricity_Disp);	
	str_editAuxElecImp1.Format("%.0f",imp1.auxillaryElectricity_Disp);
	str_editTotalElecImp1.Format("%.0f",imp1.totalElectricalSupply_Disp);	

	str_editPrimaryFuelImp1.Format("%.0f",imp1.primaryFuelUsed_Disp);
	str_editSecFuelImp1.Format("%.0f",imp1.secFuelUsed_Disp);
	str_LZCTelecSoldImp1.Format("%.0f",imp1.LZCTelecSold_Disp);
	str_LZCTeleDispImp1.Format("%.0f",imp1.LZCTelecDisp_Disp);
	UpdateData(false);
}


void CDlg_Results::DisplayImp2ResultsForEnergyCostOrEmissions()
{
	if(chkEnergy == 1)
	{
		imp2.totalSpaceHtSupply_Disp      = imp2.totalSpaceHtSupply;
		imp2.totalSpaceCoolingSupply_Disp = imp2.totalSpaceCoolingSupply;
		imp2.domesticHotWaterSupply_Disp  = imp2.domesticHotWaterSupply;
		imp2.lightElectricity_Disp        = imp2.lightElectricity;
		imp2.auxillaryElectricity_Disp    = imp2.auxillaryElectricity;
		imp2.totalElectricalSupply_Disp   = imp2.totalElectricalSupply;
		imp2.mainSpaceHtSupply_Disp       = imp2.mainSpaceHtSupply;
		imp2.secSpaceHtSupply_Disp        = imp2.secSpaceHtSupply;
		imp2.LZCTelecSold_Disp            = imp2.LZCT_elecSold;
		imp2.LZCTelecDisp_Disp            = imp2.LZCT_elecDisplaced;
		imp2.primaryFuelUsed_Disp         = imp2.primaryFuelUsed;
	    imp2.secFuelUsed_Disp             = imp2.secFuelUsed;
	}
	else if(chkCost == 1)
	{
		imp2.totalSpaceHtSupply_Disp      = (imp2.mainSpaceHtSupply_fuelCost + imp2.secSpaceHtSupply_fuelCost);
		imp2.totalSpaceCoolingSupply_Disp = imp2.totalSpaceCoolingSupply_fuelCost;
		imp2.domesticHotWaterSupply_Disp  = imp2.domesticHotWaterSupply_fuelCost;
		imp2.lightElectricity_Disp        = imp2.lightElectricity_fuelCost;
		imp2.auxillaryElectricity_Disp    = imp2.auxillaryElectricity_fuelCost;
		imp2.totalElectricalSupply_Disp   = imp2.lightElectricity_fuelCost+ imp2.auxillaryElectricity_fuelCost;
		imp2.mainSpaceHtSupply_Disp       = imp2.mainSpaceHtSupply_fuelCost;
		imp2.secSpaceHtSupply_Disp        = imp2.secSpaceHtSupply_fuelCost;
		imp2.LZCTelecSold_Disp            = imp2.LZCTelecSold_fuelCost;
		imp2.LZCTelecDisp_Disp            = imp2.LZCTelecDisp_fuelCost;
		imp2.primaryFuelUsed_Disp         = imp2.primaryFuelUsed_fuelCost;
	    imp2.secFuelUsed_Disp             = imp2.secFuelUsed_fuelCost;
	}
	else if(chkEmissions == 1)
	{
		imp2.totalSpaceHtSupply_Disp      = (imp2.mainSpaceHtSupply_Emm + imp2.secSpaceHtSupply_Emm);
		imp2.totalSpaceCoolingSupply_Disp = imp2.totalSpaceCoolingSupply_Emm;
		imp2.domesticHotWaterSupply_Disp  = imp2.domesticHotWaterSupply_Emm;
		imp2.lightElectricity_Disp        = imp2.lightElectricity_Emm;
		imp2.auxillaryElectricity_Disp    = imp2.auxillaryElectricity_Emm;
		imp2.totalElectricalSupply_Disp   = imp2.lightElectricity_Emm+ imp2.auxillaryElectricity_Emm;
		imp2.mainSpaceHtSupply_Disp       = imp2.mainSpaceHtSupply_Emm;
		imp2.secSpaceHtSupply_Disp        = imp2.secSpaceHtSupply_Emm;
		imp2.LZCTelecSold_Disp            = imp2.LZCTelecSold_Emm;
		imp2.LZCTelecDisp_Disp            = imp2.LZCTelecDisp_Emm;
		imp2.primaryFuelUsed_Disp         = imp2.primaryFuelUsed_Emm;
	    imp2.secFuelUsed_Disp             = imp2.secFuelUsed_Emm;
	}

	// Display actual or perm2 values depending on user choice
	if(chkperm2 == 1)
	{
		imp2.totalSpaceHtSupply_Disp      = imp2.totalSpaceHtSupply_Disp/imp2.TFA;
		imp2.totalSpaceCoolingSupply_Disp = imp2.totalSpaceCoolingSupply_Disp/imp2.TFA;
		imp2.domesticHotWaterSupply_Disp  = imp2.domesticHotWaterSupply_Disp/imp2.TFA;
		imp2.lightElectricity_Disp        = imp2.lightElectricity_Disp/imp2.TFA;
		imp2.auxillaryElectricity_Disp    = imp2.auxillaryElectricity_Disp/imp2.TFA;
		imp2.totalElectricalSupply_Disp   = imp2.totalElectricalSupply_Disp/imp2.TFA;
		imp2.mainSpaceHtSupply_Disp       = imp2.mainSpaceHtSupply_Disp/imp2.TFA;
		imp2.secSpaceHtSupply_Disp        = imp2.secSpaceHtSupply_Disp/imp2.TFA;
		imp2.LZCTelecSold_Disp            = imp2.LZCTelecSold_Disp/imp2.TFA;
		imp2.LZCTelecDisp_Disp            = imp2.LZCTelecDisp_Disp/imp2.TFA;
		imp2.primaryFuelUsed_Disp         = imp2.primaryFuelUsed_Disp/imp2.TFA;
	    imp2.secFuelUsed_Disp             = imp2.secFuelUsed_Disp/imp2.TFA;
	}

	// Display results in base
	str_editHtDemImp2.Format("%.0f",imp2.totalSpaceHtSupply_Disp);
	str_editSpaceCoolingSupplyImp2.Format("%.0f",imp2.totalSpaceCoolingSupply_Disp);

	str_editDHWImp2.Format("%.0f",imp2.domesticHotWaterSupply_Disp);	
	str_editLightElecImp2.Format("%.0f",imp2.lightElectricity_Disp);	
	str_editAuxElecImp2.Format("%.0f",imp2.auxillaryElectricity_Disp);
	str_editTotalElecImp2.Format("%.0f",imp2.totalElectricalSupply_Disp);	

	str_editPrimaryFuelImp2.Format("%.0f",imp2.primaryFuelUsed_Disp);
	str_editSecFuelImp2.Format("%.0f",imp2.secFuelUsed_Disp);
	str_LZCTelecSoldImp2.Format("%.0f",imp2.LZCTelecSold_Disp);
	str_LZCTeleDispImp2.Format("%.0f",imp2.LZCTelecDisp_Disp);
	UpdateData(false);
}
void CDlg_Results::DisplayImp3ResultsForEnergyCostOrEmissions()
{
	if(chkEnergy == 1)
	{
		imp3.totalSpaceHtSupply_Disp      = imp3.totalSpaceHtSupply;
		imp3.totalSpaceCoolingSupply_Disp = imp3.totalSpaceCoolingSupply;
		imp3.domesticHotWaterSupply_Disp  = imp3.domesticHotWaterSupply;
		imp3.lightElectricity_Disp        = imp3.lightElectricity;
		imp3.auxillaryElectricity_Disp    = imp3.auxillaryElectricity;
		imp3.totalElectricalSupply_Disp   = imp3.totalElectricalSupply;
		imp3.mainSpaceHtSupply_Disp       = imp3.mainSpaceHtSupply;
		imp3.secSpaceHtSupply_Disp        = imp3.secSpaceHtSupply;
		imp3.LZCTelecSold_Disp        = imp3.LZCT_elecSold;
		imp3.LZCTelecDisp_Disp             = imp3.LZCT_elecDisplaced;
		imp3.primaryFuelUsed_Disp         = imp3.primaryFuelUsed;
	    imp3.secFuelUsed_Disp             = imp3.secFuelUsed;
	}
	else if(chkCost == 1)
	{
		imp3.totalSpaceHtSupply_Disp      = (imp3.mainSpaceHtSupply_fuelCost + imp3.secSpaceHtSupply_fuelCost);
		imp3.totalSpaceCoolingSupply_Disp = imp3.totalSpaceCoolingSupply_fuelCost;
		imp3.domesticHotWaterSupply_Disp  = imp3.domesticHotWaterSupply_fuelCost;
		imp3.lightElectricity_Disp        = imp3.lightElectricity_fuelCost;
		imp3.auxillaryElectricity_Disp    = imp3.auxillaryElectricity_fuelCost;
		imp3.totalElectricalSupply_Disp   = imp3.lightElectricity_fuelCost+ imp3.auxillaryElectricity_fuelCost;
		imp3.mainSpaceHtSupply_Disp       = imp3.mainSpaceHtSupply_fuelCost;
		imp3.secSpaceHtSupply_Disp        = imp3.secSpaceHtSupply_fuelCost;
		imp3.LZCTelecSold_Disp            = imp3.LZCTelecSold_fuelCost;
		imp3.LZCTelecDisp_Disp            = imp3.LZCTelecDisp_fuelCost;
		imp3.primaryFuelUsed_Disp         = imp3.primaryFuelUsed_fuelCost;
	    imp3.secFuelUsed_Disp             = imp3.secFuelUsed_fuelCost;
	}
	else if(chkEmissions == 1)
	{
		imp3.totalSpaceHtSupply_Disp      = (imp3.mainSpaceHtSupply_Emm + imp3.secSpaceHtSupply_Emm);
		imp3.totalSpaceCoolingSupply_Disp = imp3.totalSpaceCoolingSupply_Emm;
		imp3.domesticHotWaterSupply_Disp  = imp3.domesticHotWaterSupply_Emm;
		imp3.lightElectricity_Disp        = imp3.lightElectricity_Emm;
		imp3.auxillaryElectricity_Disp    = imp3.auxillaryElectricity_Emm;
		imp3.totalElectricalSupply_Disp   = imp3.lightElectricity_Emm+ imp3.auxillaryElectricity_Emm;
		imp3.mainSpaceHtSupply_Disp       = imp3.mainSpaceHtSupply_Emm;
		imp3.secSpaceHtSupply_Disp        = imp3.secSpaceHtSupply_Emm;
		imp3.LZCTelecSold_Disp            = imp3.LZCTelecSold_Emm;
		imp3.LZCTelecDisp_Disp            = imp3.LZCTelecDisp_Emm;
		imp3.primaryFuelUsed_Disp         = imp3.primaryFuelUsed_Emm;
	    imp3.secFuelUsed_Disp             = imp3.secFuelUsed_Emm;
	}

	// Display actual or perm2 values depending on user choice
	if(chkperm2 == 1)
	{
		imp3.totalSpaceHtSupply_Disp      = imp3.totalSpaceHtSupply_Disp/imp3.TFA;
		imp3.totalSpaceCoolingSupply_Disp = imp3.totalSpaceCoolingSupply_Disp/imp3.TFA;
		imp3.domesticHotWaterSupply_Disp  = imp3.domesticHotWaterSupply_Disp/imp3.TFA;
		imp3.lightElectricity_Disp        = imp3.lightElectricity_Disp/imp3.TFA;
		imp3.auxillaryElectricity_Disp    = imp3.auxillaryElectricity_Disp/imp3.TFA;
		imp3.totalElectricalSupply_Disp   = imp3.totalElectricalSupply_Disp/imp3.TFA;
		imp3.mainSpaceHtSupply_Disp       = imp3.mainSpaceHtSupply_Disp/imp3.TFA;
		imp3.secSpaceHtSupply_Disp        = imp3.secSpaceHtSupply_Disp/imp3.TFA;
		imp3.LZCTelecSold_Disp            = imp3.LZCTelecSold_Disp/imp3.TFA;
		imp3.LZCTelecDisp_Disp            = imp3.LZCTelecDisp_Disp/imp3.TFA;
		imp3.primaryFuelUsed_Disp         = imp3.primaryFuelUsed_Disp/imp3.TFA;
	    imp3.secFuelUsed_Disp             = imp3.secFuelUsed_Disp/imp3.TFA;
	}

	// Display results in base
	str_editHtDemImp3.Format("%.0f",imp3.totalSpaceHtSupply_Disp);
	str_editSpaceCoolingSupplyImp3.Format("%.0f",imp3.totalSpaceCoolingSupply_Disp);

	str_editDHWImp3.Format("%.0f",imp3.domesticHotWaterSupply_Disp);	
	str_editLightElecImp3.Format("%.0f",imp3.lightElectricity_Disp);	
	str_editAuxElecImp3.Format("%.0f",imp3.auxillaryElectricity_Disp);
	str_editTotalElecImp3.Format("%.0f",imp3.totalElectricalSupply_Disp);	

	str_editPrimaryFuelImp3.Format("%.0f",imp3.primaryFuelUsed_Disp);
	str_editSecFuelImp3.Format("%.0f",imp3.secFuelUsed_Disp);
	str_LZCTelecSoldImp3.Format("%.0f",imp3.LZCTelecSold_Disp);
	str_LZCTeleDispImp3.Format("%.0f",imp3.LZCTelecDisp_Disp);
	UpdateData(false);
}

void CDlg_Results::DisplayImp4ResultsForEnergyCostOrEmissions()
{
	if(chkEnergy == 1)
	{
		imp4.totalSpaceHtSupply_Disp      = imp4.totalSpaceHtSupply;
		imp4.totalSpaceCoolingSupply_Disp = imp4.totalSpaceCoolingSupply;
		imp4.domesticHotWaterSupply_Disp  = imp4.domesticHotWaterSupply;
		imp4.lightElectricity_Disp        = imp4.lightElectricity;
		imp4.auxillaryElectricity_Disp    = imp4.auxillaryElectricity;
		imp4.totalElectricalSupply_Disp   = imp4.totalElectricalSupply;
		imp4.mainSpaceHtSupply_Disp       = imp4.mainSpaceHtSupply;
		imp4.secSpaceHtSupply_Disp        = imp4.secSpaceHtSupply;
		imp4.LZCTelecSold_Disp            = imp4.LZCT_elecSold;
		imp4.LZCTelecDisp_Disp            = imp4.LZCT_elecDisplaced;
		imp4.primaryFuelUsed_Disp         = imp4.primaryFuelUsed;
	    imp4.secFuelUsed_Disp             = imp4.secFuelUsed;
	}
	else if(chkCost == 1)
	{
		imp4.totalSpaceHtSupply_Disp      = (imp4.mainSpaceHtSupply_fuelCost + imp4.secSpaceHtSupply_fuelCost);
		imp4.totalSpaceCoolingSupply_Disp = imp4.totalSpaceCoolingSupply_fuelCost;
		imp4.domesticHotWaterSupply_Disp  = imp4.domesticHotWaterSupply_fuelCost;
		imp4.lightElectricity_Disp        = imp4.lightElectricity_fuelCost;
		imp4.auxillaryElectricity_Disp    = imp4.auxillaryElectricity_fuelCost;
		imp4.totalElectricalSupply_Disp   = imp4.lightElectricity_fuelCost+ imp4.auxillaryElectricity_fuelCost;
		imp4.mainSpaceHtSupply_Disp       = imp4.mainSpaceHtSupply_fuelCost;
		imp4.secSpaceHtSupply_Disp        = imp4.secSpaceHtSupply_fuelCost;
		imp4.LZCTelecSold_Disp            = imp4.LZCTelecSold_fuelCost;
		imp4.LZCTelecDisp_Disp            = imp4.LZCTelecDisp_fuelCost;
		imp4.primaryFuelUsed_Disp         = imp4.primaryFuelUsed_fuelCost;
	    imp4.secFuelUsed_Disp             = imp4.secFuelUsed_fuelCost;
	}
	else if(chkEmissions == 1)
	{
		imp4.totalSpaceHtSupply_Disp      = (imp4.mainSpaceHtSupply_Emm + imp4.secSpaceHtSupply_Emm);
		imp4.totalSpaceCoolingSupply_Disp = imp4.totalSpaceCoolingSupply_Emm;
		imp4.domesticHotWaterSupply_Disp  = imp4.domesticHotWaterSupply_Emm;
		imp4.lightElectricity_Disp        = imp4.lightElectricity_Emm;
		imp4.auxillaryElectricity_Disp    = imp4.auxillaryElectricity_Emm;
		imp4.totalElectricalSupply_Disp   = imp4.lightElectricity_Emm+ imp4.auxillaryElectricity_Emm;
		imp4.mainSpaceHtSupply_Disp       = imp4.mainSpaceHtSupply_Emm;
		imp4.secSpaceHtSupply_Disp        = imp4.secSpaceHtSupply_Emm;
		imp4.LZCTelecSold_Disp            = imp4.LZCTelecSold_Emm;
		imp4.LZCTelecDisp_Disp            = imp4.LZCTelecDisp_Emm;
		imp4.primaryFuelUsed_Disp         = imp4.primaryFuelUsed_Emm;
	    imp4.secFuelUsed_Disp             = imp4.secFuelUsed_Emm;
	}

	// Display actual or perm2 values depending on user choice
	if(chkperm2 == 1)
	{
		imp4.totalSpaceHtSupply_Disp      = imp4.totalSpaceHtSupply_Disp/imp4.TFA;
		imp4.totalSpaceCoolingSupply_Disp = imp4.totalSpaceCoolingSupply_Disp/imp4.TFA;
		imp4.domesticHotWaterSupply_Disp  = imp4.domesticHotWaterSupply_Disp/imp4.TFA;
		imp4.lightElectricity_Disp        = imp4.lightElectricity_Disp/imp4.TFA;
		imp4.auxillaryElectricity_Disp    = imp4.auxillaryElectricity_Disp/imp4.TFA;
		imp4.totalElectricalSupply_Disp   = imp4.totalElectricalSupply_Disp/imp4.TFA;
		imp4.mainSpaceHtSupply_Disp       = imp4.mainSpaceHtSupply_Disp/imp4.TFA;
		imp4.secSpaceHtSupply_Disp        = imp4.secSpaceHtSupply_Disp/imp4.TFA;
		imp4.LZCTelecSold_Disp            = imp4.LZCTelecSold_Disp/imp4.TFA;
		imp4.LZCTelecDisp_Disp            = imp4.LZCTelecDisp_Disp/imp4.TFA;
		imp4.primaryFuelUsed_Disp         = imp4.primaryFuelUsed_Disp/imp4.TFA;
	    imp4.secFuelUsed_Disp             = imp4.secFuelUsed_Disp/imp4.TFA;

	}

	// Display results in base
	str_editHtDemImp4.Format("%.0f",imp4.totalSpaceHtSupply_Disp);
	str_editSpaceCoolingSupplyImp4.Format("%.0f",imp4.totalSpaceCoolingSupply_Disp);

	str_editDHWImp4.Format("%.0f",imp4.domesticHotWaterSupply_Disp);	
	str_editLightElecImp4.Format("%.0f",imp4.lightElectricity_Disp);	
	str_editAuxElecImp4.Format("%.0f",imp4.auxillaryElectricity_Disp);
	str_editTotalElecImp4.Format("%.0f",imp4.totalElectricalSupply_Disp);	

	str_editPrimaryFuelImp4.Format("%.0f",imp4.primaryFuelUsed_Disp);
	str_editSecFuelImp4.Format("%.0f",imp4.secFuelUsed_Disp);
	str_LZCTelecSoldImp4.Format("%.0f",imp4.LZCTelecSold_Disp);
	str_LZCTeleDispImp4.Format("%.0f",imp4.LZCTelecDisp_Disp);
	UpdateData(false);
}
void CDlg_Results::DisplayImp5ResultsForEnergyCostOrEmissions()
{
	if(chkEnergy == 1)
	{
		imp5.totalSpaceHtSupply_Disp      = imp5.totalSpaceHtSupply;
		imp5.totalSpaceCoolingSupply_Disp = imp5.totalSpaceCoolingSupply;
		imp5.domesticHotWaterSupply_Disp  = imp5.domesticHotWaterSupply;
		imp5.lightElectricity_Disp        = imp5.lightElectricity;
		imp5.auxillaryElectricity_Disp    = imp5.auxillaryElectricity;
		imp5.totalElectricalSupply_Disp   = imp5.totalElectricalSupply;
		imp5.mainSpaceHtSupply_Disp       = imp5.mainSpaceHtSupply;
		imp5.secSpaceHtSupply_Disp        = imp5.secSpaceHtSupply;
		imp5.LZCTelecSold_Disp            = imp5.LZCT_elecSold;
		imp5.LZCTelecDisp_Disp            = imp5.LZCT_elecDisplaced;
		imp5.primaryFuelUsed_Disp         = imp5.primaryFuelUsed;
	    imp5.secFuelUsed_Disp             = imp5.secFuelUsed;
	}
	else if(chkCost == 1)
	{
		imp5.totalSpaceHtSupply_Disp      = (imp5.mainSpaceHtSupply_fuelCost + imp5.secSpaceHtSupply_fuelCost);
		imp5.totalSpaceCoolingSupply_Disp = imp5.totalSpaceCoolingSupply_fuelCost;
		imp5.domesticHotWaterSupply_Disp  = imp5.domesticHotWaterSupply_fuelCost;
		imp5.lightElectricity_Disp        = imp5.lightElectricity_fuelCost;
		imp5.auxillaryElectricity_Disp    = imp5.auxillaryElectricity_fuelCost;
		imp5.totalElectricalSupply_Disp   = imp5.lightElectricity_fuelCost+ imp5.auxillaryElectricity_fuelCost;
		imp5.mainSpaceHtSupply_Disp       = imp5.mainSpaceHtSupply_fuelCost;
		imp5.secSpaceHtSupply_Disp        = imp5.secSpaceHtSupply_fuelCost;
		imp5.LZCTelecSold_Disp            = imp5.LZCTelecSold_fuelCost;
		imp5.LZCTelecDisp_Disp            = imp5.LZCTelecDisp_fuelCost;
		imp5.primaryFuelUsed_Disp         = imp5.primaryFuelUsed_fuelCost;
	    imp5.secFuelUsed_Disp             = imp5.secFuelUsed_fuelCost;
	}
	else if(chkEmissions == 1)
	{
		imp5.totalSpaceHtSupply_Disp      = (imp5.mainSpaceHtSupply_Emm + imp5.secSpaceHtSupply_Emm);
		imp5.totalSpaceCoolingSupply_Disp = imp5.totalSpaceCoolingSupply_Emm;
		imp5.domesticHotWaterSupply_Disp  = imp5.domesticHotWaterSupply_Emm;
		imp5.lightElectricity_Disp        = imp5.lightElectricity_Emm;
		imp5.auxillaryElectricity_Disp    = imp5.auxillaryElectricity_Emm;
		imp5.totalElectricalSupply_Disp   = imp5.lightElectricity_Emm+ imp5.auxillaryElectricity_Emm;
		imp5.mainSpaceHtSupply_Disp       = imp5.mainSpaceHtSupply_Emm;
		imp5.secSpaceHtSupply_Disp        = imp5.secSpaceHtSupply_Emm;
		imp5.LZCTelecSold_Disp            = imp5.LZCTelecSold_Emm;
		imp5.LZCTelecDisp_Disp            = imp5.LZCTelecDisp_Emm;
		imp5.primaryFuelUsed_Disp         = imp5.primaryFuelUsed_Emm;
	    imp5.secFuelUsed_Disp             = imp5.secFuelUsed_Emm;
	}

	// Display actual or perm2 values depending on user choice
	if(chkperm2 == 1)
	{
		imp5.totalSpaceHtSupply_Disp      = imp5.totalSpaceHtSupply_Disp/imp5.TFA;
		imp5.totalSpaceCoolingSupply_Disp = imp5.totalSpaceCoolingSupply_Disp/imp5.TFA;
		imp5.domesticHotWaterSupply_Disp  = imp5.domesticHotWaterSupply_Disp/imp5.TFA;
		imp5.lightElectricity_Disp        = imp5.lightElectricity_Disp/imp5.TFA;
		imp5.auxillaryElectricity_Disp    = imp5.auxillaryElectricity_Disp/imp5.TFA;
		imp5.totalElectricalSupply_Disp   = imp5.totalElectricalSupply_Disp/imp5.TFA;
		imp5.mainSpaceHtSupply_Disp       = imp5.mainSpaceHtSupply_Disp/imp5.TFA;
		imp5.secSpaceHtSupply_Disp        = imp5.secSpaceHtSupply_Disp/imp5.TFA;
		imp5.LZCTelecSold_Disp            = imp5.LZCTelecSold_Disp/imp5.TFA;
		imp5.LZCTelecDisp_Disp            = imp5.LZCTelecDisp_Disp/imp5.TFA;
		imp5.primaryFuelUsed_Disp         = imp5.primaryFuelUsed_Disp/imp5.TFA;
	    imp5.secFuelUsed_Disp             = imp5.secFuelUsed_Disp/imp5.TFA;
	}

	// Display results in base
	str_editHtDemImp5.Format("%.0f",imp5.totalSpaceHtSupply_Disp);
	str_editSpaceCoolingSupplyImp5.Format("%.0f",imp5.totalSpaceCoolingSupply_Disp);

	str_editDHWImp5.Format("%.0f",imp5.domesticHotWaterSupply_Disp);	
	str_editLightElecImp5.Format("%.0f",imp5.lightElectricity_Disp);	
	str_editAuxElecImp5.Format("%.0f",imp5.auxillaryElectricity_Disp);
	str_editTotalElecImp5.Format("%.0f",imp5.totalElectricalSupply_Disp);	

	str_editPrimaryFuelImp5.Format("%.0f",imp5.primaryFuelUsed_Disp);
	str_editSecFuelImp5.Format("%.0f",imp5.secFuelUsed_Disp);
	str_LZCTelecSoldImp5.Format("%.0f",imp5.LZCTelecSold_Disp);
	str_LZCTeleDispImp5.Format("%.0f",imp5.LZCTelecDisp_Disp);
	UpdateData(false);
}

void CDlg_Results::DisplayResultsBasedOnCaseForOpenedProject()
{
	
		if(display_base_results == true)
		{
			display_base_results = false;

			//----------------------------------------------------------------------
			// Display Results
			//----------------------------------------------------------------------
			str_TCID.Format("%s",XIACSOL_string_disp1);
			str_TCID2.Format("%s",XIACSOL_string_disp2);

			str_editHtDemBase.Format("%.0f",totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupply.Format("%.0f",totalSpaceCoolingSupply_Disp);

			str_editDHW.Format("%.0f",domesticHotWaterSupply_Disp);	
			str_editLightElec.Format("%.0f",lightElectricity_Disp);	
			str_editAuxElec.Format("%.0f",auxillaryElectricity_Disp);
			str_editTotalElec.Format("%.0f",totalElectricalSupply_Disp);	

			str_editPrimaryFuelBase.Format("%.0f",primaryFuelUsed_Disp);
			str_editSecFuelBase.Format("%.0f",secFuelUsed_Disp);
			str_LZCTelecSoldBase.Format("%.0f", LZCTelecSold_Disp);
			str_LZCTeleDispBase.Format("%.0f",LZCTelecDisp_Disp);
		}

		// SELECT BASE
		if(display_imp1_results == true) 
		{
			display_imp1_results = false;

			//----------------------------------------------------------------------
			// Display Results
			//----------------------------------------------------------------------
			str_TCID.Format("%s",XIACSOL_string_disp1);
			str_TCID2.Format("%s",XIACSOL_string_disp2);

			str_editHtDemImp1.Format("%.0f",totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp1.Format("%.0f",totalSpaceCoolingSupply_Disp);

			str_editDHWImp1.Format("%.0f",domesticHotWaterSupply_Disp);	
			str_editLightElecImp1.Format("%.0f",lightElectricity_Disp);	
			str_editAuxElecImp1.Format("%.0f",auxillaryElectricity_Disp);
			str_editTotalElecImp1.Format("%.0f",totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp1.Format("%.0f",primaryFuelUsed_Disp);
			str_editSecFuelImp1.Format("%.0f",secFuelUsed_Disp);
			str_LZCTelecSoldImp1.Format("%.0f", LZCTelecSold_Disp);
			str_LZCTeleDispImp1.Format("%.0f",LZCTelecDisp_Disp);
		}
		// SELECT IMPROVEMENT1
		if(display_imp2_results == true) 
		{
			display_imp2_results = false;
			//----------------------------------------------------------------------
			// Display Results
			//----------------------------------------------------------------------
			str_TCID.Format("%s",XIACSOL_string_disp1);
			str_TCID2.Format("%s",XIACSOL_string_disp2);

			str_editHtDemImp2.Format("%.0f",totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp2.Format("%.0f",totalSpaceCoolingSupply_Disp);

			str_editDHWImp2.Format("%.0f",domesticHotWaterSupply_Disp);	
			str_editLightElecImp2.Format("%.0f",lightElectricity_Disp);	
			str_editAuxElecImp2.Format("%.0f",auxillaryElectricity_Disp);
			str_editTotalElecImp2.Format("%.0f",totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp2.Format("%.0f",primaryFuelUsed_Disp);
			str_editSecFuelImp2.Format("%.0f",secFuelUsed_Disp);
			str_LZCTelecSoldImp2.Format("%.0f", LZCTelecSold_Disp);
			str_LZCTeleDispImp2.Format("%.0f",LZCTelecDisp_Disp);

			return;
		}
		// SELECT IMPROVEMENT2
		 if(display_imp3_results == true) 
		{
			display_imp3_results = false;
			//----------------------------------------------------------------------
			// Display Results
			//----------------------------------------------------------------------
			str_TCID.Format("%s",XIACSOL_string_disp1);
			str_TCID2.Format("%s",XIACSOL_string_disp2);

			str_editHtDemImp3.Format("%.0f",totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp3.Format("%.0f",totalSpaceCoolingSupply_Disp);

			str_editDHWImp3.Format("%.0f",domesticHotWaterSupply_Disp);	
			str_editLightElecImp3.Format("%.0f",lightElectricity_Disp);	
			str_editAuxElecImp3.Format("%.0f",auxillaryElectricity_Disp);
			str_editTotalElecImp3.Format("%.0f",totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp3.Format("%.0f",primaryFuelUsed_Disp);
			str_editSecFuelImp3.Format("%.0f",secFuelUsed_Disp);
			str_LZCTelecSoldImp3.Format("%.0f", LZCTelecSold_Disp);
			str_LZCTeleDispImp3.Format("%.0f",LZCTelecDisp_Disp);
		}
		// SELECT IMPROVEMENT3
		if(display_imp4_results == true) 
		{
			display_imp4_results = false;
			//----------------------------------------------------------------------
			// Display Results
			//----------------------------------------------------------------------
			str_TCID.Format("%s",XIACSOL_string_disp1);
			str_TCID2.Format("%s",XIACSOL_string_disp2);

			str_editHtDemImp4.Format("%.0f",totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp4.Format("%.01f",totalSpaceCoolingSupply_Disp);

			str_editDHWImp4.Format("%.0f",domesticHotWaterSupply_Disp);	
			str_editLightElecImp4.Format("%.0f",lightElectricity_Disp);	
			str_editAuxElecImp4.Format("%.0f",auxillaryElectricity_Disp);
			str_editTotalElecImp4.Format("%.0f",totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp4.Format("%.0f",primaryFuelUsed_Disp);
			str_editSecFuelImp4.Format("%.0f",secFuelUsed_Disp);
			str_LZCTelecSoldImp4.Format("%.0f",LZCTelecSold_Disp);
			str_LZCTeleDispImp4.Format("%.0f",LZCTelecDisp_Disp);
		}
		// SELECT IMPROVEMENT4
		if(display_imp5_results == true)
		{	
			display_imp5_results = false;
			//----------------------------------------------------------------------
			// Display Results
			//----------------------------------------------------------------------
			str_TCID.Format("%s",XIACSOL_string_disp1);
			str_TCID2.Format("%s",XIACSOL_string_disp2);

			str_editHtDemImp5.Format("%.0f",totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp5.Format("%.0f",totalSpaceCoolingSupply_Disp);

			str_editDHWImp5.Format("%.0f",domesticHotWaterSupply_Disp);	
			str_editLightElecImp5.Format("%.0f",lightElectricity_Disp);	
			str_editAuxElecImp5.Format("%.0f",auxillaryElectricity_Disp);
			str_editTotalElecImp5.Format("%.0f",totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp5.Format("%.0f",primaryFuelUsed_Disp);
			str_editSecFuelImp5.Format("%.0f",secFuelUsed_Disp);
			str_LZCTelecSoldImp5.Format("%.0f",LZCTelecSold_Disp);
			str_LZCTeleDispImp5.Format("%.0f",LZCTelecDisp_Disp);
		}
	
}

void CDlg_Results::DisplayResultsBasedOnCaseForRunningProject()
{	
	//if (is_file_opened ==true)
	//{
	//	if(display_base_results == true)
	//	{
	//		display_base_results = false;

	//		//----------------------------------------------------------------------
	//		// Display Results
	//		//----------------------------------------------------------------------
	//		str_TCID.Format("%s",XIACSOL_string_disp1);
	//		str_TCID2.Format("%s",XIACSOL_string_disp2);

	//		str_editHtDemBase.Format("%.0f",totalSpaceHtSupply_Disp);
	//		str_editSpaceCoolingSupply.Format("%.0f",totalSpaceCoolingSupply_Disp);

	//		str_editDHW.Format("%.0f",domesticHotWaterSupply_Disp);	
	//		str_editLightElec.Format("%.0f",lightElectricity_Disp);	
	//		str_editAuxElec.Format("%.0f",auxillaryElectricity_Disp);
	//		str_editTotalElec.Format("%.0f",totalElectricalSupply_Disp);	

	//		str_editPrimaryFuelBase.Format("%.0f",primaryFuelUsed_Disp);
	//		str_editSecFuelBase.Format("%.0f",secFuelUsed_Disp);
	//		str_LZCTelecSoldBase.Format("%.0f", LZCTelecSold_Disp);
	//		str_LZCTeleDispBase.Format("%.0f",LZCTelecDisp_Disp);
	//	}

	//	// SELECT BASE
	//	if(display_imp1_results == true) 
	//	{
	//		display_imp1_results = false;

	//		//----------------------------------------------------------------------
	//		// Display Results
	//		//----------------------------------------------------------------------
	//		str_TCID.Format("%s",XIACSOL_string_disp1);
	//		str_TCID2.Format("%s",XIACSOL_string_disp2);

	//		str_editHtDemImp1.Format("%.0f",totalSpaceHtSupply_Disp);
	//		str_editSpaceCoolingSupplyImp1.Format("%.0f",totalSpaceCoolingSupply_Disp);

	//		str_editDHWImp1.Format("%.0f",domesticHotWaterSupply_Disp);	
	//		str_editLightElecImp1.Format("%.0f",lightElectricity_Disp);	
	//		str_editAuxElecImp1.Format("%.0f",auxillaryElectricity_Disp);
	//		str_editTotalElecImp1.Format("%.0f",totalElectricalSupply_Disp);	

	//		str_editPrimaryFuelImp1.Format("%.0f",primaryFuelUsed_Disp);
	//		str_editSecFuelImp1.Format("%.0f",secFuelUsed_Disp);
	//		str_LZCTelecSoldImp1.Format("%.0f", LZCTelecSold_Disp);
	//		str_LZCTeleDispImp1.Format("%.0f",LZCTelecDisp_Disp);
	//	}
	//	// SELECT IMPROVEMENT1
	//	if(display_imp2_results == true) 
	//	{
	//		display_imp2_results = false;
	//		//----------------------------------------------------------------------
	//		// Display Results
	//		//----------------------------------------------------------------------
	//		str_TCID.Format("%s",XIACSOL_string_disp1);
	//		str_TCID2.Format("%s",XIACSOL_string_disp2);

	//		str_editHtDemImp2.Format("%.0f",totalSpaceHtSupply_Disp);
	//		str_editSpaceCoolingSupplyImp2.Format("%.0f",totalSpaceCoolingSupply_Disp);

	//		str_editDHWImp2.Format("%.0f",domesticHotWaterSupply_Disp);	
	//		str_editLightElecImp2.Format("%.0f",lightElectricity_Disp);	
	//		str_editAuxElecImp2.Format("%.0f",auxillaryElectricity_Disp);
	//		str_editTotalElecImp2.Format("%.0f",totalElectricalSupply_Disp);	

	//		str_editPrimaryFuelImp2.Format("%.0f",primaryFuelUsed_Disp);
	//		str_editSecFuelImp2.Format("%.0f",secFuelUsed_Disp);
	//		str_LZCTelecSoldImp2.Format("%.0f", LZCTelecSold_Disp);
	//		str_LZCTeleDispImp2.Format("%.0f",LZCTelecDisp_Disp);

	//		return;
	//	}
	//	// SELECT IMPROVEMENT2
	//	 if(display_imp3_results == true) 
	//	{
	//		display_imp3_results = false;
	//		//----------------------------------------------------------------------
	//		// Display Results
	//		//----------------------------------------------------------------------
	//		str_TCID.Format("%s",XIACSOL_string_disp1);
	//		str_TCID2.Format("%s",XIACSOL_string_disp2);

	//		str_editHtDemImp3.Format("%.0f",totalSpaceHtSupply_Disp);
	//		str_editSpaceCoolingSupplyImp3.Format("%.0f",totalSpaceCoolingSupply_Disp);

	//		str_editDHWImp3.Format("%.0f",domesticHotWaterSupply_Disp);	
	//		str_editLightElecImp3.Format("%.0f",lightElectricity_Disp);	
	//		str_editAuxElecImp3.Format("%.0f",auxillaryElectricity_Disp);
	//		str_editTotalElecImp3.Format("%.0f",totalElectricalSupply_Disp);	

	//		str_editPrimaryFuelImp3.Format("%.0f",primaryFuelUsed_Disp);
	//		str_editSecFuelImp3.Format("%.0f",secFuelUsed_Disp);
	//		str_LZCTelecSoldImp3.Format("%.0f", LZCTelecSold_Disp);
	//		str_LZCTeleDispImp3.Format("%.0f",LZCTelecDisp_Disp);
	//	}
	//	// SELECT IMPROVEMENT3
	//	if(display_imp4_results == true) 
	//	{
	//		display_imp4_results = false;
	//		//----------------------------------------------------------------------
	//		// Display Results
	//		//----------------------------------------------------------------------
	//		str_TCID.Format("%s",XIACSOL_string_disp1);
	//		str_TCID2.Format("%s",XIACSOL_string_disp2);

	//		str_editHtDemImp4.Format("%.0f",totalSpaceHtSupply_Disp);
	//		str_editSpaceCoolingSupplyImp4.Format("%.01f",totalSpaceCoolingSupply_Disp);

	//		str_editDHWImp4.Format("%.0f",domesticHotWaterSupply_Disp);	
	//		str_editLightElecImp4.Format("%.0f",lightElectricity_Disp);	
	//		str_editAuxElecImp4.Format("%.0f",auxillaryElectricity_Disp);
	//		str_editTotalElecImp4.Format("%.0f",totalElectricalSupply_Disp);	

	//		str_editPrimaryFuelImp4.Format("%.0f",primaryFuelUsed_Disp);
	//		str_editSecFuelImp4.Format("%.0f",secFuelUsed_Disp);
	//		str_LZCTelecSoldImp4.Format("%.0f",LZCTelecSold_Disp);
	//		str_LZCTeleDispImp4.Format("%.0f",LZCTelecDisp_Disp);
	//	}
	//	// SELECT IMPROVEMENT4
	//	if(display_imp5_results == true)
	//	{	
	//		display_imp5_results = false;
	//		//----------------------------------------------------------------------
	//		// Display Results
	//		//----------------------------------------------------------------------
	//		str_TCID.Format("%s",XIACSOL_string_disp1);
	//		str_TCID2.Format("%s",XIACSOL_string_disp2);

	//		str_editHtDemImp5.Format("%.0f",totalSpaceHtSupply_Disp);
	//		str_editSpaceCoolingSupplyImp5.Format("%.0f",totalSpaceCoolingSupply_Disp);

	//		str_editDHWImp5.Format("%.0f",domesticHotWaterSupply_Disp);	
	//		str_editLightElecImp5.Format("%.0f",lightElectricity_Disp);	
	//		str_editAuxElecImp5.Format("%.0f",auxillaryElectricity_Disp);
	//		str_editTotalElecImp5.Format("%.0f",totalElectricalSupply_Disp);	

	//		str_editPrimaryFuelImp5.Format("%.0f",primaryFuelUsed_Disp);
	//		str_editSecFuelImp5.Format("%.0f",secFuelUsed_Disp);
	//		str_LZCTelecSoldImp5.Format("%.0f",LZCTelecSold_Disp);
	//		str_LZCTeleDispImp5.Format("%.0f",LZCTelecDisp_Disp);
	//	}
	//}
	//// Else if results are not being read from file
	//else 
	//{		
		//----------------------------------------------------------------------
		// DISPLAY RESULTS FOR BASE
		//----------------------------------------------------------------------
		if(is_base_selected == true) 
		{
			if(is_base_changed == true)
			{
				is_base_changed = false;
				CopyCurrentToBase();				
			}	
			str_editHtDemBase.Format("%.0f",base.totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupply.Format("%.0f",base.totalSpaceCoolingSupply_Disp);

			str_editDHW.Format("%.0f",base.domesticHotWaterSupply_Disp);	
			str_editLightElec.Format("%.0f",base.lightElectricity_Disp);	
			str_editAuxElec.Format("%.0f",base.auxillaryElectricity_Disp);
			str_editTotalElec.Format("%.0f",base.totalElectricalSupply_Disp);	

			str_editPrimaryFuelBase.Format("%.0f",base.primaryFuelUsed_Disp);
			str_editSecFuelBase.Format("%.0f",base.secFuelUsed_Disp);
			str_LZCTelecSoldBase.Format("%.0f",  base.LZCTelecSold_Disp);
			str_LZCTeleDispBase.Format("%.0f",base.LZCTelecDisp_Disp);
		}

		//----------------------------------------------------------------------
		// DISPLAY RESULTS FOR IMPROVEMENT 1
		//----------------------------------------------------------------------
		if(is_imp1_selected == true) 
		{
			if(is_imp1_changed == true)
			{
				is_imp1_changed = false;
				CopyCurrentToImprovement1();
			}

			str_editHtDemImp1.Format("%.0f",imp1.totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp1.Format("%.0f",imp1.totalSpaceCoolingSupply_Disp);

			str_editDHWImp1.Format("%.0f",imp1.domesticHotWaterSupply_Disp);	
			str_editLightElecImp1.Format("%.0f",imp1.lightElectricity_Disp);	
			str_editAuxElecImp1.Format("%.0f",imp1.auxillaryElectricity_Disp);
			str_editTotalElecImp1.Format("%.0f",imp1.totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp1.Format("%.0f",imp1.primaryFuelUsed_Disp);
			str_editSecFuelImp1.Format("%.0f",imp1.secFuelUsed_Disp);
			str_LZCTelecSoldImp1.Format("%.0f",imp1.LZCTelecSold_Disp);
			str_LZCTeleDispImp1.Format("%.0f",imp1.LZCTelecDisp_Disp);
		}
		
		//----------------------------------------------------------------------
		// DISPLAY RESULTS FOR IMPROVEMENT 2
		//----------------------------------------------------------------------
		if(is_imp2_selected == true) 
		{		
			if(is_imp2_changed == true)
			{
				is_imp2_changed = false;
				CopyCurrentToImprovement2();
			}

			str_editHtDemImp2.Format("%.0f",imp2.totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp2.Format("%.0f",imp2.totalSpaceCoolingSupply_Disp);

			str_editDHWImp2.Format("%.0f",imp2.domesticHotWaterSupply_Disp);	
			str_editLightElecImp2.Format("%.0f",imp2.lightElectricity_Disp);	
			str_editAuxElecImp2.Format("%.0f",imp2.auxillaryElectricity_Disp);
			str_editTotalElecImp2.Format("%.0f",imp2.totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp2.Format("%.0f",imp2.primaryFuelUsed_Disp);
			str_editSecFuelImp2.Format("%.0f",imp2.secFuelUsed_Disp);
			str_LZCTelecSoldImp2.Format("%.0f", imp2.LZCTelecSold_Disp);
			str_LZCTeleDispImp2.Format("%.0f",imp2.LZCTelecDisp_Disp);
		}
		
		//----------------------------------------------------------------------
		// DISPLAY RESULTS FOR IMPROVEMENT 3
		//----------------------------------------------------------------------
		if(is_imp3_selected == true)
		{
			if(is_imp3_changed == true)
			{
				is_imp3_changed = false;
				CopyCurrentToImprovement3();
			}

			str_editHtDemImp3.Format("%.0f",imp3.totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp3.Format("%.0f",imp3.totalSpaceCoolingSupply_Disp);

			str_editDHWImp3.Format("%.0f",imp3.domesticHotWaterSupply_Disp);	
			str_editLightElecImp3.Format("%.0f",imp3.lightElectricity_Disp);	
			str_editAuxElecImp3.Format("%.0f",imp3.auxillaryElectricity_Disp);
			str_editTotalElecImp3.Format("%.0f",imp3.totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp3.Format("%.0f",imp3.primaryFuelUsed_Disp);
			str_editSecFuelImp3.Format("%.0f",imp3.secFuelUsed_Disp);
			str_LZCTelecSoldImp3.Format("%.0f", imp3.LZCTelecSold_Disp);
			str_LZCTeleDispImp3.Format("%.0f",imp3.LZCTelecDisp_Disp);
		}
		
		//----------------------------------------------------------------------
		// DISPLAY RESULTS FOR IMPROVEMENT 4
		//----------------------------------------------------------------------
		if	(is_imp4_selected == true) 
        {
			if(is_imp4_changed == true)
			{
				is_imp4_changed = false;
				CopyCurrentToImprovement4();
			}

			str_editHtDemImp4.Format("%.0f",imp4.totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp4.Format("%.0f",imp4.totalSpaceCoolingSupply_Disp);

			str_editDHWImp4.Format("%.0f",imp4.domesticHotWaterSupply_Disp);	
			str_editLightElecImp4.Format("%.0f",imp4.lightElectricity_Disp);	
			str_editAuxElecImp4.Format("%.0f",imp4.auxillaryElectricity_Disp);
			str_editTotalElecImp4.Format("%.0f",imp4.totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp4.Format("%.0f",imp4.primaryFuelUsed_Disp);
			str_editSecFuelImp4.Format("%.0f",imp4.secFuelUsed_Disp);
			str_LZCTelecSoldImp4.Format("%.0f", imp4.LZCTelecSold_Disp);
			str_LZCTeleDispImp4.Format("%.0f",imp4.LZCTelecDisp_Disp);
		}
		
		//----------------------------------------------------------------------
		// DISPLAY RESULTS FOR IMPROVEMENT 5
		//----------------------------------------------------------------------
		if (is_imp5_selected == true) 
		{
			if(is_imp5_changed == true)
			{
				is_imp5_changed = false;
				CopyCurrentToImprovement5();
			}
			str_editHtDemImp5.Format("%.0f",imp5.totalSpaceHtSupply_Disp);
			str_editSpaceCoolingSupplyImp5.Format("%.0f",imp5.totalSpaceCoolingSupply_Disp);

			str_editDHWImp5.Format("%.0f",imp5.domesticHotWaterSupply_Disp);	
			str_editLightElecImp5.Format("%.0f",imp5.lightElectricity_Disp);	
			str_editAuxElecImp5.Format("%.0f",imp5.auxillaryElectricity_Disp);
			str_editTotalElecImp5.Format("%.0f",imp5.totalElectricalSupply_Disp);	

			str_editPrimaryFuelImp5.Format("%.0f",imp5.primaryFuelUsed_Disp);
			str_editSecFuelImp5.Format("%.0f",imp5.secFuelUsed_Disp);
			str_LZCTelecSoldImp5.Format("%.0f", imp5.LZCTelecSold_Disp);
			str_LZCTeleDispImp5.Format("%.0f",imp5.LZCTelecDisp_Disp);
		}
		
	
	UpdateData(false);

	DisplayResultsInList();
}

BOOL CDlg_Results::OnInitDialog()
{
	CDialog::OnInitDialog();
	is_results_values_read_first_time = true;

	m_editFloorArea.EnableWindow(FALSE);

	CFont *m_FontSmall = new CFont;
	m_FontSmall->CreatePointFont(52, "Arial");

	m_labelsmall1.SetFont(m_FontSmall); 
	m_labelsmall2.SetFont(m_FontSmall); ;
	m_labelsmall3.SetFont(m_FontSmall); 
	m_labelsmall4.SetFont(m_FontSmall); 
	m_labelsmall5.SetFont(m_FontSmall); 
	m_labelsmall.SetFont(m_FontSmall); 

	m_labelCO2small.SetFont(m_FontSmall); 

	CFont *m_Font1 = new CFont;
	m_Font1->CreatePointFont(70, "Arial Bold");

	m_labelHL1.SetFont(m_Font1); 
	m_labelHL1.SetTextColor(BLUE);

	m_labelHL2.SetFont(m_Font1); 
	m_labelHL2.SetTextColor(BLUE);

	m_labelHL3.SetFont(m_Font1); 
	m_labelHL3.SetTextColor(BLUE);

	m_labelHL4.SetFont(m_Font1); 
	m_labelHL4.SetTextColor(BLUE);

	m_labelHL5.SetFont(m_Font1); 
	m_labelHL5.SetTextColor(BLUE);

	m_labelHL6.SetFont(m_Font1); 
	m_labelHL6.SetTextColor(BLUE);
	
	// Change background color for Heating Supply
	m_labelspaceHeating.SetBkColor(LIGHTGRAY);
	m_editHtDemCurrent.SetBackColor(LIGHTGRAY);
	m_editHtDemBase.SetBackColor(LIGHTGRAY);
	m_editHtDemImp1.SetBackColor(LIGHTGRAY);
	m_editHtDemImp2.SetBackColor(LIGHTGRAY);
	m_editHtDemImp3.SetBackColor(LIGHTGRAY);
	m_editHtDemImp4.SetBackColor(LIGHTGRAY);
	m_editHtDemImp5.SetBackColor(LIGHTGRAY);

	m_labelCooling.SetBkColor(WHITE);
	m_editSpaceCoolingSupplyCurrent.SetBackColor(WHITE);
	m_editSpaceCoolingSupply.SetBackColor(WHITE);
	m_editSpaceCoolingSupplyImp1.SetBackColor(WHITE);
	m_editSpaceCoolingSupplyImp2.SetBackColor(WHITE);
	m_editSpaceCoolingSupplyImp3.SetBackColor(WHITE);
	m_editSpaceCoolingSupplyImp4.SetBackColor(WHITE);
	m_editSpaceCoolingSupplyImp5.SetBackColor(WHITE);

	// Change background color for DHW
	m_labelDHW.SetBkColor(LIGHTGRAY);
	m_editDHWCurrent.SetBackColor(LIGHTGRAY);
	m_editDHW.SetBackColor(LIGHTGRAY);
	m_editDHWImp1.SetBackColor(LIGHTGRAY);
	m_editDHWImp2.SetBackColor(LIGHTGRAY);
	m_editDHWImp3.SetBackColor(LIGHTGRAY);
	m_editDHWImp4.SetBackColor(LIGHTGRAY);
	m_editDHWImp5.SetBackColor(LIGHTGRAY);

	m_labelLighting.SetBkColor(WHITE);
	m_editLightCurrent.SetBackColor(WHITE);
	m_editLightElec.SetBackColor(WHITE);
	m_editLightElecImp1.SetBackColor(WHITE);
	m_editLightElecImp2.SetBackColor(WHITE);
	m_editLightElecImp3.SetBackColor(WHITE);
	m_editLightElecImp4.SetBackColor(WHITE);
	m_editLightElecImp5.SetBackColor(WHITE);

	// Change background color for DHW
	m_labelAuxElec.SetBkColor(LIGHTGRAY);
	m_editAuxElecCurrent.SetBackColor(LIGHTGRAY);
	m_editAuxElec.SetBackColor(LIGHTGRAY);
	m_editAuxElecImp1.SetBackColor(LIGHTGRAY);
	m_editAuxElecImp2.SetBackColor(LIGHTGRAY);
	m_editAuxElecImp3.SetBackColor(LIGHTGRAY);
	m_editAuxElecImp4.SetBackColor(LIGHTGRAY);
	m_editAuxElecImp5.SetBackColor(LIGHTGRAY);

	m_labelRenSupply.SetBkColor(WHITE);
	m_editTotalElecCurrent.SetBackColor(WHITE);
	m_editTotalElec.SetBackColor(WHITE);
	m_editTotalElecImp1.SetBackColor(WHITE);
	m_editTotalElecImp2.SetBackColor(WHITE);
	m_editTotalElecImp3.SetBackColor(WHITE);
	m_editTotalElecImp4.SetBackColor(WHITE);
	m_editTotalElecImp5.SetBackColor(WHITE);

	// Change background color for Primary Fuel
	m_labelPrimaryFuel.SetBkColor(LIGHTGRAY);
	m_editPrimFuelCurrent.SetBackColor(LIGHTGRAY);
	m_editPrimaryFuelBase.SetBackColor(LIGHTGRAY);
	m_editPrimaryFuelImp1.SetBackColor(LIGHTGRAY);
	m_editPrimaryFuelImp2.SetBackColor(LIGHTGRAY);
	m_editPrimaryFuelImp3.SetBackColor(LIGHTGRAY);
	m_editPrimaryFuelImp4.SetBackColor(LIGHTGRAY);
	m_editPrimaryFuelImp5.SetBackColor(LIGHTGRAY);

	m_editTotalEmissions.SetBackColor(LIGHTGRAY);
	m_editTotalEmissionsImp1.SetBackColor(LIGHTGRAY);
	m_editTotalEmissionsImp2.SetBackColor(LIGHTGRAY);
	m_editTotalEmissionsImp3.SetBackColor(LIGHTGRAY);
	m_editTotalEmissionsImp4.SetBackColor(LIGHTGRAY);
	m_editTotalEmissionsImp5.SetBackColor(LIGHTGRAY);

	m_labelSecFuel.SetBkColor(WHITE);
	m_editSecFuelCurrent.SetBackColor(WHITE);
	m_editSecFuelBase.SetBackColor(WHITE);
	m_editSecFuelImp1.SetBackColor(WHITE);
	m_editSecFuelImp2.SetBackColor(WHITE);
	m_editSecFuelImp3.SetBackColor(WHITE);
	m_editSecFuelImp4.SetBackColor(WHITE);
	m_editSecFuelImp5.SetBackColor(WHITE);

	m_labelElecSold.SetBkColor(LIGHTGRAY);
	m_editLZCTElecSoldCurrent.SetBackColor(LIGHTGRAY);
	m_LZCTelecSoldBase.SetBackColor(LIGHTGRAY);
	m_LZCTelecSoldImp1.SetBackColor(LIGHTGRAY);
	m_LZCTelecSoldImp2.SetBackColor(LIGHTGRAY);
	m_LZCTelecSoldImp3.SetBackColor(LIGHTGRAY);
	m_LZCTelecSoldImp4.SetBackColor(LIGHTGRAY);
	m_LZCTelecSoldImp5.SetBackColor(LIGHTGRAY);
	
	m_labelTotElecDisp.SetBkColor(WHITE);
	m_editLZCTElecDispCurrent.SetBackColor(WHITE);
	m_LZCTeleDispBase.SetBackColor(WHITE);
	m_LZCTeleDispImp1.SetBackColor(WHITE);
	m_LZCTeleDispImp2.SetBackColor(WHITE);
	m_LZCTeleDispImp3.SetBackColor(WHITE);
	m_LZCTeleDispImp4.SetBackColor(WHITE);
	m_LZCTeleDispImp5.SetBackColor(WHITE);
	
	m_labelCost.SetBkColor(WHITE);
	
	m_labelEmm.SetBkColor(WHITE);
	m_labelElec.SetBkColor(WHITE);
	m_labelElec2.SetBkColor(WHITE);
	m_labelElec3.SetBkColor(WHITE);

	//m_editTotalCost2Imp5;
	//---------------------------------------------
	// Add strings to drop downs/lists
	//---------------------------------------------
	//	CLIMATE
	//---------------------------------------------
	unsigned int i = 0;
	i = ClimateData_1.size();
	int index = 0;

	m_comboClimate.InsertString(0,"Select weather..");

	index = 1;
	for(i= 0; i<ClimateData_1.size();i++)
	{
		m_comboClimate.InsertString(index,ClimateData_1[i].locationName);
		index++;
	}

	//---------------------------------------------
	//	HOUSE TYPE
	//---------------------------------------------
	m_listHouseType.InsertString(0,"Detached");
	m_listHouseType.InsertString(1,"Semi-detached");
	m_listHouseType.InsertString(2,"Terraced");
	m_listHouseType.InsertString(3,"Tenement");
	m_listHouseType.InsertString(4,"4-in-block");
	m_listHouseType.InsertString(5,"Tower/Slab");
	m_listHouseType.InsertString(6,"Conversion");

	//---------------------------------------------
	//	YEAR OF BUILT
	//---------------------------------------------
	m_listYearOfBuild.InsertString(0,"pre 1919");
	m_listYearOfBuild.InsertString(1,"1919-44");
	m_listYearOfBuild.InsertString(2,"1945-64");
	m_listYearOfBuild.InsertString(3,"1965-82");
	m_listYearOfBuild.InsertString(4,"post 1982");
	m_listYearOfBuild.InsertString(5,"post 2002");
	m_listYearOfBuild.InsertString(6,"post 2006");
	m_listYearOfBuild.InsertString(7,"post 2010");

	//---------------------------------------------
	//	ENERGY DEMAND DETERMINANTS
	//---------------------------------------------
	m_sliderInsulation.SetRange(1, 5);
	m_sliderInsulation.SetTicFreq(1);

	m_sliderAirtightness.SetRange(1, 5);
	m_sliderAirtightness.SetTicFreq(1);

	m_sliderCapacity.SetRange(1, 2);
	m_sliderCapacity.SetTicFreq(1);

	m_sliderSolarIngress.SetRange(1, 3);
	m_sliderSolarIngress.SetTicFreq(1);

	m_sliderOccupancy.SetRange(1, 5);
	m_sliderOccupancy.SetTicFreq(1);

	m_sliderControllesSpace.SetRange(1, 5);
	m_sliderControllesSpace.SetTicFreq(1);

	m_sliderHeff.SetRange(1, 3);
	m_sliderHeff.SetTicFreq(1);

	m_sliderDHWeff.SetRange(1, 3);
	m_sliderDHWeff.SetTicFreq(1);
	//---------------------------------------------
	//	ENERGY SUPPLY DETERMINANTS
	//---------------------------------------------
	int nIndex = 0;
	m_comboFuel.ResetContent();
	for(i = 0; i < SAPcostTable_New.size(); i++)
	{
		if ((nIndex=m_comboFuel.FindStringExact(nIndex, SAPcostTable_New[i].fuelType)) != CB_ERR)
		{
			; // Do nothing
		}
		else
		{
			// Fill fuel drop down menu
			m_comboFuel.AddString(SAPcostTable_New[i].fuelType);
		}
	}

	int numberOfEntriesInCombo = 0;
	m_comboDHWfuel.ResetContent();
	for(i = 0; i < SAPcostTable_New.size(); i++)
	{
		if ((nIndex=m_comboDHWfuel.FindStringExact(nIndex, SAPcostTable_New[i].fuelType)) != CB_ERR)
		{
			; // Do nothing
		}
		else
		{
			// Fill fuel drop down menu
			m_comboDHWfuel.AddString(SAPcostTable_New[i].fuelType);
			numberOfEntriesInCombo++;
		}
	}

	//-------------------------------------------------------
	// Add the option of "From main" to DHW fuel
	//-------------------------------------------------------
	m_comboDHWfuel.InsertString(numberOfEntriesInCombo,"From main");

	//-------------------------------------------------------
	// Cooling Fuel
	//-------------------------------------------------------
	m_comboCoolingFuel.InsertString(0,"Electricity");
	m_comboCoolingFuel.SelectString(0,"Electricity");

	if(file_new_selected ==true)
	{
		iStat = 0;
		dwellingVoulme = 0;
		SFP   = 0;
		auxillaryElectricity   = 0;
		
		numOfOccupants= 0;
		TFA= 0;
		EB= 0;
		C1= 0;
		ZL= 0;
		gL= 0;
		GL_total= 0;
		C2= 0;
		lightElectricity = 0;

		Vd_avg= 0;
		DHW_energy= 0;
		distributionLoss= 0;
		tempFactor= 0;
		storageLoss= 0;
		lossFactor= 0;
		tankVolume= 0;
		volumeFacor= 0;
		heatLossFactor= 0;
		srorageLoss;
		primaryCircuitLoss= 0;
		F_u= 0;
		combiLoss= 0;
		solarDHWInput= 0;
		btnWaterHtFromMainState = 1;

		domesticHotWaterSupply = 0;
		
		hemX_exposure = " ";
		hemI_insulation = " ";
		hemI_insulation1 = " ";
		hemI_insulation2 = " ";
		hemA_ach = " ";
		hemC_capacity = " ";
		hemS_solarGains = " ";
		hemO_occupantDensity = " ";
		hemL_livingAreaFraction = " ";

		hemI_insulationSliderPos = 0;
		hemA_achSliderPos = 0;
		hemC_capacitySliderPos = 0;
		hemS_solarGainsSliderPos = 0;
		hemO_OCCDensitySliderPos = 0;
		hemL_LAFracSliderPos = 0;

		chkInsulation = 0;
		chkAirtightness= 0;
		chkCapacity= 0;
		chkSolarIngress= 0;
		chkOccupancy= 0;
		chkControlledSpace= 0;
	
		chkSDHW  = 0;
		chkPV= 0;
		chkWT= 0;
		chkuCHP= 0;
		chkuHydro= 0;
		chkPCM= 0;
		chkMVHR= 0;

		hemHouseType = "";
		hemYearOfBuild = "";	

		is_base_selected = false;
		is_imp1_selected = false;
		is_imp2_selected = false;
		is_imp3_selected = false;
		is_imp4_selected = false;
		is_imp5_selected = false;

		baseSelected = 0;
		imp1Selected = 0;
		imp2Selected = 0;
		imp3Selected = 0;
		imp4Selected = 0;
		imp5Selected = 0;

		locationString;
	}
	
	m_ToolTipSDHW= new CToolTipCtrl();
	m_ToolTipSDHW->Create(this);
	m_ToolTipSDHW->AddTool(&m_labelSDHW,"Solar Domestic Hot Water");
	m_ToolTipSDHW->Activate(TRUE);

	m_ToolTipPV= new CToolTipCtrl();
	m_ToolTipPV->Create(this);
	m_ToolTipPV->AddTool(&m_labelPV,"Photovoltaic");
	m_ToolTipPV->Activate(TRUE);

	m_ToolTipuCHP= new CToolTipCtrl();
	m_ToolTipuCHP->Create(this);
	m_ToolTipuCHP->AddTool(&m_labeluCHP,"Micro Combined Heat and Power");
	m_ToolTipuCHP->Activate(TRUE);

	m_ToolTipPCM= new CToolTipCtrl();
	m_ToolTipPCM->Create(this);
	m_ToolTipPCM->AddTool(&m_labelPCM,"Phase Change Material");
	m_ToolTipPCM->Activate(TRUE);

	m_ToolTipMVHR= new CToolTipCtrl();
	m_ToolTipMVHR->Create(this);
	m_ToolTipMVHR->AddTool(&m_labelMVHR,"Mechanical Ventilation with Heat Recovery");
	m_ToolTipMVHR->Activate(TRUE);

	m_ToolTipFGHRS= new CToolTipCtrl();
	m_ToolTipFGHRS->Create(this);
	m_ToolTipFGHRS->AddTool(&m_lableFGHRS,"Flue Gas Heat Recovery System");
	m_ToolTipFGHRS->Activate(TRUE);

	m_ToolTipWWHRS= new CToolTipCtrl();
	m_ToolTipWWHRS->Create(this);
	m_ToolTipWWHRS->AddTool(&m_lableWWHRS,"Waste Water Heat Recovery System");
	m_ToolTipWWHRS->Activate(TRUE);
	
	double tempChkNum = 0;
	if(is_file_opened == true)
	{
		CopyVariablesToCurrentClass();

		//------------------------------------------------------------------
		// Perform calculations based on all cases as defined by user in 
		// project file
		//------------------------------------------------------------------
		if( baseSelected == 1) 
		{
			is_base_selected = true;
			display_base_results = true;
			CopyBaseToCurrent();	
			ReadPreviousInputsForResultsDialog();
			OnLbnSelchangeList2();
			OnLbnSelchangeList3();
			ChangeIndexNumberBasedOnHouseTypeAndAgeForResultsDialog();	
			DisplayHouseTypeOnResultsDlgBasedOnBuiltForm();
			CalculateResultsForSAPP(); 
			CopyCurrentToBase();
			EnableOrDisableControls();
		}
	
		if(imp1Selected == 1)
		{
			is_imp1_selected = true;
			display_imp1_results = true;
			CopyImprovement1ToCurrent();
			ReadPreviousInputsForResultsDialog();
			//ChangeIndexNumberBasedOnHouseTypeAndAgeForResultsDialog();	
			//DisplayHouseTypeOnResultsDlgBasedOnBuiltForm();
			CalculateResultsForSAPP();
			CopyCurrentToImprovement1();
			EnableOrDisableControls();			
		}

		if(imp2Selected == 1)
		{
			is_imp2_selected = true;
			display_imp2_results = true;
			CopyImprovement2ToCurrent();
			ReadPreviousInputsForResultsDialog();
			//ChangeIndexNumberBasedOnHouseTypeAndAgeForResultsDialog();
			//DisplayHouseTypeOnResultsDlgBasedOnBuiltForm();
			CalculateResultsForSAPP(); 
			CopyCurrentToImprovement2();
			EnableOrDisableControls();
		}

		if(imp3Selected == 1)
		{
			is_imp3_selected = true;
			display_imp3_results = true;
			CopyImprovement3ToCurrent();
			ReadPreviousInputsForResultsDialog();
			//ChangeIndexNumberBasedOnHouseTypeAndAgeForResultsDialog();	
			//DisplayHouseTypeOnResultsDlgBasedOnBuiltForm();
			CalculateResultsForSAPP(); 
			CopyCurrentToImprovement3();
			EnableOrDisableControls();
		}

		if(imp4Selected == 1)
		{
			is_imp4_selected = true;
			display_imp4_results = true;
			CopyImprovement4ToCurrent();
			ReadPreviousInputsForResultsDialog();
			//ChangeIndexNumberBasedOnHouseTypeAndAgeForResultsDialog();	
			//DisplayHouseTypeOnResultsDlgBasedOnBuiltForm();
			CalculateResultsForSAPP(); 
			CopyCurrentToImprovement4();
			EnableOrDisableControls();
		}

		if(imp5Selected == 1)
		{
			is_imp5_selected = true;
			display_imp5_results = true;
			CopyImprovement5ToCurrent();
			ReadPreviousInputsForResultsDialog();
			//ChangeIndexNumberBasedOnHouseTypeAndAgeForResultsDialog();	
			//DisplayHouseTypeOnResultsDlgBasedOnBuiltForm();
			CalculateResultsForSAPP(); 
			CopyCurrentToImprovement5();
			EnableOrDisableControls();
		}	

		CopyCurrentFromFileToCurrent();
		ReadPreviousInputsForResultsDialog();	
		//ChangeIndexNumberBasedOnHouseTypeAndAgeForResultsDialog();	
		//DisplayHouseTypeOnResultsDlgBasedOnBuiltForm();
		ReadInputsFromResultsDialog();
		CalculateResultsForSAPP();
		EnableOrDisableControls();

		is_file_opened = false;

		//ReadPreviousInputsForResultsDialog();
		//EnableOrDisableControls();
		//CalculateResultsForSAPP();		
	}	
	else
	{
		ReadPreviousInputsForResultsDialog();
		if((file_new_selected ==true) || (hemHouseType== ""))
		{
			m_comboClimate.SelectString(0,"Select weather..");
		}

		DisplayHouseTypeOnResultsDlgBasedOnBuiltForm();
		EnableOrDisableControls();
		CalculateResultsForSAPP(); // 1st
	}	

	//// Display results based on values selected by user
	ModifyResultsBasedOnEnergyCostOrEmissions();

	if(is_base_selected == true)
	{
		DisplayBaseResultsForEnergyCostOrEmissions();
	}
	if(is_imp1_selected == true)
	{
		DisplayImp1ResultsForEnergyCostOrEmissions();
	}

	if(is_imp2_selected == true)
	{
		DisplayImp2ResultsForEnergyCostOrEmissions();
	}

	if(is_imp3_selected == true)
	{
		DisplayImp3ResultsForEnergyCostOrEmissions();
	}

	if(is_imp4_selected == true)
	{
		DisplayImp4ResultsForEnergyCostOrEmissions();
	}

	if(is_imp5_selected == true)
	{
		DisplayImp5ResultsForEnergyCostOrEmissions();
	}	
	
	return TRUE;
}

BOOL CDlg_Results::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(pMsg->message==WM_KEYDOWN)
	{
		if(pMsg->wParam==VK_RETURN || pMsg->wParam==VK_ESCAPE)
			pMsg->wParam=NULL ;
	} 

	if(m_ToolTipSDHW != NULL)
       m_ToolTipSDHW->RelayEvent(pMsg);

	if(m_ToolTipPV != NULL)
       m_ToolTipPV->RelayEvent(pMsg);

	if(m_ToolTipuCHP != NULL)
       m_ToolTipuCHP->RelayEvent(pMsg);

	if(m_ToolTipPCM != NULL)
       m_ToolTipPCM->RelayEvent(pMsg);

	if(m_ToolTipMVHR != NULL)
       m_ToolTipMVHR->RelayEvent(pMsg);

	if(m_ToolTipFGHRS != NULL)
       m_ToolTipFGHRS->RelayEvent(pMsg);

	if(m_ToolTipWWHRS != NULL)
       m_ToolTipWWHRS->RelayEvent(pMsg);

	return CDialog::PreTranslateMessage(pMsg);
}

void SaveAllResultsFromProject()
{
	EstateData tempEntryCase;

	// Enter data into base, imp1...imp5 vectors regardless of 
	// which case is selected by the user
	// BASE
	tempEntryCase.caseOfDwellings         = caseOfDwellings;
	tempEntryCase.numOfDwellings          = numOfDwellings;
	tempEntryCase.projectFileName         = projectFileName;
	tempEntryCase.projectFileNameNoPath   = projectFileNameNoPath;
	tempEntryCase.projectFileNameNoExt    = projectFileNameNoExt;

	tempEntryCase.TFA = base.TFA;
	tempEntryCase.totalSpaceHtSupply	  = base.totalSpaceHtSupply;
	tempEntryCase.totalSpaceCoolingSupply = base.totalSpaceCoolingSupply;
	tempEntryCase.domesticHotWaterSupply  = base.domesticHotWaterSupply;
	tempEntryCase.lightElectricity		  = base.lightElectricity;
	tempEntryCase.auxillaryElectricity    = base.auxillaryElectricity;
	tempEntryCase.totalElectricalSupply   = base.totalElectricalSupply;
	tempEntryCase.mainSpaceHtSupply       = base.mainSpaceHtSupply;
	tempEntryCase.secSpaceHtSupply        = base.secSpaceHtSupply;
	tempEntryCase.LZCT_elecSold           = base.LZCT_elecSold;
	tempEntryCase.LZCT_elecDisplaced      = base.LZCT_elecDisplaced;
	tempEntryCase.primaryFuelUsed         = base.primaryFuelUsed;
	tempEntryCase.secFuelUsed			  = base.secFuelUsed;

	tempEntryCase.mainSpaceHtSupply_Emm       = base.mainSpaceHtSupply_Emm ;
	tempEntryCase.secSpaceHtSupply_Emm		  = base.secSpaceHtSupply_Emm;
	tempEntryCase.totalSpaceCoolingSupply_Emm = base.totalSpaceCoolingSupply_Emm;
	tempEntryCase.domesticHotWaterSupply_Emm  = base.domesticHotWaterSupply_Emm;
	tempEntryCase.lightElectricity_Emm        = base.lightElectricity_Emm;
	tempEntryCase.auxillaryElectricity_Emm    = base.auxillaryElectricity_Emm;
	tempEntryCase.LZCTelecSold_Emm            = base.LZCTelecSold_Emm;
	tempEntryCase.LZCTelecDisp_Emm            = base.LZCTelecDisp_Emm;
	tempEntryCase.primaryFuelUsed_Emm         = base.primaryFuelUsed_Emm; 
	tempEntryCase.secFuelUsed_Emm 			  = base.secFuelUsed_Emm;

	tempEntryCase.mainSpaceHtSupply_fuelCost       = base.mainSpaceHtSupply_fuelCost;
	tempEntryCase.secSpaceHtSupply_fuelCost        = base.secSpaceHtSupply_fuelCost;
	tempEntryCase.totalSpaceCoolingSupply_fuelCost = base.totalSpaceCoolingSupply_fuelCost;
	tempEntryCase.domesticHotWaterSupply_fuelCost  = base.domesticHotWaterSupply_fuelCost;
	tempEntryCase.lightElectricity_fuelCost        = base.lightElectricity_fuelCost;
	tempEntryCase.auxillaryElectricity_fuelCost    = base.auxillaryElectricity_fuelCost;
	tempEntryCase.LZCTelecSold_fuelCost            = base.LZCTelecSold_fuelCost;
	tempEntryCase.LZCTelecDisp_fuelCost            = base.LZCTelecDisp_fuelCost;
	tempEntryCase.primaryFuelUsed_fuelCost         = base.primaryFuelUsed_fuelCost;
	tempEntryCase.secFuelUsed_fuelCost			   = base.secFuelUsed_fuelCost;

	EstateDataValuesBase.push_back(tempEntryCase);

	// IMPROVEMENT 1
	tempEntryCase.caseOfDwellings         = caseOfDwellings;
	tempEntryCase.numOfDwellings          = numOfDwellings;
	tempEntryCase.projectFileName         = projectFileName;
	tempEntryCase.projectFileNameNoPath   = projectFileNameNoPath;
	tempEntryCase.projectFileNameNoExt    = projectFileNameNoExt;

	tempEntryCase.TFA = imp1.TFA;
	tempEntryCase.totalSpaceHtSupply	  = imp1.totalSpaceHtSupply;
	tempEntryCase.totalSpaceCoolingSupply = imp1.totalSpaceCoolingSupply;
	tempEntryCase.domesticHotWaterSupply  = imp1.domesticHotWaterSupply;
	tempEntryCase.lightElectricity		  = imp1.lightElectricity;
	tempEntryCase.auxillaryElectricity    = imp1.auxillaryElectricity;
	tempEntryCase.totalElectricalSupply   = imp1.totalElectricalSupply;
	tempEntryCase.mainSpaceHtSupply       = imp1.mainSpaceHtSupply;
	tempEntryCase.secSpaceHtSupply        = imp1.secSpaceHtSupply;
	tempEntryCase.LZCT_elecSold           = imp1.LZCT_elecSold;
	tempEntryCase.LZCT_elecDisplaced      = imp1.LZCT_elecDisplaced;
	tempEntryCase.primaryFuelUsed         = imp1.primaryFuelUsed;
	tempEntryCase.secFuelUsed 	          = imp1.secFuelUsed;

	tempEntryCase.mainSpaceHtSupply_Emm       = imp1.mainSpaceHtSupply_Emm ;
	tempEntryCase.secSpaceHtSupply_Emm		  = imp1.secSpaceHtSupply_Emm;
	tempEntryCase.totalSpaceCoolingSupply_Emm = imp1.totalSpaceCoolingSupply_Emm;
	tempEntryCase.domesticHotWaterSupply_Emm  = imp1.domesticHotWaterSupply_Emm;
	tempEntryCase.lightElectricity_Emm        = imp1.lightElectricity_Emm;
	tempEntryCase.auxillaryElectricity_Emm    = imp1.auxillaryElectricity_Emm;
	tempEntryCase.LZCTelecSold_Emm            = imp1.LZCTelecSold_Emm;
	tempEntryCase.LZCTelecDisp_Emm            = imp1.LZCTelecDisp_Emm;
	tempEntryCase.primaryFuelUsed_Emm         = imp1.primaryFuelUsed_fuelCost;
	tempEntryCase.secFuelUsed_Emm 	          = imp1.secFuelUsed_fuelCost;

	tempEntryCase.mainSpaceHtSupply_fuelCost       = imp1.mainSpaceHtSupply_fuelCost;
	tempEntryCase.secSpaceHtSupply_fuelCost        = imp1.secSpaceHtSupply_fuelCost;
	tempEntryCase.totalSpaceCoolingSupply_fuelCost = imp1.totalSpaceCoolingSupply_fuelCost;
	tempEntryCase.domesticHotWaterSupply_fuelCost  = imp1.domesticHotWaterSupply_fuelCost;
	tempEntryCase.lightElectricity_fuelCost        = imp1.lightElectricity_fuelCost;
	tempEntryCase.auxillaryElectricity_fuelCost    = imp1.auxillaryElectricity_fuelCost;
	tempEntryCase.LZCTelecSold_fuelCost            = imp1.LZCTelecSold_fuelCost;
	tempEntryCase.LZCTelecDisp_fuelCost            = imp1.LZCTelecDisp_fuelCost;
	tempEntryCase.primaryFuelUsed_fuelCost         = imp1.primaryFuelUsed_fuelCost;
	tempEntryCase.secFuelUsed_fuelCost 	           = imp1.secFuelUsed_fuelCost;

	EstateDataValuesImp1.push_back(tempEntryCase);

	// IMPROVEMENT2
	tempEntryCase.caseOfDwellings         = caseOfDwellings;
	tempEntryCase.numOfDwellings          = numOfDwellings;
	tempEntryCase.projectFileName         = projectFileName;
	tempEntryCase.projectFileNameNoPath   = projectFileNameNoPath;
	tempEntryCase.projectFileNameNoExt    = projectFileNameNoExt;

	tempEntryCase.TFA = imp2.TFA;
	tempEntryCase.totalSpaceHtSupply	  = imp2.totalSpaceHtSupply;
	tempEntryCase.totalSpaceCoolingSupply = imp2.totalSpaceCoolingSupply;
	tempEntryCase.domesticHotWaterSupply  = imp2.domesticHotWaterSupply;
	tempEntryCase.lightElectricity		  = imp2.lightElectricity;
	tempEntryCase.auxillaryElectricity    = imp2.auxillaryElectricity;
	tempEntryCase.totalElectricalSupply   = imp2.totalElectricalSupply;
	tempEntryCase.mainSpaceHtSupply       = imp2.mainSpaceHtSupply;
	tempEntryCase.secSpaceHtSupply        = imp2.secSpaceHtSupply;
	tempEntryCase.LZCT_elecSold           = imp2.LZCT_elecSold;
	tempEntryCase.LZCT_elecDisplaced      = imp2.LZCT_elecDisplaced;
	tempEntryCase.primaryFuelUsed         = imp2.primaryFuelUsed;
	tempEntryCase.secFuelUsed 	          = imp2.secFuelUsed;

	tempEntryCase.mainSpaceHtSupply_Emm       = imp2.mainSpaceHtSupply_Emm ;
	tempEntryCase.secSpaceHtSupply_Emm		  = imp2.secSpaceHtSupply_Emm;
	tempEntryCase.totalSpaceCoolingSupply_Emm = imp2.totalSpaceCoolingSupply_Emm;
	tempEntryCase.domesticHotWaterSupply_Emm  = imp2.domesticHotWaterSupply_Emm;
	tempEntryCase.lightElectricity_Emm        = imp2.lightElectricity_Emm;
	tempEntryCase.auxillaryElectricity_Emm    = imp2.auxillaryElectricity_Emm;
	tempEntryCase.LZCTelecSold_Emm            = imp2.LZCTelecSold_Emm;
	tempEntryCase.LZCTelecDisp_Emm            = imp2.LZCTelecDisp_Emm;
	tempEntryCase.primaryFuelUsed_Emm         = imp2.primaryFuelUsed_Emm;
	tempEntryCase.secFuelUsed_Emm 	          = imp2.secFuelUsed_Emm;

	tempEntryCase.mainSpaceHtSupply_fuelCost       = imp2.mainSpaceHtSupply_fuelCost;
	tempEntryCase.secSpaceHtSupply_fuelCost        = imp2.secSpaceHtSupply_fuelCost;
	tempEntryCase.totalSpaceCoolingSupply_fuelCost = imp2.totalSpaceCoolingSupply_fuelCost;
	tempEntryCase.domesticHotWaterSupply_fuelCost  = imp2.domesticHotWaterSupply_fuelCost;
	tempEntryCase.lightElectricity_fuelCost        = imp2.lightElectricity_fuelCost;
	tempEntryCase.auxillaryElectricity_fuelCost    = imp2.auxillaryElectricity_fuelCost;
	tempEntryCase.LZCTelecSold_fuelCost            = imp2.LZCTelecSold_fuelCost;
	tempEntryCase.LZCTelecDisp_fuelCost            = imp2.LZCTelecDisp_fuelCost;
	tempEntryCase.primaryFuelUsed_fuelCost         = imp2.primaryFuelUsed_fuelCost;
	tempEntryCase.secFuelUsed_fuelCost 	           = imp2.secFuelUsed_fuelCost;

	EstateDataValuesImp2.push_back(tempEntryCase);

	// IMPROVEMENT 3
	tempEntryCase.caseOfDwellings         = caseOfDwellings;
	tempEntryCase.numOfDwellings          = numOfDwellings;
	tempEntryCase.projectFileName         = projectFileName;
	tempEntryCase.projectFileNameNoPath   = projectFileNameNoPath;
	tempEntryCase.projectFileNameNoExt    = projectFileNameNoExt;

	tempEntryCase.TFA = imp3.TFA;
	tempEntryCase.totalSpaceHtSupply	  = imp3.totalSpaceHtSupply;
	tempEntryCase.totalSpaceCoolingSupply = imp3.totalSpaceCoolingSupply;
	tempEntryCase.domesticHotWaterSupply  = imp3.domesticHotWaterSupply;
	tempEntryCase.lightElectricity		  = imp3.lightElectricity;
	tempEntryCase.auxillaryElectricity    = imp3.auxillaryElectricity;
	tempEntryCase.totalElectricalSupply   = imp3.totalElectricalSupply;
	tempEntryCase.mainSpaceHtSupply       = imp3.mainSpaceHtSupply;
	tempEntryCase.secSpaceHtSupply        = imp3.secSpaceHtSupply;
	tempEntryCase.LZCT_elecSold           = imp3.LZCT_elecSold;
	tempEntryCase.LZCT_elecDisplaced      = imp3.LZCT_elecDisplaced;
	tempEntryCase.primaryFuelUsed         = imp3.primaryFuelUsed;
	tempEntryCase.secFuelUsed 	          = imp3.secFuelUsed;

	tempEntryCase.mainSpaceHtSupply_Emm       = imp3.mainSpaceHtSupply_Emm ;
	tempEntryCase.secSpaceHtSupply_Emm		  = imp3.secSpaceHtSupply_Emm;
	tempEntryCase.totalSpaceCoolingSupply_Emm = imp3.totalSpaceCoolingSupply_Emm;
	tempEntryCase.domesticHotWaterSupply_Emm  = imp3.domesticHotWaterSupply_Emm;
	tempEntryCase.lightElectricity_Emm        = imp3.lightElectricity_Emm;
	tempEntryCase.auxillaryElectricity_Emm    = imp3.auxillaryElectricity_Emm;
	tempEntryCase.LZCTelecSold_Emm            = imp3.LZCTelecSold_Emm;
	tempEntryCase.LZCTelecDisp_Emm            = imp3.LZCTelecDisp_Emm;
	tempEntryCase.primaryFuelUsed_Emm         = imp3.primaryFuelUsed_Emm;
	tempEntryCase.secFuelUsed_Emm 	          = imp3.secFuelUsed_Emm;

	tempEntryCase.mainSpaceHtSupply_fuelCost       = imp3.mainSpaceHtSupply_fuelCost;
	tempEntryCase.secSpaceHtSupply_fuelCost        = imp3.secSpaceHtSupply_fuelCost;
	tempEntryCase.totalSpaceCoolingSupply_fuelCost = imp3.totalSpaceCoolingSupply_fuelCost;
	tempEntryCase.domesticHotWaterSupply_fuelCost  = imp3.domesticHotWaterSupply_fuelCost;
	tempEntryCase.lightElectricity_fuelCost        = imp3.lightElectricity_fuelCost;
	tempEntryCase.auxillaryElectricity_fuelCost    = imp3.auxillaryElectricity_fuelCost;
	tempEntryCase.LZCTelecSold_fuelCost            = imp3.LZCTelecSold_fuelCost;
	tempEntryCase.LZCTelecDisp_fuelCost            = imp3.LZCTelecDisp_fuelCost;
	tempEntryCase.primaryFuelUsed_fuelCost         = imp3.primaryFuelUsed_fuelCost;
	tempEntryCase.secFuelUsed_fuelCost 	           = imp3.secFuelUsed_fuelCost;

	EstateDataValuesImp3.push_back(tempEntryCase);

	// IMPROVEMENT 4
	tempEntryCase.caseOfDwellings         = caseOfDwellings;
	tempEntryCase.numOfDwellings          = numOfDwellings;
	tempEntryCase.projectFileName         = projectFileName;
	tempEntryCase.projectFileNameNoPath   = projectFileNameNoPath;
	tempEntryCase.projectFileNameNoExt    = projectFileNameNoExt;

	tempEntryCase.TFA = imp4.TFA;
	tempEntryCase.totalSpaceHtSupply	  = imp4.totalSpaceHtSupply;
	tempEntryCase.totalSpaceCoolingSupply = imp4.totalSpaceCoolingSupply;
	tempEntryCase.domesticHotWaterSupply  = imp4.domesticHotWaterSupply;
	tempEntryCase.lightElectricity		  = imp4.lightElectricity;
	tempEntryCase.auxillaryElectricity    = imp4.auxillaryElectricity;
	tempEntryCase.totalElectricalSupply   = imp4.totalElectricalSupply;
	tempEntryCase.mainSpaceHtSupply       = imp4.mainSpaceHtSupply;
	tempEntryCase.secSpaceHtSupply        = imp4.secSpaceHtSupply;
	tempEntryCase.LZCT_elecSold           = imp4.LZCT_elecSold;
	tempEntryCase.LZCT_elecDisplaced      = imp4.LZCT_elecDisplaced;
	tempEntryCase.primaryFuelUsed         = imp4.primaryFuelUsed;
	tempEntryCase.secFuelUsed 	          = imp4.secFuelUsed;

	tempEntryCase.mainSpaceHtSupply_Emm       = imp4.mainSpaceHtSupply_Emm ;
	tempEntryCase.secSpaceHtSupply_Emm		  = imp4.secSpaceHtSupply_Emm;
	tempEntryCase.totalSpaceCoolingSupply_Emm = imp4.totalSpaceCoolingSupply_Emm;
	tempEntryCase.domesticHotWaterSupply_Emm  = imp4.domesticHotWaterSupply_Emm;
	tempEntryCase.lightElectricity_Emm        = imp4.lightElectricity_Emm;
	tempEntryCase.auxillaryElectricity_Emm    = imp4.auxillaryElectricity_Emm;
	tempEntryCase.LZCTelecSold_Emm            = imp4.LZCTelecSold_Emm;
	tempEntryCase.LZCTelecDisp_Emm            = imp4.LZCTelecDisp_Emm;
	tempEntryCase.primaryFuelUsed_Emm         = imp4.primaryFuelUsed_Emm;
	tempEntryCase.secFuelUsed_Emm 	          = imp4.secFuelUsed_Emm;

	tempEntryCase.mainSpaceHtSupply_fuelCost       = imp4.mainSpaceHtSupply_fuelCost;
	tempEntryCase.secSpaceHtSupply_fuelCost        = imp4.secSpaceHtSupply_fuelCost;
	tempEntryCase.totalSpaceCoolingSupply_fuelCost = imp4.totalSpaceCoolingSupply_fuelCost;
	tempEntryCase.domesticHotWaterSupply_fuelCost  = imp4.domesticHotWaterSupply_fuelCost;
	tempEntryCase.lightElectricity_fuelCost        = imp4.lightElectricity_fuelCost;
	tempEntryCase.auxillaryElectricity_fuelCost    = imp4.auxillaryElectricity_fuelCost;
	tempEntryCase.LZCTelecSold_fuelCost            = imp4.LZCTelecSold_fuelCost;
	tempEntryCase.LZCTelecDisp_fuelCost            = imp4.LZCTelecDisp_fuelCost;
	tempEntryCase.primaryFuelUsed_fuelCost         = imp4.primaryFuelUsed_fuelCost;
	tempEntryCase.secFuelUsed_fuelCost 	           = imp4.secFuelUsed_fuelCost;

	EstateDataValuesImp4.push_back(tempEntryCase);

	// IMPROVEMENT5
	tempEntryCase.caseOfDwellings         = caseOfDwellings;
	tempEntryCase.numOfDwellings          = numOfDwellings;
	tempEntryCase.projectFileName         = projectFileName;
	tempEntryCase.projectFileNameNoPath   = projectFileNameNoPath;
	tempEntryCase.projectFileNameNoExt    = projectFileNameNoExt;

	tempEntryCase.TFA = imp5.TFA;
	tempEntryCase.totalSpaceHtSupply	  = imp5.totalSpaceHtSupply;
	tempEntryCase.totalSpaceCoolingSupply = imp5.totalSpaceCoolingSupply;
	tempEntryCase.domesticHotWaterSupply  = imp5.domesticHotWaterSupply;
	tempEntryCase.lightElectricity		  = imp5.lightElectricity;
	tempEntryCase.auxillaryElectricity    = imp5.auxillaryElectricity;
	tempEntryCase.totalElectricalSupply   = imp5.totalElectricalSupply;
	tempEntryCase.mainSpaceHtSupply       = imp5.mainSpaceHtSupply;
	tempEntryCase.secSpaceHtSupply        = imp5.secSpaceHtSupply;
	tempEntryCase.LZCT_elecSold           = imp5.LZCT_elecSold;
	tempEntryCase.LZCT_elecDisplaced      = imp5.LZCT_elecDisplaced;
	tempEntryCase.primaryFuelUsed         = imp5.primaryFuelUsed;
	tempEntryCase.secFuelUsed 	          = imp5.secFuelUsed;

	tempEntryCase.mainSpaceHtSupply_Emm       = imp5.mainSpaceHtSupply_Emm ;
	tempEntryCase.secSpaceHtSupply_Emm		  = imp5.secSpaceHtSupply_Emm;
	tempEntryCase.totalSpaceCoolingSupply_Emm = imp5.totalSpaceCoolingSupply_Emm;
	tempEntryCase.domesticHotWaterSupply_Emm  = imp5.domesticHotWaterSupply_Emm;
	tempEntryCase.lightElectricity_Emm        = imp5.lightElectricity_Emm;
	tempEntryCase.auxillaryElectricity_Emm    = imp5.auxillaryElectricity_Emm;
	tempEntryCase.LZCTelecSold_Emm            = imp5.LZCTelecSold_Emm;
	tempEntryCase.LZCTelecDisp_Emm            = imp5.LZCTelecDisp_Emm;
	tempEntryCase.primaryFuelUsed_Emm         = imp5.primaryFuelUsed_Emm;
	tempEntryCase.secFuelUsed_Emm 	          = imp5.secFuelUsed_Emm;

	tempEntryCase.mainSpaceHtSupply_fuelCost       = imp5.mainSpaceHtSupply_fuelCost;
	tempEntryCase.secSpaceHtSupply_fuelCost        = imp5.secSpaceHtSupply_fuelCost;
	tempEntryCase.totalSpaceCoolingSupply_fuelCost = imp5.totalSpaceCoolingSupply_fuelCost;
	tempEntryCase.domesticHotWaterSupply_fuelCost  = imp5.domesticHotWaterSupply_fuelCost;
	tempEntryCase.lightElectricity_fuelCost        = imp5.lightElectricity_fuelCost;
	tempEntryCase.auxillaryElectricity_fuelCost    = imp5.auxillaryElectricity_fuelCost;
	tempEntryCase.LZCTelecSold_fuelCost            = imp5.LZCTelecSold_fuelCost;
	tempEntryCase.LZCTelecDisp_fuelCost            = imp5.LZCTelecDisp_fuelCost;
	tempEntryCase.primaryFuelUsed_fuelCost         = imp5.primaryFuelUsed_fuelCost;
	tempEntryCase.secFuelUsed_fuelCost 	           = imp5.secFuelUsed_fuelCost;

	EstateDataValuesImp5.push_back(tempEntryCase);

}

void CSAPP1Dlg::AddPropertyToEstate()
{
	EstateData tempEntry;

	if(caseOfDwellings == "Base")
	{
		tempEntry.caseOfDwellings         = caseOfDwellings;
		tempEntry.numOfDwellings          = numOfDwellings;
		tempEntry.projectFileName         = projectFileName;
		tempEntry.projectFileNameNoPath   = projectFileNameNoPath;
		tempEntry.projectFileNameNoExt    = projectFileNameNoExt;

		tempEntry.TFA = base.TFA;
		tempEntry.totalSpaceHtSupply	  = base.totalSpaceHtSupply;
		tempEntry.totalSpaceCoolingSupply = base.totalSpaceCoolingSupply;
		tempEntry.domesticHotWaterSupply  = base.domesticHotWaterSupply;
		tempEntry.lightElectricity		  = base.lightElectricity;
		tempEntry.auxillaryElectricity    = base.auxillaryElectricity;
		tempEntry.totalElectricalSupply   = base.totalElectricalSupply;
		tempEntry.mainSpaceHtSupply       = base.mainSpaceHtSupply;
		tempEntry.secSpaceHtSupply        = base.secSpaceHtSupply;
		tempEntry.LZCT_elecSold           = base.LZCT_elecSold;
		tempEntry.LZCT_elecDisplaced      = base.LZCT_elecDisplaced;
		tempEntry.primaryFuelUsed         = base.primaryFuelUsed;
		tempEntry.secFuelUsed			  = base.secFuelUsed;


		tempEntry.mainSpaceHtSupply_Emm       = base.mainSpaceHtSupply_Emm ;
		tempEntry.secSpaceHtSupply_Emm		  = base.secSpaceHtSupply_Emm;
		tempEntry.totalSpaceCoolingSupply_Emm = base.totalSpaceCoolingSupply_Emm;
		tempEntry.domesticHotWaterSupply_Emm  = base.domesticHotWaterSupply_Emm;
		tempEntry.lightElectricity_Emm        = base.lightElectricity_Emm;
		tempEntry.auxillaryElectricity_Emm    = base.auxillaryElectricity_Emm;
		tempEntry.LZCTelecSold_Emm            = base.LZCTelecSold_Emm;
		tempEntry.LZCTelecDisp_Emm            = base.LZCTelecDisp_Emm;
		tempEntry.primaryFuelUsed_Emm         = base.primaryFuelUsed_Emm; 
		tempEntry.secFuelUsed_Emm 			  = base.secFuelUsed_Emm;

		tempEntry.mainSpaceHtSupply_fuelCost       = base.mainSpaceHtSupply_fuelCost;
		tempEntry.secSpaceHtSupply_fuelCost        = base.secSpaceHtSupply_fuelCost;
		tempEntry.totalSpaceCoolingSupply_fuelCost = base.totalSpaceCoolingSupply_fuelCost;
		tempEntry.domesticHotWaterSupply_fuelCost  = base.domesticHotWaterSupply_fuelCost;
		tempEntry.lightElectricity_fuelCost        = base.lightElectricity_fuelCost;
		tempEntry.auxillaryElectricity_fuelCost    = base.auxillaryElectricity_fuelCost;
		tempEntry.LZCTelecSold_fuelCost            = base.LZCTelecSold_fuelCost;
		tempEntry.LZCTelecDisp_fuelCost            = base.LZCTelecDisp_fuelCost;
		tempEntry.primaryFuelUsed_fuelCost         = base.primaryFuelUsed_fuelCost;
		tempEntry.secFuelUsed_fuelCost			   = base.secFuelUsed_fuelCost;
		
		EstateDataValues.push_back(tempEntry);
	}
	else if(caseOfDwellings == "Improvement 1")
	{
		tempEntry.caseOfDwellings         = caseOfDwellings;
		tempEntry.numOfDwellings          = numOfDwellings;
		tempEntry.projectFileName         = projectFileName;
		tempEntry.projectFileNameNoPath   = projectFileNameNoPath;
		tempEntry.projectFileNameNoExt    = projectFileNameNoExt;

		tempEntry.TFA = imp1.TFA;
		tempEntry.totalSpaceHtSupply	  = imp1.totalSpaceHtSupply;
		tempEntry.totalSpaceCoolingSupply = imp1.totalSpaceCoolingSupply;
		tempEntry.domesticHotWaterSupply  = imp1.domesticHotWaterSupply;
		tempEntry.lightElectricity		  = imp1.lightElectricity;
		tempEntry.auxillaryElectricity    = imp1.auxillaryElectricity;
		tempEntry.totalElectricalSupply   = imp1.totalElectricalSupply;
		tempEntry.mainSpaceHtSupply       = imp1.mainSpaceHtSupply;
		tempEntry.secSpaceHtSupply        = imp1.secSpaceHtSupply;
		tempEntry.LZCT_elecSold           = imp1.LZCT_elecSold;
		tempEntry.LZCT_elecDisplaced      = imp1.LZCT_elecDisplaced;
		tempEntry.primaryFuelUsed         = imp1.primaryFuelUsed;
		tempEntry.secFuelUsed 	          = imp1.secFuelUsed;

		tempEntry.mainSpaceHtSupply_Emm       = imp1.mainSpaceHtSupply_Emm ;
		tempEntry.secSpaceHtSupply_Emm		  = imp1.secSpaceHtSupply_Emm;
		tempEntry.totalSpaceCoolingSupply_Emm = imp1.totalSpaceCoolingSupply_Emm;
		tempEntry.domesticHotWaterSupply_Emm  = imp1.domesticHotWaterSupply_Emm;
		tempEntry.lightElectricity_Emm        = imp1.lightElectricity_Emm;
		tempEntry.auxillaryElectricity_Emm    = imp1.auxillaryElectricity_Emm;
		tempEntry.LZCTelecSold_Emm            = imp1.LZCTelecSold_Emm;
		tempEntry.LZCTelecDisp_Emm            = imp1.LZCTelecDisp_Emm;
		tempEntry.primaryFuelUsed_Emm         = imp1.primaryFuelUsed_fuelCost;
		tempEntry.secFuelUsed_Emm 	          = imp1.secFuelUsed_fuelCost;

		tempEntry.mainSpaceHtSupply_fuelCost       = imp1.mainSpaceHtSupply_fuelCost;
		tempEntry.secSpaceHtSupply_fuelCost        = imp1.secSpaceHtSupply_fuelCost;
		tempEntry.totalSpaceCoolingSupply_fuelCost = imp1.totalSpaceCoolingSupply_fuelCost;
		tempEntry.domesticHotWaterSupply_fuelCost  = imp1.domesticHotWaterSupply_fuelCost;
		tempEntry.lightElectricity_fuelCost        = imp1.lightElectricity_fuelCost;
		tempEntry.auxillaryElectricity_fuelCost    = imp1.auxillaryElectricity_fuelCost;
		tempEntry.LZCTelecSold_fuelCost            = imp1.LZCTelecSold_fuelCost;
		tempEntry.LZCTelecDisp_fuelCost            = imp1.LZCTelecDisp_fuelCost;
		tempEntry.primaryFuelUsed_fuelCost         = imp1.primaryFuelUsed_fuelCost;
		tempEntry.secFuelUsed_fuelCost 	           = imp1.secFuelUsed_fuelCost;
		
		EstateDataValues.push_back(tempEntry);
	}
	else if(caseOfDwellings == "Improvement 2")
	{
		tempEntry.caseOfDwellings         = caseOfDwellings;
		tempEntry.numOfDwellings          = numOfDwellings;
		tempEntry.projectFileName         = projectFileName;
		tempEntry.projectFileNameNoPath   = projectFileNameNoPath;
		tempEntry.projectFileNameNoExt    = projectFileNameNoExt;

		tempEntry.TFA = imp2.TFA;
		tempEntry.totalSpaceHtSupply	  = imp2.totalSpaceHtSupply;
		tempEntry.totalSpaceCoolingSupply = imp2.totalSpaceCoolingSupply;
		tempEntry.domesticHotWaterSupply  = imp2.domesticHotWaterSupply;
		tempEntry.lightElectricity		  = imp2.lightElectricity;
		tempEntry.auxillaryElectricity    = imp2.auxillaryElectricity;
		tempEntry.totalElectricalSupply   = imp2.totalElectricalSupply;
		tempEntry.mainSpaceHtSupply       = imp2.mainSpaceHtSupply;
		tempEntry.secSpaceHtSupply        = imp2.secSpaceHtSupply;
		tempEntry.LZCT_elecSold           = imp2.LZCT_elecSold;
		tempEntry.LZCT_elecDisplaced      = imp2.LZCT_elecDisplaced;
		tempEntry.primaryFuelUsed         = imp2.primaryFuelUsed;
		tempEntry.secFuelUsed 	          = imp2.secFuelUsed;

		tempEntry.mainSpaceHtSupply_Emm       = imp2.mainSpaceHtSupply_Emm ;
		tempEntry.secSpaceHtSupply_Emm		  = imp2.secSpaceHtSupply_Emm;
		tempEntry.totalSpaceCoolingSupply_Emm = imp2.totalSpaceCoolingSupply_Emm;
		tempEntry.domesticHotWaterSupply_Emm  = imp2.domesticHotWaterSupply_Emm;
		tempEntry.lightElectricity_Emm        = imp2.lightElectricity_Emm;
		tempEntry.auxillaryElectricity_Emm    = imp2.auxillaryElectricity_Emm;
		tempEntry.LZCTelecSold_Emm            = imp2.LZCTelecSold_Emm;
		tempEntry.LZCTelecDisp_Emm            = imp2.LZCTelecDisp_Emm;
		tempEntry.primaryFuelUsed_Emm         = imp2.primaryFuelUsed_Emm;
		tempEntry.secFuelUsed_Emm 	          = imp2.secFuelUsed_Emm;

		tempEntry.mainSpaceHtSupply_fuelCost       = imp2.mainSpaceHtSupply_fuelCost;
		tempEntry.secSpaceHtSupply_fuelCost        = imp2.secSpaceHtSupply_fuelCost;
		tempEntry.totalSpaceCoolingSupply_fuelCost = imp2.totalSpaceCoolingSupply_fuelCost;
		tempEntry.domesticHotWaterSupply_fuelCost  = imp2.domesticHotWaterSupply_fuelCost;
		tempEntry.lightElectricity_fuelCost        = imp2.lightElectricity_fuelCost;
		tempEntry.auxillaryElectricity_fuelCost    = imp2.auxillaryElectricity_fuelCost;
		tempEntry.LZCTelecSold_fuelCost            = imp2.LZCTelecSold_fuelCost;
		tempEntry.LZCTelecDisp_fuelCost            = imp2.LZCTelecDisp_fuelCost;
		tempEntry.primaryFuelUsed_fuelCost         = imp2.primaryFuelUsed_fuelCost;
		tempEntry.secFuelUsed_fuelCost 	           = imp2.secFuelUsed_fuelCost;
		
		EstateDataValues.push_back(tempEntry);
	}
	else if(caseOfDwellings == "Improvement 3")
	{
		tempEntry.caseOfDwellings         = caseOfDwellings;
		tempEntry.numOfDwellings          = numOfDwellings;
		tempEntry.projectFileName         = projectFileName;
		tempEntry.projectFileNameNoPath   = projectFileNameNoPath;
		tempEntry.projectFileNameNoExt    = projectFileNameNoExt;

		tempEntry.TFA = imp3.TFA;
		tempEntry.totalSpaceHtSupply	  = imp3.totalSpaceHtSupply;
		tempEntry.totalSpaceCoolingSupply = imp3.totalSpaceCoolingSupply;
		tempEntry.domesticHotWaterSupply  = imp3.domesticHotWaterSupply;
		tempEntry.lightElectricity		  = imp3.lightElectricity;
		tempEntry.auxillaryElectricity    = imp3.auxillaryElectricity;
		tempEntry.totalElectricalSupply   = imp3.totalElectricalSupply;
		tempEntry.mainSpaceHtSupply       = imp3.mainSpaceHtSupply;
		tempEntry.secSpaceHtSupply        = imp3.secSpaceHtSupply;
		tempEntry.LZCT_elecSold           = imp3.LZCT_elecSold;
		tempEntry.LZCT_elecDisplaced      = imp3.LZCT_elecDisplaced;
		tempEntry.primaryFuelUsed         = imp3.primaryFuelUsed;
		tempEntry.secFuelUsed 	          = imp3.secFuelUsed;

		tempEntry.mainSpaceHtSupply_Emm       = imp3.mainSpaceHtSupply_Emm ;
		tempEntry.secSpaceHtSupply_Emm		  = imp3.secSpaceHtSupply_Emm;
		tempEntry.totalSpaceCoolingSupply_Emm = imp3.totalSpaceCoolingSupply_Emm;
		tempEntry.domesticHotWaterSupply_Emm  = imp3.domesticHotWaterSupply_Emm;
		tempEntry.lightElectricity_Emm        = imp3.lightElectricity_Emm;
		tempEntry.auxillaryElectricity_Emm    = imp3.auxillaryElectricity_Emm;
		tempEntry.LZCTelecSold_Emm            = imp3.LZCTelecSold_Emm;
		tempEntry.LZCTelecDisp_Emm            = imp3.LZCTelecDisp_Emm;
		tempEntry.primaryFuelUsed_Emm         = imp3.primaryFuelUsed_Emm;
		tempEntry.secFuelUsed_Emm 	          = imp3.secFuelUsed_Emm;

		tempEntry.mainSpaceHtSupply_fuelCost       = imp3.mainSpaceHtSupply_fuelCost;
		tempEntry.secSpaceHtSupply_fuelCost        = imp3.secSpaceHtSupply_fuelCost;
		tempEntry.totalSpaceCoolingSupply_fuelCost = imp3.totalSpaceCoolingSupply_fuelCost;
		tempEntry.domesticHotWaterSupply_fuelCost  = imp3.domesticHotWaterSupply_fuelCost;
		tempEntry.lightElectricity_fuelCost        = imp3.lightElectricity_fuelCost;
		tempEntry.auxillaryElectricity_fuelCost    = imp3.auxillaryElectricity_fuelCost;
		tempEntry.LZCTelecSold_fuelCost            = imp3.LZCTelecSold_fuelCost;
		tempEntry.LZCTelecDisp_fuelCost            = imp3.LZCTelecDisp_fuelCost;
		tempEntry.primaryFuelUsed_fuelCost         = imp3.primaryFuelUsed_fuelCost;
		tempEntry.secFuelUsed_fuelCost 	           = imp3.secFuelUsed_fuelCost;
		
		EstateDataValues.push_back(tempEntry);
	}
	else if(caseOfDwellings == "Improvement 4")
	{
		tempEntry.caseOfDwellings         = caseOfDwellings;
		tempEntry.numOfDwellings          = numOfDwellings;
		tempEntry.projectFileName         = projectFileName;
		tempEntry.projectFileNameNoPath   = projectFileNameNoPath;
		tempEntry.projectFileNameNoExt    = projectFileNameNoExt;

		tempEntry.TFA = imp4.TFA;
		tempEntry.totalSpaceHtSupply	  = imp4.totalSpaceHtSupply;
		tempEntry.totalSpaceCoolingSupply = imp4.totalSpaceCoolingSupply;
		tempEntry.domesticHotWaterSupply  = imp4.domesticHotWaterSupply;
		tempEntry.lightElectricity		  = imp4.lightElectricity;
		tempEntry.auxillaryElectricity    = imp4.auxillaryElectricity;
		tempEntry.totalElectricalSupply   = imp4.totalElectricalSupply;
		tempEntry.mainSpaceHtSupply       = imp4.mainSpaceHtSupply;
		tempEntry.secSpaceHtSupply        = imp4.secSpaceHtSupply;
		tempEntry.LZCT_elecSold           = imp4.LZCT_elecSold;
		tempEntry.LZCT_elecDisplaced      = imp4.LZCT_elecDisplaced;
		tempEntry.primaryFuelUsed         = imp4.primaryFuelUsed;
		tempEntry.secFuelUsed 	          = imp4.secFuelUsed;

		tempEntry.mainSpaceHtSupply_Emm       = imp4.mainSpaceHtSupply_Emm ;
		tempEntry.secSpaceHtSupply_Emm		  = imp4.secSpaceHtSupply_Emm;
		tempEntry.totalSpaceCoolingSupply_Emm = imp4.totalSpaceCoolingSupply_Emm;
		tempEntry.domesticHotWaterSupply_Emm  = imp4.domesticHotWaterSupply_Emm;
		tempEntry.lightElectricity_Emm        = imp4.lightElectricity_Emm;
		tempEntry.auxillaryElectricity_Emm    = imp4.auxillaryElectricity_Emm;
		tempEntry.LZCTelecSold_Emm            = imp4.LZCTelecSold_Emm;
		tempEntry.LZCTelecDisp_Emm            = imp4.LZCTelecDisp_Emm;
		tempEntry.primaryFuelUsed_Emm         = imp4.primaryFuelUsed_Emm;
		tempEntry.secFuelUsed_Emm 	          = imp4.secFuelUsed_Emm;

		tempEntry.mainSpaceHtSupply_fuelCost       = imp4.mainSpaceHtSupply_fuelCost;
		tempEntry.secSpaceHtSupply_fuelCost        = imp4.secSpaceHtSupply_fuelCost;
		tempEntry.totalSpaceCoolingSupply_fuelCost = imp4.totalSpaceCoolingSupply_fuelCost;
		tempEntry.domesticHotWaterSupply_fuelCost  = imp4.domesticHotWaterSupply_fuelCost;
		tempEntry.lightElectricity_fuelCost        = imp4.lightElectricity_fuelCost;
		tempEntry.auxillaryElectricity_fuelCost    = imp4.auxillaryElectricity_fuelCost;
		tempEntry.LZCTelecSold_fuelCost            = imp4.LZCTelecSold_fuelCost;
		tempEntry.LZCTelecDisp_fuelCost            = imp4.LZCTelecDisp_fuelCost;
		tempEntry.primaryFuelUsed_fuelCost         = imp4.primaryFuelUsed_fuelCost;
		tempEntry.secFuelUsed_fuelCost 	           = imp4.secFuelUsed_fuelCost;
		
		EstateDataValues.push_back(tempEntry);
	}
	else if(caseOfDwellings == "Improvement 5")
	{
		tempEntry.caseOfDwellings         = caseOfDwellings;
		tempEntry.numOfDwellings          = numOfDwellings;
		tempEntry.projectFileName         = projectFileName;
		tempEntry.projectFileNameNoPath   = projectFileNameNoPath;
		tempEntry.projectFileNameNoExt    = projectFileNameNoExt;

		tempEntry.TFA = imp5.TFA;
		tempEntry.totalSpaceHtSupply	  = imp5.totalSpaceHtSupply;
		tempEntry.totalSpaceCoolingSupply = imp5.totalSpaceCoolingSupply;
		tempEntry.domesticHotWaterSupply  = imp5.domesticHotWaterSupply;
		tempEntry.lightElectricity		  = imp5.lightElectricity;
		tempEntry.auxillaryElectricity    = imp5.auxillaryElectricity;
		tempEntry.totalElectricalSupply   = imp5.totalElectricalSupply;
		tempEntry.mainSpaceHtSupply       = imp5.mainSpaceHtSupply;
		tempEntry.secSpaceHtSupply        = imp5.secSpaceHtSupply;
		tempEntry.LZCT_elecSold           = imp5.LZCT_elecSold;
		tempEntry.LZCT_elecDisplaced      = imp5.LZCT_elecDisplaced;
		tempEntry.primaryFuelUsed         = imp5.primaryFuelUsed;
		tempEntry.secFuelUsed 	          = imp5.secFuelUsed;

		tempEntry.mainSpaceHtSupply_Emm       = imp5.mainSpaceHtSupply_Emm ;
		tempEntry.secSpaceHtSupply_Emm		  = imp5.secSpaceHtSupply_Emm;
		tempEntry.totalSpaceCoolingSupply_Emm = imp5.totalSpaceCoolingSupply_Emm;
		tempEntry.domesticHotWaterSupply_Emm  = imp5.domesticHotWaterSupply_Emm;
		tempEntry.lightElectricity_Emm        = imp5.lightElectricity_Emm;
		tempEntry.auxillaryElectricity_Emm    = imp5.auxillaryElectricity_Emm;
		tempEntry.LZCTelecSold_Emm            = imp5.LZCTelecSold_Emm;
		tempEntry.LZCTelecDisp_Emm            = imp5.LZCTelecDisp_Emm;
		tempEntry.primaryFuelUsed_Emm         = imp5.primaryFuelUsed_Emm;
		tempEntry.secFuelUsed_Emm 	          = imp5.secFuelUsed_Emm;

		tempEntry.mainSpaceHtSupply_fuelCost       = imp5.mainSpaceHtSupply_fuelCost;
		tempEntry.secSpaceHtSupply_fuelCost        = imp5.secSpaceHtSupply_fuelCost;
		tempEntry.totalSpaceCoolingSupply_fuelCost = imp5.totalSpaceCoolingSupply_fuelCost;
		tempEntry.domesticHotWaterSupply_fuelCost  = imp5.domesticHotWaterSupply_fuelCost;
		tempEntry.lightElectricity_fuelCost        = imp5.lightElectricity_fuelCost;
		tempEntry.auxillaryElectricity_fuelCost    = imp5.auxillaryElectricity_fuelCost;
		tempEntry.LZCTelecSold_fuelCost            = imp5.LZCTelecSold_fuelCost;
		tempEntry.LZCTelecDisp_fuelCost            = imp5.LZCTelecDisp_fuelCost;
		tempEntry.primaryFuelUsed_fuelCost         = imp5.primaryFuelUsed_fuelCost;
		tempEntry.secFuelUsed_fuelCost 	           = imp5.secFuelUsed_fuelCost;

		EstateDataValues.push_back(tempEntry);
	}

	SaveAllResultsFromProject();
}



void CDlg_Estate::OnBnClickedButtonexport()
{
	// Export data on a csv file that can be opened in Excel to make reports

	CString nameOfDwelling;
	CString numOfDwellings;

	// Temproary variable to display values
	double totalSpaceHtSupply_kwh = 0;
	double totalSpaceCoolingSupply_kwh = 0;
	double domesticHotWaterSupply_kwh = 0;
	double lightElectricity_kwh = 0;
	double auxillaryElectricity_kwh = 0;
	double totalElectricalSupply_kwh = 0;
	double mainSpaceHtSupply_kwh = 0;
	double secSpaceHtSupply_kwh = 0;
	double LZCT_elecSold_kwh = 0;
	double LZCT_elecDisplaced_kwh = 0;

	double totalSpaceHtSupply_kwh_m2 = 0;
	double totalSpaceCoolingSupply_kwh_m2 = 0;
	double domesticHotWaterSupply_kwh_m2 = 0;
	double lightElectricity_kwh_m2 = 0;
	double auxillaryElectricity_kwh_m2 = 0;
	double totalElectricalSupply_kwh_m2 = 0;
	double mainSpaceHtSupply_kwh_m2 = 0;
	double secSpaceHtSupply_kwh_m2 = 0;
	double LZCT_elecSold_kwh_m2 = 0;
	double LZCT_elecDisplaced_kwh_m2 = 0;

	double totalSpaceHtSupply_kgCO2 = 0;
	double totalSpaceCoolingSupply_kgCO2 = 0;
	double domesticHotWaterSupply_kgCO2 = 0;
	double lightElectricity_kgCO2 = 0;
	double auxillaryElectricity_kgCO2 = 0;
	double totalElectricalSupply_kgCO2 = 0;
	double mainSpaceHtSupply_kgCO2 = 0;
	double secSpaceHtSupply_kgCO2 = 0;
	double LZCT_elecSold_kgCO2 = 0;
	double LZCT_elecDisplaced_kgCO2 = 0;

	double totalSpaceHtSupply_kgCO2_m2 = 0;
	double totalSpaceCoolingSupply_kgCO2_m2 = 0;
	double domesticHotWaterSupply_kgCO2_m2 = 0;
	double lightElectricity_kgCO2_m2 = 0;
	double auxillaryElectricity_kgCO2_m2 = 0;
	double totalElectricalSupply_kgCO2_m2 = 0;
	double mainSpaceHtSupply_kgCO2_m2 = 0;
	double secSpaceHtSupply_kgCO2_m2 = 0;
	double LZCT_elecSold_kgCO2_m2 = 0;
	double LZCT_elecDisplaced_kgCO2_m2 = 0;

	double totalSpaceHtSupply_£ = 0;
	double totalSpaceCoolingSupply_£ = 0;
	double domesticHotWaterSupply_£ = 0;
	double lightElectricity_£ = 0;
	double auxillaryElectricity_£ = 0;
	double totalElectricalSupply_£ = 0;
	double mainSpaceHtSupply_£ = 0;
	double secSpaceHtSupply_£ = 0;
	double LZCT_elecSold_£ = 0;
	double LZCT_elecDisplaced_£ = 0;

	double totalSpaceHtSupply_£_m2 = 0;
	double totalSpaceCoolingSupply_£_m2 = 0;
	double domesticHotWaterSupply_£_m2 = 0;
	double lightElectricity_£_m2 = 0;
	double auxillaryElectricity_£_m2 = 0;
	double totalElectricalSupply_£_m2 = 0;
	double mainSpaceHtSupply_£_m2 = 0;
	double secSpaceHtSupply_£_m2 = 0;
	double LZCT_elecSold_£_m2 = 0;
	double LZCT_elecDisplaced_£_m2 = 0;

	int numOfDwellingsEstate = 0;

	double totalSpaceHtSupplyEstate_kwh = 0;
	double totalSpaceCoolingSupplyEstate_kwh = 0;
	double domesticHotWaterSupplyEstate_kwh  = 0;
	double lightElectricityEstate_kwh		 = 0;
	double auxillaryElectricityEstate_kwh    = 0;
	double totalElectricalSupplyEstate_kwh   = 0;
	double mainSpaceHtSupplyEstate_kwh       = 0;
	double secSpaceHtSupplyEstate_kwh        = 0;
	double LZCT_elecSoldEstate_kwh           = 0;
	double LZCT_elecDisplacedEstate_kwh      = 0;

	double totalSpaceHtSupplyEstate_kwh_m2 = 0;
	double totalSpaceCoolingSupplyEstate_kwh_m2 = 0;
	double domesticHotWaterSupplyEstate_kwh_m2  = 0;
	double lightElectricityEstate_kwh_m2		 = 0;
	double auxillaryElectricityEstate_kwh_m2    = 0;
	double totalElectricalSupplyEstate_kwh_m2   = 0;
	double mainSpaceHtSupplyEstate_kwh_m2       = 0;
	double secSpaceHtSupplyEstate_kwh_m2        = 0;
	double LZCT_elecSoldEstate_kwh_m2           = 0;
	double LZCT_elecDisplacedEstate_kwh_m2      = 0;

	double totalSpaceHtSupplyEstate_kgCO2 = 0;
	double totalSpaceCoolingSupplyEstate_kgCO2 = 0;
	double domesticHotWaterSupplyEstate_kgCO2  = 0;
	double lightElectricityEstate_kgCO2		 = 0;
	double auxillaryElectricityEstate_kgCO2    = 0;
	double totalElectricalSupplyEstate_kgCO2   = 0;
	double mainSpaceHtSupplyEstate_kgCO2       = 0;
	double secSpaceHtSupplyEstate_kgCO2        = 0;
	double LZCT_elecSoldEstate_kgCO2           = 0;
	double LZCT_elecDisplacedEstate_kgCO2      = 0;

	double totalSpaceHtSupplyEstate_kgCO2_m2 = 0;
	double totalSpaceCoolingSupplyEstate_kgCO2_m2 = 0;
	double domesticHotWaterSupplyEstate_kgCO2_m2  = 0;
	double lightElectricityEstate_kgCO2_m2		 = 0;
	double auxillaryElectricityEstate_kgCO2_m2    = 0;
	double totalElectricalSupplyEstate_kgCO2_m2   = 0;
	double mainSpaceHtSupplyEstate_kgCO2_m2       = 0;
	double secSpaceHtSupplyEstate_kgCO2_m2        = 0;
	double LZCT_elecSoldEstate_kgCO2_m2           = 0;
	double LZCT_elecDisplacedEstate_kgCO2_m2      = 0;

	double totalSpaceHtSupplyEstate_£ = 0;
	double totalSpaceCoolingSupplyEstate_£ = 0;
	double domesticHotWaterSupplyEstate_£  = 0;
	double lightElectricityEstate_£		 = 0;
	double auxillaryElectricityEstate_£    = 0;
	double totalElectricalSupplyEstate_£   = 0;
	double mainSpaceHtSupplyEstate_£       = 0;
	double secSpaceHtSupplyEstate_£        = 0;
	double LZCT_elecSoldEstate_£           = 0;
	double LZCT_elecDisplacedEstate_£      = 0;

	double totalSpaceHtSupplyEstate_£_m2 = 0;
	double totalSpaceCoolingSupplyEstate_£_m2 = 0;
	double domesticHotWaterSupplyEstate_£_m2  = 0;
	double lightElectricityEstate_£_m2		 = 0;
	double auxillaryElectricityEstate_£_m2    = 0;
	double totalElectricalSupplyEstate_£_m2   = 0;
	double mainSpaceHtSupplyEstate_£_m2       = 0;
	double secSpaceHtSupplyEstate_£_m2        = 0;
	double LZCT_elecSoldEstate_£_m2           = 0;
	double LZCT_elecDisplacedEstate_£_m2      = 0;

	CString exportFileNameAndLocation;

	unsigned int i = 0;

	// Open file save dialog
	//--------------------------------------------------------------------
	// Save dialog to save the project name
	// Warn user not to change the directory
	CFileDialog m_idFile( false, "export", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, // false to save
		"Export files (*.csv)|*.csv|", AfxGetMainWnd());
	m_idFile.m_ofn.lpstrInitialDir = "..\\reports"; // default directory os one step up the executable

	// If user choses to Save File..
	if (m_idFile.DoModal()==IDOK)
	{
		exportFileNameAndLocation     = m_idFile.GetPathName();
	}
	else
	{
		return;
	}

	FILE *fptr;		
	fptr = fopen( exportFileNameAndLocation,"w");

	// Print titles for data
	fprintf(fptr,"%s,%s,%s,%s,%s,%s,%s\n",versionText,"kWh","kWh/m2","£","£/m2","kgCO2","kgCO2/m2");

	i = EstateDataValues.size();

	for( i=0; i < EstateDataValues.size(); i++)
	{
		totalSpaceHtSupply_kwh      = EstateDataValues[i].numOfDwellings * EstateDataValues[i].totalSpaceHtSupply;
		totalSpaceCoolingSupply_kwh = EstateDataValues[i].numOfDwellings * EstateDataValues[i].totalSpaceCoolingSupply;
		domesticHotWaterSupply_kwh  = EstateDataValues[i].numOfDwellings * EstateDataValues[i].domesticHotWaterSupply;
		lightElectricity_kwh        = EstateDataValues[i].numOfDwellings * EstateDataValues[i].lightElectricity;
		auxillaryElectricity_kwh    = EstateDataValues[i].numOfDwellings * EstateDataValues[i].auxillaryElectricity;
		totalElectricalSupply_kwh   = EstateDataValues[i].numOfDwellings * EstateDataValues[i].totalElectricalSupply;
		mainSpaceHtSupply_kwh       = EstateDataValues[i].numOfDwellings * EstateDataValues[i].primaryFuelUsed;
		secSpaceHtSupply_kwh        = EstateDataValues[i].numOfDwellings * EstateDataValues[i].secFuelUsed;
		LZCT_elecSold_kwh           = EstateDataValues[i].numOfDwellings * EstateDataValues[i].LZCT_elecSold;
		LZCT_elecDisplaced_kwh      = EstateDataValues[i].numOfDwellings * EstateDataValues[i].LZCT_elecDisplaced;

		totalSpaceHtSupply_kwh_m2      = EstateDataValues[i].totalSpaceHtSupply/EstateDataValues[i].TFA;;
		totalSpaceCoolingSupply_kwh_m2 = EstateDataValues[i].totalSpaceCoolingSupply/EstateDataValues[i].TFA;
		domesticHotWaterSupply_kwh_m2  = EstateDataValues[i].domesticHotWaterSupply/EstateDataValues[i].TFA;
		lightElectricity_kwh_m2        = EstateDataValues[i].lightElectricity/EstateDataValues[i].TFA;
		auxillaryElectricity_kwh_m2    = EstateDataValues[i].auxillaryElectricity/EstateDataValues[i].TFA;
		totalElectricalSupply_kwh_m2   = EstateDataValues[i].totalElectricalSupply/EstateDataValues[i].TFA;
		mainSpaceHtSupply_kwh_m2       = EstateDataValues[i].primaryFuelUsed/EstateDataValues[i].TFA;
		secSpaceHtSupply_kwh_m2        = EstateDataValues[i].secFuelUsed/EstateDataValues[i].TFA;
		LZCT_elecSold_kwh_m2           = EstateDataValues[i].LZCT_elecSold/EstateDataValues[i].TFA;
		LZCT_elecDisplaced_kwh_m2      = EstateDataValues[i].LZCT_elecDisplaced/EstateDataValues[i].TFA;

		totalSpaceHtSupply_kgCO2      = EstateDataValues[i].numOfDwellings * (EstateDataValues[i].mainSpaceHtSupply_Emm+ EstateDataValues[i].secSpaceHtSupply_Emm);
		totalSpaceCoolingSupply_kgCO2 = EstateDataValues[i].numOfDwellings * EstateDataValues[i].totalSpaceCoolingSupply_Emm;
		domesticHotWaterSupply_kgCO2  = EstateDataValues[i].numOfDwellings * EstateDataValues[i].domesticHotWaterSupply_Emm;
		lightElectricity_kgCO2        = EstateDataValues[i].numOfDwellings * EstateDataValues[i].lightElectricity_Emm;
		auxillaryElectricity_kgCO2    = EstateDataValues[i].numOfDwellings * EstateDataValues[i].auxillaryElectricity_Emm;
		totalElectricalSupply_kgCO2   = EstateDataValues[i].numOfDwellings * (EstateDataValues[i].lightElectricity_Emm + EstateDataValues[i].auxillaryElectricity_Emm);
		mainSpaceHtSupply_kgCO2       = EstateDataValues[i].numOfDwellings * EstateDataValues[i].primaryFuelUsed_Emm;
		secSpaceHtSupply_kgCO2        = EstateDataValues[i].numOfDwellings * EstateDataValues[i].secFuelUsed_Emm;
		LZCT_elecSold_kgCO2           = EstateDataValues[i].numOfDwellings * EstateDataValues[i].LZCTelecSold_Emm;
		LZCT_elecDisplaced_kgCO2      = EstateDataValues[i].numOfDwellings * EstateDataValues[i].LZCTelecDisp_Emm;

		totalSpaceHtSupply_kgCO2_m2      =  (EstateDataValues[i].mainSpaceHtSupply_Emm+ EstateDataValues[i].secSpaceHtSupply_Emm)/EstateDataValues[i].TFA;
		totalSpaceCoolingSupply_kgCO2_m2 =  EstateDataValues[i].totalSpaceCoolingSupply_Emm/EstateDataValues[i].TFA;
		domesticHotWaterSupply_kgCO2_m2  =  EstateDataValues[i].domesticHotWaterSupply_Emm/EstateDataValues[i].TFA;
		lightElectricity_kgCO2_m2        =  EstateDataValues[i].lightElectricity_Emm/EstateDataValues[i].TFA;
		auxillaryElectricity_kgCO2_m2    =  EstateDataValues[i].auxillaryElectricity_Emm/EstateDataValues[i].TFA;
		totalElectricalSupply_kgCO2_m2   =  (EstateDataValues[i].lightElectricity_Emm + EstateDataValues[i].auxillaryElectricity_Emm)/EstateDataValues[i].TFA;
		mainSpaceHtSupply_kgCO2_m2       =  EstateDataValues[i].primaryFuelUsed_Emm/EstateDataValues[i].TFA;
		secSpaceHtSupply_kgCO2_m2        =  EstateDataValues[i].secFuelUsed_Emm/EstateDataValues[i].TFA;
		LZCT_elecSold_kgCO2_m2           =  EstateDataValues[i].LZCTelecSold_Emm/EstateDataValues[i].TFA;
		LZCT_elecDisplaced_kgCO2_m2      =  EstateDataValues[i].LZCTelecDisp_Emm/EstateDataValues[i].TFA;

		totalSpaceHtSupply_£      = EstateDataValues[i].numOfDwellings * (EstateDataValues[i].mainSpaceHtSupply_fuelCost+ EstateDataValues[i].secSpaceHtSupply_fuelCost);
		totalSpaceCoolingSupply_£ = EstateDataValues[i].numOfDwellings * EstateDataValues[i].totalSpaceCoolingSupply_fuelCost;
		domesticHotWaterSupply_£  = EstateDataValues[i].numOfDwellings * EstateDataValues[i].domesticHotWaterSupply_fuelCost;
		lightElectricity_£        = EstateDataValues[i].numOfDwellings * EstateDataValues[i].lightElectricity_fuelCost; 
		auxillaryElectricity_£    = EstateDataValues[i].numOfDwellings * EstateDataValues[i].auxillaryElectricity_fuelCost;
		totalElectricalSupply_£   = (EstateDataValues[i].lightElectricity_fuelCost + EstateDataValues[i].auxillaryElectricity_fuelCost);
		mainSpaceHtSupply_£       = EstateDataValues[i].numOfDwellings * EstateDataValues[i].primaryFuelUsed_fuelCost;
		secSpaceHtSupply_£        = EstateDataValues[i].numOfDwellings * EstateDataValues[i].secFuelUsed_fuelCost;
		LZCT_elecSold_£           = EstateDataValues[i].numOfDwellings * EstateDataValues[i].LZCTelecSold_fuelCost;
		LZCT_elecDisplaced_£      = EstateDataValues[i].numOfDwellings * EstateDataValues[i].LZCTelecDisp_fuelCost;

		totalSpaceHtSupply_£_m2      =  (EstateDataValues[i].mainSpaceHtSupply_fuelCost+ EstateDataValues[i].secSpaceHtSupply_fuelCost)/EstateDataValues[i].TFA;
		totalSpaceCoolingSupply_£_m2 =  EstateDataValues[i].totalSpaceCoolingSupply_fuelCost/EstateDataValues[i].TFA;
		domesticHotWaterSupply_£_m2  =  EstateDataValues[i].domesticHotWaterSupply_fuelCost/EstateDataValues[i].TFA;
		lightElectricity_£_m2        =  EstateDataValues[i].lightElectricity_fuelCost/EstateDataValues[i].TFA; 
		auxillaryElectricity_£_m2    =  EstateDataValues[i].auxillaryElectricity_fuelCost/EstateDataValues[i].TFA;
		totalElectricalSupply_£_m2   = (EstateDataValues[i].lightElectricity_fuelCost + EstateDataValues[i].auxillaryElectricity_fuelCost)/EstateDataValues[i].TFA;
		mainSpaceHtSupply_£_m2       =  EstateDataValues[i].primaryFuelUsed_fuelCost/EstateDataValues[i].TFA;
		secSpaceHtSupply_£_m2        =  EstateDataValues[i].secFuelUsed_fuelCost/EstateDataValues[i].TFA;
		LZCT_elecSold_£_m2           =  EstateDataValues[i].LZCTelecSold_fuelCost/EstateDataValues[i].TFA;
		LZCT_elecDisplaced_£_m2      =  EstateDataValues[i].LZCTelecDisp_fuelCost/EstateDataValues[i].TFA;

		// Calculate totals
		numOfDwellingsEstate              += EstateDataValues[i].numOfDwellings;
		totalSpaceHtSupplyEstate_kwh      += totalSpaceHtSupply_kwh;
		totalSpaceCoolingSupplyEstate_kwh += totalSpaceCoolingSupply_kwh;
		domesticHotWaterSupplyEstate_kwh  += domesticHotWaterSupply_kwh;
		lightElectricityEstate_kwh		  += lightElectricity_kwh;
		auxillaryElectricityEstate_kwh    += auxillaryElectricity_kwh;
		totalElectricalSupplyEstate_kwh   += totalElectricalSupply_kwh;
		mainSpaceHtSupplyEstate_kwh       += mainSpaceHtSupply_kwh;
		secSpaceHtSupplyEstate_kwh        += secSpaceHtSupply_kwh;
		LZCT_elecSoldEstate_kwh           += LZCT_elecSold_kwh;
		LZCT_elecDisplacedEstate_kwh      += LZCT_elecDisplaced_kwh;

		totalSpaceHtSupplyEstate_kwh_m2      += totalSpaceHtSupply_kwh_m2;
		totalSpaceCoolingSupplyEstate_kwh_m2 += totalSpaceCoolingSupply_kwh_m2;
		domesticHotWaterSupplyEstate_kwh_m2  += domesticHotWaterSupply_kwh_m2;
		lightElectricityEstate_kwh_m2		 += lightElectricity_kwh_m2;
		auxillaryElectricityEstate_kwh_m2    += auxillaryElectricity_kwh_m2;
		totalElectricalSupplyEstate_kwh_m2   += totalElectricalSupply_kwh_m2;
		mainSpaceHtSupplyEstate_kwh_m2       += mainSpaceHtSupply_kwh_m2;
		secSpaceHtSupplyEstate_kwh_m2        += secSpaceHtSupply_kwh_m2;
		LZCT_elecSoldEstate_kwh_m2           += LZCT_elecSold_kwh_m2;
		LZCT_elecDisplacedEstate_kwh_m2      += LZCT_elecDisplaced_kwh_m2;

		totalSpaceHtSupplyEstate_kgCO2      += totalSpaceHtSupply_kgCO2;
		totalSpaceCoolingSupplyEstate_kgCO2 += totalSpaceCoolingSupply_kgCO2;
		domesticHotWaterSupplyEstate_kgCO2  += domesticHotWaterSupply_kgCO2;
		lightElectricityEstate_kgCO2		+= lightElectricity_kgCO2;
		auxillaryElectricityEstate_kgCO2    += auxillaryElectricity_kgCO2;
		totalElectricalSupplyEstate_kgCO2   += totalElectricalSupply_kgCO2;
		mainSpaceHtSupplyEstate_kgCO2       += mainSpaceHtSupply_kgCO2;
		secSpaceHtSupplyEstate_kgCO2        += secSpaceHtSupply_kgCO2;
		LZCT_elecSoldEstate_kgCO2           += LZCT_elecSold_kgCO2;
		LZCT_elecDisplacedEstate_kgCO2      += LZCT_elecDisplaced_kgCO2;

		totalSpaceHtSupplyEstate_kgCO2_m2      += totalSpaceHtSupply_kgCO2_m2;
		totalSpaceCoolingSupplyEstate_kgCO2_m2 += totalSpaceCoolingSupply_kgCO2_m2;
		domesticHotWaterSupplyEstate_kgCO2_m2  += domesticHotWaterSupply_kgCO2_m2;
		lightElectricityEstate_kgCO2_m2		   += lightElectricity_kgCO2_m2;
		auxillaryElectricityEstate_kgCO2_m2    += auxillaryElectricity_kgCO2_m2;
		totalElectricalSupplyEstate_kgCO2_m2   += totalElectricalSupply_kgCO2_m2;
		mainSpaceHtSupplyEstate_kgCO2_m2       += mainSpaceHtSupply_kgCO2_m2;
		secSpaceHtSupplyEstate_kgCO2_m2        += secSpaceHtSupply_kgCO2_m2;
		LZCT_elecSoldEstate_kgCO2_m2           += LZCT_elecSold_kgCO2_m2;
		LZCT_elecDisplacedEstate_kgCO2_m2      += LZCT_elecDisplaced_kgCO2_m2;

		totalSpaceHtSupplyEstate_£      += totalSpaceHtSupply_£;
		totalSpaceCoolingSupplyEstate_£ += totalSpaceCoolingSupply_£;
		domesticHotWaterSupplyEstate_£  += domesticHotWaterSupply_£;
		lightElectricityEstate_£		+= lightElectricity_£;
		auxillaryElectricityEstate_£    += auxillaryElectricity_£;
		totalElectricalSupplyEstate_£   += totalElectricalSupply_£;
		mainSpaceHtSupplyEstate_£       += mainSpaceHtSupply_£;
		secSpaceHtSupplyEstate_£        += secSpaceHtSupply_£;
		LZCT_elecSoldEstate_£           += LZCT_elecSold_£;
		LZCT_elecDisplacedEstate_£      += LZCT_elecDisplaced_£;

		totalSpaceHtSupplyEstate_£_m2      += totalSpaceHtSupply_£_m2;
		totalSpaceCoolingSupplyEstate_£_m2 += totalSpaceCoolingSupply_£_m2;
		domesticHotWaterSupplyEstate_£_m2  += domesticHotWaterSupply_£_m2;
		lightElectricityEstate_£_m2		   += lightElectricity_£_m2;
		auxillaryElectricityEstate_£_m2    += auxillaryElectricity_£_m2;
		totalElectricalSupplyEstate_£_m2   += totalElectricalSupply_£_m2;
		mainSpaceHtSupplyEstate_£_m2       += mainSpaceHtSupply_£_m2;
		secSpaceHtSupplyEstate_£_m2        += secSpaceHtSupply_£_m2;
		LZCT_elecSoldEstate_£_m2           += LZCT_elecSold_£_m2;
		LZCT_elecDisplacedEstate_£_m2      += LZCT_elecDisplaced_£_m2;

		fprintf(fptr,"\n%s,%s\n","Name: ",EstateDataValues[i].projectFileNameNoExt);
		fprintf(fptr,"%s,%d\n","Number of dwellings: ",EstateDataValues[i].numOfDwellings);
		fprintf(fptr,"%s,%s\n","Case: ", EstateDataValues[i].caseOfDwellings);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"Space heating supply",
			totalSpaceHtSupply_kwh,
			totalSpaceHtSupply_kwh_m2,
			totalSpaceHtSupply_kgCO2,
			totalSpaceHtSupply_kgCO2_m2,
			totalSpaceHtSupply_£,
			totalSpaceHtSupply_£_m2);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"Space cooling supply",
			totalSpaceCoolingSupply_kwh,
			totalSpaceCoolingSupply_kwh_m2,
			totalSpaceCoolingSupply_kgCO2,
			totalSpaceCoolingSupply_kgCO2_m2,
			totalSpaceCoolingSupply_£,
			totalSpaceCoolingSupply_£_m2);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"Domestic hot water",
			domesticHotWaterSupply_kwh,
			domesticHotWaterSupply_kwh_m2,
			domesticHotWaterSupply_kgCO2,
			domesticHotWaterSupply_kgCO2_m2,
			domesticHotWaterSupply_£,
			domesticHotWaterSupply_£_m2);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"Lighting/electricity",
			lightElectricity_kwh,
			lightElectricity_kwh_m2,
			lightElectricity_kgCO2,
			lightElectricity_kgCO2_m2,
			lightElectricity_£,
			lightElectricity_£_m2);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"Auxillary electricity",
			auxillaryElectricity_kwh,
			auxillaryElectricity_kwh_m2,
			auxillaryElectricity_kgCO2,
			auxillaryElectricity_kgCO2_m2,
			auxillaryElectricity_£,
			auxillaryElectricity_£_m2);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"Total electricity supply",
			totalElectricalSupply_kwh,
			totalElectricalSupply_kwh_m2,
			totalElectricalSupply_kgCO2,
			totalElectricalSupply_kgCO2_m2,
			totalElectricalSupply_£,
			totalElectricalSupply_£_m2);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"Primary fuel",
			mainSpaceHtSupply_kwh,
			mainSpaceHtSupply_kwh_m2,
			mainSpaceHtSupply_kgCO2,
			mainSpaceHtSupply_kgCO2_m2,
			mainSpaceHtSupply_£,
			mainSpaceHtSupply_£_m2);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"Secondary fuel",
			secSpaceHtSupply_kwh,
			secSpaceHtSupply_kwh_m2,
			secSpaceHtSupply_kgCO2,
			secSpaceHtSupply_kgCO2_m2,
			secSpaceHtSupply_£,
			secSpaceHtSupply_£_m2);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"LZCT sold",
			LZCT_elecSold_kwh,
			LZCT_elecSold_kwh_m2,
			LZCT_elecSold_kgCO2,
			LZCT_elecSold_kgCO2_m2,
			LZCT_elecSold_£,
			LZCT_elecSold_£_m2);

		fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
			"LZCT displaced",
			LZCT_elecDisplaced_kwh,
			LZCT_elecDisplaced_kwh_m2,
			LZCT_elecDisplaced_kgCO2,
			LZCT_elecDisplaced_kgCO2_m2,
			LZCT_elecDisplaced_£,
			LZCT_elecDisplaced_£_m2);
	}

	// Print totals for estate
	fprintf(fptr,"\n%s\n","Total for the estate",numOfDwellingsEstate);
	fprintf(fptr,"%s %d\n","Total number of dwellings:",numOfDwellingsEstate);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"Space heating supply",
		totalSpaceHtSupplyEstate_kwh,
		totalSpaceHtSupplyEstate_kwh_m2,
		totalSpaceHtSupplyEstate_kgCO2,
		totalSpaceHtSupplyEstate_kgCO2_m2,
		totalSpaceHtSupplyEstate_£,
		totalSpaceHtSupplyEstate_£_m2);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"Space cooling supply",
		totalSpaceCoolingSupplyEstate_kwh,
		totalSpaceCoolingSupplyEstate_kwh_m2,
		totalSpaceCoolingSupplyEstate_kgCO2,
		totalSpaceCoolingSupplyEstate_kgCO2_m2,
		totalSpaceCoolingSupplyEstate_£,
		totalSpaceCoolingSupplyEstate_£_m2);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"Domestic hot water",
		domesticHotWaterSupplyEstate_kwh,
		domesticHotWaterSupplyEstate_kwh_m2,
		domesticHotWaterSupplyEstate_kgCO2,
		domesticHotWaterSupplyEstate_kgCO2_m2,
		domesticHotWaterSupplyEstate_£,
		domesticHotWaterSupplyEstate_£_m2);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"Lighting/electricity",
		lightElectricityEstate_kwh,
		lightElectricityEstate_kwh_m2,
		lightElectricityEstate_kgCO2,
		lightElectricityEstate_kgCO2_m2,
		lightElectricityEstate_£,
		lightElectricityEstate_£_m2);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"Auxillary Electricity",
		auxillaryElectricityEstate_kwh,
		auxillaryElectricityEstate_kwh_m2,
		auxillaryElectricityEstate_kgCO2,
		auxillaryElectricityEstate_kgCO2_m2,
		auxillaryElectricityEstate_£,
		auxillaryElectricityEstate_£_m2);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"Total electricity supply",
		totalElectricalSupplyEstate_kwh,
		totalElectricalSupplyEstate_kwh_m2,
		totalElectricalSupplyEstate_kgCO2,
		totalElectricalSupplyEstate_kgCO2_m2,
		totalElectricalSupplyEstate_£,
		totalElectricalSupplyEstate_£_m2);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"Primary fuel",
		mainSpaceHtSupplyEstate_kwh,
		mainSpaceHtSupplyEstate_kwh_m2,
		mainSpaceHtSupplyEstate_kgCO2,
		mainSpaceHtSupplyEstate_kgCO2_m2,
		mainSpaceHtSupplyEstate_£,
		mainSpaceHtSupplyEstate_£_m2);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"Secondary fuel",
		secSpaceHtSupplyEstate_kwh,
		secSpaceHtSupplyEstate_kwh_m2,
		secSpaceHtSupplyEstate_kgCO2,
		secSpaceHtSupplyEstate_kgCO2_m2,
		secSpaceHtSupplyEstate_£,
		secSpaceHtSupplyEstate_£_m2);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"LZCT sold",
		LZCT_elecSoldEstate_kwh,
		LZCT_elecSoldEstate_kwh_m2,
		LZCT_elecSoldEstate_kgCO2,
		LZCT_elecSoldEstate_kgCO2_m2,
		LZCT_elecSoldEstate_£,
		LZCT_elecSoldEstate_£_m2);

	fprintf(fptr,"%s,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\n",
		"LZCT displaced",
		LZCT_elecDisplacedEstate_kwh,
		LZCT_elecDisplacedEstate_kwh_m2,
		LZCT_elecDisplacedEstate_kgCO2,
		LZCT_elecDisplacedEstate_kgCO2_m2,
		LZCT_elecDisplacedEstate_£,
		LZCT_elecDisplacedEstate_£_m2);	

	fclose(fptr);
}

void CDlg_Estate::OnBnClickedButtonSaveEstate()
{
	// To save estate from estate dialog
	unsigned int i = 0;
	i =  EstateDataValues.size();
	if(i <=0)
	{
		MessageBox("Not enough data to save estate! Please add data to estate.", "Error", MB_ICONERROR | MB_OK);
	}
	else
	{
		SaveEstate();
	}
}

void CSAPP1Dlg::OnEstateSaveEstate()
{
	// To save estate from main menu
	unsigned int i = 0;
	i =  EstateDataValues.size();

	if(i <=0)
	{
		MessageBox("Not enough data to save estate! Please add data to estate.", "Error", MB_ICONERROR | MB_OK);
	}
	else
	{
		SaveEstate();
	}
}


void CSAPP1Dlg::OnEstateOpenEstate()
{
	if_open_estate_from_main_dialog = true;

	is_results_values_read_first_time = false;

	//--------------------------------------------------------------------
	// Enable all these falgs so all sliders etc are updated properly
	enable_user_to_change_tab = true;

	//file_new_selected = false;
	
	FILE *fptr;
	char *pError;
	char *pch;
	int linesRead = 0;
	char tempStr[9000];
	unsigned int vectorSize = 0;

	char tempFileName[5000];
	char tempProjectFileNameNoPath[5000];		
	char tempProjectFileNameNoExt[5000];
			
	int tempNumOfDwellings;
	char tempCase[15];
	
	CString estateFileNameAndLocation;
	
	//--------------------------------------------------------------------------------
	// STEP 1
	// DISPLAY FILE OPEN DIALOG
	//--------------------------------------------------------------------------------
	// Open dialog to read the project name
	CFileDialog m_idFile( true, "estate", NULL, OFN_HIDEREADONLY, // false to open
	"Estate files (*.est)|*.est|", AfxGetMainWnd());

	m_idFile.m_ofn.lpstrInitialDir = "..\\estate"; // default directory os one step up the executable

	// If user choses to Open File..
	if (m_idFile.DoModal()==IDOK)
	{
		estateFileNameAndLocation     = m_idFile.GetPathName();		
	}
	else
	{
		return;
	}

	// @SHG This section is removed and warning message are displayed only for project file
	// and not estate file

	//vectorSize = estateFileNameVector1.size();

	//for( vectorSize=0; vectorSize < estateFileNameVector1.size(); vectorSize++)
	//{
	//	if(strcmp(estateFileNameAndLocation,estateFileNameVector1[vectorSize].fileName)==0)
	//	{
	//		MessageBox("Cannot reopen an estate file!", "Error",  MB_OK);
	//		return;									
	//	}		
	//}

	//// Add estate file name to a vector 
	//// This will be used to avoid reopening of estate file
	//tempEntry.fileName = estateFileNameAndLocation;
	//estateFileNameVector1.push_back(tempEntry);

	//--------------------------------------------------------------------------------
	// STEP 2
	// READ FILE NAME (WITH/WITHOUT EXTENSION), NUMBER OF DWELLINGS AND CASE FROM SAVED ESTATE FILE
	//--------------------------------------------------------------------------------
	fptr = fopen(estateFileNameAndLocation,"r");
	
	if (fptr == NULL)
	{
		MessageBox("Error opening estate file", "Error",  MB_OK);
		return;
	}

	// Keep on reading (and proessing) each line from the CSV file
	// until reached end of file OR some error occured	
	while (TRUE)
	{
		// Read a line from a CSV file
		pError = fgets(tempStr,6000,fptr);
		linesRead ++;	

		// if reached end of file
		if(pError == NULL)
		{	
			break;
		}
	
		if(linesRead>2)
		{
			// 1. Read file Name 
			//--------------------------------------------------------------------
			// 1.	Read the "entry label" for the combo box
			pch = strtok (tempStr, ",");
			// If some error has occured
			if (pch == NULL)
			{
				MessageBox("Error opening estate file", "Error",  MB_OK);
		        return;
			}
			strcpy(tempFileName,pch);	
			projectFileName       = tempFileName;	

			//--------------------------------------------------------------------
			// 2.	
			pch = strtok (NULL, ",");
			// If some error has occured
			if (pch == NULL)
			{
				MessageBox("Error opening estate file", "Error",  MB_OK);
		        return;
			}
			strcpy(tempProjectFileNameNoPath,pch);
			projectFileNameNoPath = tempProjectFileNameNoPath;

			//--------------------------------------------------------------------
			// 3.	
			pch = strtok (NULL, ",");
			// If some error has occured
			if (pch == NULL)
			{
				MessageBox("Error opening estate file", "Error",  MB_OK);
		        return;
			}
			strcpy(tempProjectFileNameNoExt,pch);
			projectFileNameNoExt  = tempProjectFileNameNoExt;

			//--------------------------------------------------------------------
			// 4.
			pch = strtok (NULL, ",");
			// If some error has occured
			if (pch == NULL)
			{
				MessageBox("Error opening estate file", "Error",  MB_OK);
		        return;
			}
			strcpy(tempCase,pch);
			caseOfDwellings = tempCase;
			int size = 0;
	        size = 	strlen(caseOfDwellings);			

			//--------------------------------------------------------------------
			// 5. 
			pch = strtok (NULL, ",");
			// If some error has occured
			if (pch == NULL)
			{
				MessageBox("Error opening estate file", "Error",   MB_OK);
		        return;
			}	
			tempNumOfDwellings = atoi(pch);
			numOfDwellings = tempNumOfDwellings;

			//--------------------------------------------------------------------------------
			// STEP 3
			// DELETE UNTITLED TAB IF PRESENT
			//--------------------------------------------------------------------------------
			DeleteUntitledTab();

			//--------------------------------------------------------------------------------
			// STEP 4
			// UPDATE ALL DIALOGS WITH NEW DATA
			// OPEN ESTATE PROJECT FILES IN TABS AND RECERATE TABS
			//--------------------------------------------------------------------------------			
			OpenProjectFile_2();

			RecreateAllDialogs();

			SaveAllResultsFromProject();

			//-------------------------------------------------------------------
			// Create new tab if file opened first time
			if(is_file_opened_if_changing_tabs == false)
			{
				if(fileFound == 1)
				{
					OpenNewTabForProjectFile();						
				}
			}

			//-------------------------------------------------------------------
			// Set flag to false
			is_file_opened_if_changing_tabs = false;

			//-------------------------------------------------------------------
			// This flag ia added to ensure that estate can only display
			// saved or opened projects
			chk_if_project_saved     = true;

			lastTabNumber = m_tabCtrlProjects.GetCurSel();

			//--------------------------------------------------------------------------------
			// STEP 5
			// ENTER DATA IN ESTATE VECTOR, CASE WILL BE READ FROM SAVED FILE
			//--------------------------------------------------------------------------------
			add_dwelling_to_estate = true;
			if(fileFound ==1)
			{
				AddPropertyToEstate();
				fileFound = 0;
			}
		}
	}

	fclose(fptr);

	if_open_estate_from_main_dialog = false;
}


void CDlg_Estate::UpdateEstateList()
{
	UpdateData(true);

	//-----------------------------------------------
	// Read new values for number of dwellings and case
	numOfDwellingsRead = str_editNumOfDwellings;
	caseOfDwellingRead = str_comboCase;
	
	int nSelected = 0;
	int index = 0;
	unsigned int i = 0;
	CString fileName;

	//-----------------------------------------------
	// Item selected in list to determine file name,
	// case and numner of dwellings
	index = itemSelectedToEdit;
	fileName = EstateDataValues[itemSelectedToEdit].projectFileName;	
	double checkNum = 0;

	//----------------------------------------------------------
	// IF THE USER HAS CHANGED CASE PROCEED AS FOLLOWS
	//----------------------------------------------------------
	// Match file name and case to read results
	if(is_estate_case_updated == true)
	{
		is_estate_case_updated = false;

		//----------------------------------------------------------
		// Base case
		if (strcmp(caseOfDwellingRead, "Base")==0)
		{
			for( i=0; i < EstateDataValuesBase.size(); i++)
			{
				if(strcmp(fileName,EstateDataValuesBase[i].projectFileName)==0)
				{
					EstateDataValues[index]= EstateDataValuesBase[i];
					EstateDataValues[index].caseOfDwellings = "Base";
					checkNum = EstateDataValues[index].totalSpaceHtSupply;					
				}
			}
		}
		//----------------------------------------------------------
		// Improvement 1
		else if (strcmp(caseOfDwellingRead, "Improvement 1")==0)
		{

			CString caseOfDwellingschk;
			for( i=0; i < EstateDataValuesImp1.size(); i++)
			{
				if(strcmp(fileName,EstateDataValuesImp1[i].projectFileName)==0)
				{
					EstateDataValues[index]= EstateDataValuesImp1[i];
					EstateDataValues[index].caseOfDwellings = "Improvement 1";
					checkNum = EstateDataValues[index].totalSpaceHtSupply;// debug					
				}
			}
		}
		//----------------------------------------------------------
		// Improvement 2
		else if (strcmp(caseOfDwellingRead, "Improvement 2")==0)
		{
			for( i=0; i < EstateDataValuesImp2.size(); i++)
			{
				if(strcmp(fileName,EstateDataValuesImp2[i].projectFileName)==0)
				{
					EstateDataValues[index]= EstateDataValuesImp2[i];
					EstateDataValues[index].caseOfDwellings = "Improvement 2";
					checkNum = EstateDataValues[index].totalSpaceHtSupply;// debug					
				}
			}
		}
		//----------------------------------------------------------
		// Improvement 3
		else if (strcmp(caseOfDwellingRead, "Improvement 3")==0)
		{
			for( i=0; i < EstateDataValuesImp3.size(); i++)
			{
				if(strcmp(fileName,EstateDataValuesImp3[i].projectFileName)==0)
				{
					EstateDataValues[index]= EstateDataValuesImp3[i];					
					EstateDataValues[index].caseOfDwellings = "Improvement 3";
					checkNum = EstateDataValues[index].totalSpaceHtSupply;// debug					
				}
			}
		}
		//----------------------------------------------------------
		// Improvement 4
		else if (strcmp(caseOfDwellingRead, "Improvement 4")==0)
		{
			for( i=0; i < EstateDataValuesImp4.size(); i++)
			{
				if(strcmp(fileName,EstateDataValuesImp4[i].projectFileName)==0)
				{
					EstateDataValues[index]= EstateDataValuesImp4[i];					
					EstateDataValues[index].caseOfDwellings = "Improvement 4";
					checkNum = EstateDataValues[index].totalSpaceHtSupply;// debug					
				}
			}
		}
		//----------------------------------------------------------
		// Improvement 5
		else if (strcmp(caseOfDwellingRead, "Improvement 5")==0)
		{
			for( i=0; i < EstateDataValuesImp5.size(); i++)
			{
				if(strcmp(fileName,EstateDataValuesImp5[i].projectFileName)==0)
				{
					EstateDataValues[index]= EstateDataValuesImp5[i];					
					EstateDataValues[index].caseOfDwellings = "Improvement 5";
					checkNum = EstateDataValues[index].totalSpaceHtSupply;// debug					
				}
			}
		}	

		// Update list with new vector data
		DisplayEstateList();
	}
	
	//----------------------------------------------------------
	// IF THE USER HAS CHANGED NUMBER OD DWELLINGS PROCEED AS FOLLOWS
	//----------------------------------------------------------
	if(is_estate_num_of_dwellings_updated == true)
	{
		is_estate_num_of_dwellings_updated = false;

		//----------------------------------------------------------
		// Base case
		for( i=0; i < EstateDataValues.size(); i++)
		{
			if(strcmp(fileName,EstateDataValues[i].projectFileName)==0)
			{
				EstateDataValues[index].numOfDwellings = atoi(numOfDwellingsRead);
				checkNum = EstateDataValues[index].numOfDwellings;					
			}
		}

		// Update list with new vector data
		DisplayEstateList();
	}

	// Delete estate list and disable make edit controls 
	/*m_editNumOfDwellings.SetReadOnly(TRUE);	
	m_comboCase.EnableWindow(FALSE);
	m_lableNumDwellingds.EnableWindow(FALSE);
	m_labelCase.EnableWindow(FALSE);
	m_labelDwellingName.EnableWindow(FALSE);
	m_editNameOfDwelling.EnableWindow(FALSE);*/

	
	

}

void CDlg_Estate::OnEnChangeEditNum()
{	
	is_estate_num_of_dwellings_updated = true;
}

void CDlg_Estate::OnCbnSelchangeComboCase()
{
	is_estate_case_updated = true;	
}


void CDlg_Estate::OnBnClickedButtonDelete()
{
	POSITION itemPosition = 0;
	unsigned int size = 0;

	size = EstateDataValues.size();

	//---------------------------------------------------------------------------------------------
	// Get the item index of the item selected
	itemPosition = m_listEstate.GetFirstSelectedItemPosition();

	if (itemPosition == 0)
	{
		// Check if user has selected any item to delete, if no item is selected
	    // prompt the user to select an item
		MessageBox("Select an item to delete..", "Warning", MB_OK);
	}
	else
	{
		is_delete_dwelling_clicked = true;		

		//----------------------------------------------------------------------
		// Read the values in highlighted row 
		itemSelectedToDelete = m_listEstate.GetSelectionMark();

		// If user selects the last item to delete which is total
		// return form function
		if(itemSelectedToDelete == size)
		{
			return;
		}
		else
		{
			// Delete from vector and update list
			EstateDataValues.erase(EstateDataValues.begin()+(itemSelectedToDelete));
			EstateDataValuesBase.erase(EstateDataValuesBase.begin()+itemSelectedToDelete);
			EstateDataValuesImp1.erase(EstateDataValuesImp1.begin()+itemSelectedToDelete);
			EstateDataValuesImp2.erase(EstateDataValuesImp2.begin()+itemSelectedToDelete);
			EstateDataValuesImp3.erase(EstateDataValuesImp3.begin()+itemSelectedToDelete);
			EstateDataValuesImp4.erase(EstateDataValuesImp4.begin()+itemSelectedToDelete);
			EstateDataValuesImp5.erase(EstateDataValuesImp5.begin()+itemSelectedToDelete);

			// Update list with new vector data
			DisplayEstateList();
		}				
	}
}


void CDlg_Estate::OnBnClickedButtonUpdate()
{
	UpdateEstateList();	
}

//When an item is double clicked, allow edit for number of dwellings and case
void CDlg_Estate::OnLvnItemActivateList1(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMITEMACTIVATE pNMIA = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);

	unsigned int size = 0;
	POSITION itemIndex = 0;	
	int nSelected = 0;
	int index = 0;

	int base = 0;
	int imp1 = 0;
	int imp2 = 0;
	int imp3 = 0;
	int imp4 = 0;
	int imp5 = 0;

	unsigned int i = 0;
	CString nameOfDwelling;
	CString numOfDwellings;
	CString caseOfDwelling;

	size = EstateDataValues.size();
	
	// Check if an item is highlighted to edit, if not display a warning message to select an item
	//---------------------------------------------------------------------------------------------
	// Get the item index of the item selected
	itemIndex = m_listEstate.GetFirstSelectedItemPosition();

	is_edit_dwelling_clicked = true;

		//----------------------------------------------------------------------
		// Read the values in highlighted row 
		nSelected          = m_listEstate.GetSelectionMark();
		itemSelectedToEdit = nSelected;

		// If user selects the last item to delete which is total
		// return form function
		if(itemSelectedToEdit == size)
		{
			//----------------------------------------------------------------------
			// Disable drop-down menu and edit boxes
			m_editNumOfDwellings.EnableWindow(FALSE);
			m_comboCase.EnableWindow(FALSE);	
			m_lableNumDwellingds.EnableWindow(FALSE);
			m_labelCase.EnableWindow(FALSE);
			m_labelDwellingName.EnableWindow(FALSE);
			m_editNameOfDwelling.EnableWindow(FALSE);
			return;
		}

		nameOfDwelling = m_listEstate.GetItemText(nSelected, 0);
		numOfDwellings = m_listEstate.GetItemText(nSelected, 1);
		caseOfDwelling = m_listEstate.GetItemText(nSelected, 2);

		//----------------------------------------------------------------------
		// Enable drop-down menu and edit boxes
		m_editNumOfDwellings.EnableWindow(TRUE);
	 	m_editNumOfDwellings.SetReadOnly(FALSE);	
	    m_comboCase.EnableWindow(TRUE);	
		m_lableNumDwellingds.EnableWindow(TRUE);
		m_labelCase.EnableWindow(TRUE);
		m_labelDwellingName.EnableWindow(TRUE);
		m_editNameOfDwelling.EnableWindow(TRUE);

		//----------------------------------------------------
		// Read form project file which cases have been saved by user
		// and Populate combo box of case with relevant/available cases
		index = 0;
		int linesRead = 0;
		FILE *fptr;
		char *pError;
	    char *pch;
		char tempStr[500];
		CString fileName;
		int indexEstateData = 0;
		
		indexEstateData = nSelected;
		fileName = EstateDataValues[indexEstateData].projectFileName;

		// Open the file
		fptr = fopen( fileName,"r");

		if (fptr == NULL)
		{
			return;
		}

		while (TRUE)
		{
			// Read a line from a CSV file
			pError = fgets(tempStr,500,fptr);
			linesRead ++;

			// if reached end of file
			if(pError == NULL)
			{	
				break;
			}

			if(linesRead==2) // Read data form first line only
			{
				//-------------------------------------------
				// 1.	Skip the case label
				pch = strtok (tempStr, ",");
				// If some error has occured
				if (pch == NULL)
				{
					break;
				}
				
				//-------------------------------------------
				// 2. skip 2nd coloumn for current case
				pch = strtok (NULL, ",");

				// If some error has occured
				if (pch == NULL)
				{
					break;
				}

				//-------------------------------------------
				// 3. Read base
				pch = strtok (NULL, ",");
				// If some error has occured
				if (pch == NULL)
				{
					break;
				}
				base = atoi(pch);

				//-------------------------------------------
				// 4. Read imp1
				pch = strtok (NULL, ",");
				// If some error has occured
				if (pch == NULL)
				{
					break;
				}
				imp1 = atoi(pch);

				//-------------------------------------------
				// 5. Read imp2
				pch = strtok (NULL, ",");
				// If some error has occured
				if (pch == NULL)
				{
					break;
				}
				imp2 = atoi(pch);

				//-------------------------------------------
				// 6. Read imp3
				pch = strtok (NULL, ",");
				// If some error has occured
				if (pch == NULL)
				{
					break;
				}
				imp3 = atoi(pch);

				//-------------------------------------------
				// 7. Read imp4
				pch = strtok (NULL, ",");
				// If some error has occured
				if (pch == NULL)
				{
					break;
				}
				imp4 = atoi(pch);

				//-------------------------------------------
				// 8. Read imp5
				pch = strtok (NULL, ",");
				// If some error has occured
				if (pch == NULL)
				{
					break;
				}
				imp5 = atoi(pch);
			}
		}
		// Close the CSV file
		fclose(fptr);		

		m_comboCase.ResetContent();
		if(base == 1)
		{
			m_comboCase.InsertString(0,"Base");
		}
		if(imp1 == 1)
		{
			m_comboCase.InsertString(1,"Improvement 1");
		}
		if(imp2 == 1)
		{
			m_comboCase.InsertString(2,"Improvement 2");
		}
		if(imp3 == 1)
		{
			m_comboCase.InsertString(3,"Improvement 3");
		}
		if(imp4 == 1)
		{
			m_comboCase.InsertString(4,"Improvement 4");
		}
		if(imp5 == 1)
		{
			m_comboCase.InsertString(5,"Improvement 5");
		}

		//----------------------------------------------------
		// Paste values in edit boxes to modify
		m_comboCase.SelectString(0,caseOfDwelling);
		m_editNameOfDwelling.SetWindowText(nameOfDwelling);
		m_editNumOfDwellings.SetWindowText(numOfDwellings);

	*pResult = 0;
}

void CSAPP1Dlg::OnFileMenuOpenEstate()
{
	OnEstateOpenEstate();
}


void CSAPP1Dlg::OnFileClose()
{
	int tabPosition = 0;
	int numOfItemsInTab = 0;
	unsigned int i = 0;
	unsigned int index = 0;

	CString temp;

	// Close the tab containing project file
	tabPosition = m_tabCtrlProjects.GetCurSel();
	m_tabCtrlProjects.DeleteItem(tabPosition);
	m_tabCtrlProjects.SetCurSel(tabPosition - 1);

	// Remove file name from the vector list so user is able to re-open
	// 1. Read file name with path from tab.
	temp = projectFileName;

	for( i=0; i < estateFileNameVector1.size(); i++)
	{
		if(strcmp(projectFileName,estateFileNameVector1[i].fileName)==0)
		{
			index = i;
		}	
	}

	// Erase index element from vector	
	estateFileNameVector1.erase (estateFileNameVector1.begin()+index);

	//-----------------------------------------------------------------
	// If all tabs are closed, open a new project and "untitled" 
	// project tab
	//-----------------------------------------------------------------
	numOfItemsInTab = m_tabCtrlProjects.GetItemCount();
	if(numOfItemsInTab == 0)
	{
		//m_tabCtrlProjects.InsertItem(0,"Untitled");
		OnFileNew();
	}	
}
