Constant expression is required
A Const
statement doesn't properly initialize a constant, or an array declaration uses a variable to specify the number of elements.
Error ID: BC30059
To correct this error
If the declaration is a
Const
statement, check to make sure the constant is initialized with a literal, a previously declared constant, an enumeration member, or a combination of literals, constants, and enumeration members combined with operators.If the declaration specifies an array, check to see if a variable is being used to specify the number of elements. If so, replace the variable with a constant expression.
If the preceding checks don't address the issue, try setting the
Const
to a different temporary value, running the program, and then resetting theConst
to the desired value.
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for