In the following statement, the constants conAge and conWage are declared as Integer. To specify a data type, you must include the data type for each constant. You can declare several constants in one statement. The following example declares the Public constant conAge as an Integer and assigns it the value Because you already know the value of a constant, you can specify the data type in a Const statement. You can explicitly declare a private constant by preceding the Const statement with the Private keyword to make it easier to read and interpret your code.įor more information, see Understanding scope and visibility. To declare a public module-level constant, precede the Const statement with the Public keyword. Module-level constants are private by default. You can declare a constant within a procedure or at the top of a modulein the Declarations section. After a constant is declared, it cannot be modified or assigned a new value. You use the Const statement to declare a constant and set its value. By declaring a constantyou can assign a meaningful name to a value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |