I am trying to save a timestamp in a constant at the beginning of the program that will be used throughout the program. For example:
Const TIME_STAMP = Format(Now(), "hhmm")
However, this code generates a compiler error - "Constant expression required." Does this mean that all constants in VB.NET should contain flat, static, hard-coded data? I know that you can initialize a constant with a dynamic value in other languages (for example, Java) - what makes it a constant is that after the initial assignment you can no longer change it. Is there an equivalent in VB.NET?
source
share