A
/ \ _ Play Now Nemesis on
| | | | _______ _ _ _______ _______ _ _______
| |\ | | | ____| | \ / | | ____| / ____| | | / ____|
/-------/-------------------------------------------------------------------,
O= Home <=XX| About News Pics Adventurers Wizards Download Connect >
\-------\-------------------------------------------------------------------'
| | \ | | |____ | | | | | |____ ___ \ \ | | ___ \ \
| | \_| |_______| |_| |_| |_______| |_______/ |_| |_______/
\ /
V
Documentation Area
Document Path: /doc/efun/process_string
Name: process_string - give a string with replaced calldescriptions
Synopsis:
string process_string(string combinestring)
Description:
Processes a string by replacing specific syntactic patterns with
what is returned when the pattern is interpreted as a function
call description.
The syntactic patterns are on the form:
"@@function[:object][|arg1|arg2....|argN]@@"
This is interpreted as a call:
object->function(arg1, arg2, ....., argN)
Note that process_string does not recurse over returned
replacement values. If a function returns another syntactic
pattern, that description will not be replaced.
All such occurrences in 'combinestring' is processed and replaced if
the return value is a string. If the return value is not a string
the the pattern will remain unreplaced.
Note that both object and arguments are marked optional with the
brackets and that the brackets are not included in the actual
pattern.
Caveat:
This is usually used to support 'value by function call' in the
MudLib. It is wise to set the effuserid of the object to 0 before
using process_value as any function in any object can be called
with almost any arguments.
Examples:
A string
"You are chased by @@query_name:/obj/monster#123|1@@ eastward."
is replaced by:
"You are chased by the orc eastward."
Assuming that query_name(1) in monster#123 returns "the orc".
See also:
This page was generated in LPC
Imprint / Impressum