Difference between revisions of "$addtok"

From Scriptwiki
Jump to: navigation, search
 
m (added also see for case-sens version)
Line 13: Line 13:
 
  echo -ag %channels
 
  echo -ag %channels
 
This example will echo a list of all channels you are currently on, seperated by commas (ascii-code 44).
 
This example will echo a list of all channels you are currently on, seperated by commas (ascii-code 44).
 +
 +
== Also See ==
 +
[[$addtokcs]] Case Sensitive version
  
 
[[Category:Token Identifiers]]
 
[[Category:Token Identifiers]]

Revision as of 02:32, 5 November 2006

Adds a token to the end of text but only if it's not already in text.

$addtok(text,token,C)

The C parameter is the ascii value of the character separating the tokens.

Example

echo -ag $addtok(this is a,test,32)

This example will echo this is a test, as it adds test to the end of this is a, seperated by space (ascii-code 32).

var %i = 1
while (%i <= $chan(0)) {
  %channels = $addtok(%channels,$chan(%i),44)
  inc %i
}
echo -ag %channels

This example will echo a list of all channels you are currently on, seperated by commas (ascii-code 44).

Also See

$addtokcs Case Sensitive version