The following returns an error that a Constant expression is required. I don't understand why it doesn't work.
ThanksVB Code:
Public Const Error_Path = App.Path & "\MachineTenderPM10_error.log"
Printable View
The following returns an error that a Constant expression is required. I don't understand why it doesn't work.
ThanksVB Code:
Public Const Error_Path = App.Path & "\MachineTenderPM10_error.log"
The point of a constant is that the value is declared at "compile time" - not at run time.
APP.PATH is only available at RUN TIME.
You cannot have a constant with APP.PATH. It needs to be a variable...
Yeah he's write. The reason why that is an error is because that data within your constant has a possibility of changing while your program is running, whether or not it is IDE mode or EXE. Numerical values and strings on the other hand are perfectly legal. The thing you cannot have as values in constants is variables and functions (like App.Path), since again there is a possibility that variable's/function's value can change while the program is running.