![]() ![]() ![]() ![]() | Table Of Contents | Index |
Constants are used to give values meaningful names. By using constants a value can be assigned once and the constant name used throughout the menu program. This way, if you change the value of the constant, all the places where that constant is used automatically change.
This is good programming practice.
Examples:Using the word STATES is just like using 50. Using CPU is just like using '80386 SX'. But if throughout my menu you use CPU, and then you get a new computer with a 80486, you can just change one line:Const States = 50 CPU = '80386 SX' WeekEnd = True
or
Const States = 50 CPU = '80386 SX' WeekEnd = True
Const CPU = '80486'And all the places you used CPU changes to '80486'. This is the correct way to program.
![]() ![]() ![]() ![]() | Table Of Contents | Index |
|