From WikiChip
Editing mirc

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 20: Line 20:
 
<source lang=mirc>/var %variable = this is some text value, %2ndbar this is more text value</source>
 
<source lang=mirc>/var %variable = this is some text value, %2ndbar this is more text value</source>
  
There are a large number of {{mirc|string manipulation|identifiers that can operate on strings}} - anything from {{mirc|$len|determining the length}}, to obtaining a portion of the string from the beginning or end to case transformation and pattern matching. For example, the simple {{mirc|$left}} identifier can be used to obtain a portion from the left side of the string - e.g., <code>$left(Hello!!, 4)</code> will yield result <code>Hell</code>.
+
There is a large number of {{mirc|string manipulation|identifiers that can operate on strings}} - anything from {{mirc|$len|determining the size}}, to obtaining a portion of the string from the beginning or end to case transformation and pattern matching. For example, the simple {{mirc|$left}} identifier can be used to obtain a portion from the left side of the string - e.g., <code>$left(Hello!!, 4)</code> will yield result <code>Hell</code>.
  
 
In addition to be treated as plain text, values can also be treated as a list of tokens and operated on using the various {{mirc|token manipulation}} identifiers. One can treat spaces as a [[delimiter]] and thus have a list and use {{mirc|$gettok}} to obtain the 3rd word using <code>$gettok(hello world IMAGiNE, 3, 32)</code>.  This is 3rd word separated by a space (32) opposed to a comma (44), hyphen (45), period (46), or in the case of filenames backslash (92).  And can be any character you choose to separate your list of words with. Space is mapped to character number 32 since you cannot put a space in to code and expect mSL to find something there to evaluate; you must use the number 32 (its character map).
 
In addition to be treated as plain text, values can also be treated as a list of tokens and operated on using the various {{mirc|token manipulation}} identifiers. One can treat spaces as a [[delimiter]] and thus have a list and use {{mirc|$gettok}} to obtain the 3rd word using <code>$gettok(hello world IMAGiNE, 3, 32)</code>.  This is 3rd word separated by a space (32) opposed to a comma (44), hyphen (45), period (46), or in the case of filenames backslash (92).  And can be any character you choose to separate your list of words with. Space is mapped to character number 32 since you cannot put a space in to code and expect mSL to find something there to evaluate; you must use the number 32 (its character map).

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)