From ef0550c758c109e073942595eae93b741dea1e8d Mon Sep 17 00:00:00 2001 From: Lucas GAUTHERON Date: Tue, 16 Aug 2011 23:41:26 +0000 Subject: [PATCH] const/isconst documentation git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6586 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/docs.cfg | 10 ++++++ docs/reference.xml | 82 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 74 insertions(+), 18 deletions(-) diff --git a/config/docs.cfg b/config/docs.cfg index 03e402fc..7e108610 100644 --- a/config/docs.cfg +++ b/config/docs.cfg @@ -214,6 +214,10 @@ docident [checkalias] [Determines if the argument given is an existing alias or docargument [A] [the alias to check for] [] [0]; docexample [hello = ""; echo (checkalias hello)] [Output: 1]; docexample [echo (checkalias oMgThIsAlIaSpRoLlYdOeSnTeXiSt)] [Output: 0]; +docident [isconst] [Determines if the argument given is a constant or not.]; +docargument [A] [the alias to check for] [] [0]; +docexample [const hello ""; echo (isconst hello)] [Output: 1]; +docexample [hello = value; echo (isconst hello)] [Output: 0]; docident [checkinit] [Ensures the initialization of an alias.]; docargument [A] [the alias to check for] [] [0]; docargument [B] [the optional block of code to ensure that the alias contains] [] [0]; @@ -271,6 +275,12 @@ docargument [N] [the name of the alias] [string, must not contain '$'] [0]; docargument [A] [the commands] [string] [0]; docexample [alias myalias [ echo "hello world"; alias myalias [ echo "I already said hello" ] ]] [It is possible to re-bind an alias, even during its evaluation.]; docexample [test = [ echo "successful" ]] [There is also the shorthand version of defining an alias via the "="-sign.]; +docident [const] [Set an alias as a constant.]; +docargument [N] [the name of the alias] [string, must not contain '$'] [0]; +docargument [A] [the value (optional)] [string] [0]; +docexample [myalias = myvalue; const myalias;] [Set "myalias" value to "myvalue" then "lock" it as a constant.]; +docexample [const myalias myvalue;] [You can directly set a value for your alias when you define it as a constant.]; +docexample [const myalias myvalue; myalias = anothervalue;] [Assigning a value to a const will throw you an error. Output: myalias is already defined as a constant]; docident [attack] [Fires the current weapon.]; docremark [default: left mouse button]; docident [autogetmap] [Determines if the current played map should be automatically downloaded if it is not available locally.]; diff --git a/docs/reference.xml b/docs/reference.xml index e08a83d8..65aec34a 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -827,6 +827,50 @@ + + + Binds a name to commands. + + + + + + + + It is possible to re-bind an alias, even during its evaluation. + + + + There is also the shorthand version of defining an alias via the "="-sign. + + + + + + Set an alias as a constant. + + A constant cannot be redefined : its value cannot be changed. + To get rid of a constant, use delalias + + + + + + + + + Set "myalias" value to "myvalue" then "lock" it as a constant. + + + + You can directly set a value for your alias when you define it as a constant. + + + + Assigning a value to a const will throw you an error. Output: myalias is already defined as a constant + + + Determines if the argument given is an existing alias or not. @@ -848,6 +892,26 @@ + + + Determines if the argument given is a constant or not. + + + + Output: 1 + + + + Output: 0 + + + + + + + + + Ensures the initialization of an alias. @@ -1461,24 +1525,6 @@ echo foo - - Binds a name to commands. - - - - - - - - It is possible to re-bind an alias, even during its evaluation. - - - - There is also the shorthand version of defining an alias via the "="-sign. - - - - Quits the game without asking.