Visual Basic

With Visual Basic and Access increasingly popular for enhancing SCADA packages, here’s a tip on how to improve code efficiency and performance. Use the With..End With reserved word to reduce code and structure it, thus making it more maintainable, ie: {{Type SalesInformationSalesOffice As String *20OfficeAddress As String *100OfficeTelNumber As String*15End TypeType Customer AddressID As LongName […]

With Visual Basic and Access increasingly popular for enhancing SCADA packages, here’s a tip on how to improve code efficiency and performance.

Use the With..End With reserved word to reduce code and structure it, thus making it more maintainable, ie:

{{Type SalesInformationSalesOffice As String *20OfficeAddress As String *100OfficeTelNumber As String*15End TypeType Customer AddressID As LongName As String *30SalesDetails AsSalesInformationEnd TypeGlobal CustAddress() AsCustomerAddress}}

Given the two Type declarations above and the Global Declaration of CustAddress we may use With and End With to cut the amount of code used to access the values from the above arrays.

{{With CustAddress(1)

End With Boward Computer Services,Tel: 01825 713596; Fax: 713474.}}