Изменения

Материал из Chaotic Onyx
Перейти к навигацииПерейти к поиску
м
→‎О порядке написания кода: последняя правка. Хорошо бы какой-нибудь кодер проверил и упорядочил главы и содержание. Я не кодер.
Строка 239: Строка 239:     
client/Topic(T)
 
client/Topic(T)
  if(T == "вступление")
+
if(T == "вступление")
      usr << "И вот как-то раз..."
+
usr << "И вот как-то раз..."
  else ..()
+
else ..()
    
client/Topic(T)
 
client/Topic(T)
  if(T == "подсказка")
+
if(T == "подсказка")
      usr << "Буквально позавчера."
+
usr << "Буквально позавчера."
  else ..()
+
else ..()
 
В таком написании, эти два определения процедуры client/Topic(T) могут быть размещены в коде в любом месте. Если один из них будет выполнен и приведёт к значению ..() ,то другой уже не наступит. Вот в таких случаях и бывает полезно обращаться к процедуре-родителю
 
В таком написании, эти два определения процедуры client/Topic(T) могут быть размещены в коде в любом месте. Если один из них будет выполнен и приведёт к значению ..() ,то другой уже не наступит. Вот в таких случаях и бывает полезно обращаться к процедуре-родителю
 
<!--As written, these two definitions of the Topic procedure can fall in any order with any amount of intervening code. If one of them neglected to call ..(), however, it would disable any previous versions of the procedure. It is therefore good practice to always call the parent procedure unless you specifically wish to disable it. Then you don't have to worry about maintaining any special order of the procedures.-->
 
<!--As written, these two definitions of the Topic procedure can fall in any order with any amount of intervening code. If one of them neglected to call ..(), however, it would disable any previous versions of the procedure. It is therefore good practice to always call the parent procedure unless you specifically wish to disable it. Then you don't have to worry about maintaining any special order of the procedures.-->
      
===Отладка кода===
 
===Отладка кода===
470

правок

Навигация