Module

Modified on Wed, 17 May 2023 at 12:50 PM

You can also write your own Visual Basic .NET code in a module. A module is a set of Visual Basic .NET code that contains functions to be used from any expression within the repository. This allows you to provide additional functionality to expressions.

The following module, for instance, provides to functions; one that returns the current year and month and one that returns the current year, month, and day:

Function GetYearMonth()
Return Date.Now.Year.ToString("0000") & Date.Now.Month.ToString("00") 
End Function


Function GetYearMonthDay() 

Return Date.Now.ToString("yyyyMMdd") 

End Function

Any of these functions can be called by using the following syntax in an expression:

GetYearMonth()

Functions contained in modules may also contain parameters.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article