![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Const как var. [D6]
Drowsy © (2008-09-14 22:53:00)const
ProjectsDir : string = '';
ProjectDir : string = '';
WorkBasesDir: string = '';
Интересно, в одном проекте подобные константы ведут себя как переменные, например, позволяют присваивать значения, а в другом
выдаёт ошибку. Почему?
Drowsy (2008-09-14 23:09:00) [1]О!!!!
Большое спасибо, oxffff!
oxffff (2008-09-14 22:57:00) [2]см. $J
The $J directive controls whether typed constants can be modified or not. In the {$J+} state, typed constants can be modified, and are in essence initialized variables. In the {$J-} state, typed constants are truly constant, and any attempt to modify a typed constant causes the compiler to report an error.