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 8: | Line 8: | ||
mSL code can be executed right from text box or in the case of more complex scripts as {{mirc|aliases}} or as {{mirc|on events}}. {{mirc|Aliases}} are mSL's version of [[functions]] while {{mirc|on events}} are triggered events that automatically activate when the appropriate event occurs. | mSL code can be executed right from text box or in the case of more complex scripts as {{mirc|aliases}} or as {{mirc|on events}}. {{mirc|Aliases}} are mSL's version of [[functions]] while {{mirc|on events}} are triggered events that automatically activate when the appropriate event occurs. | ||
− | == Language Constructs == | + | === Language Constructs === |
{{main|mirc/conditional_statements|mirc/while_loops|mirc/operators|l1=mSL If Statements|l2=mSL Looping Statements|l3=mSL Operators}} | {{main|mirc/conditional_statements|mirc/while_loops|mirc/operators|l1=mSL If Statements|l2=mSL Looping Statements|l3=mSL Operators}} | ||
− | mSL | + | mSL inherits most of its syntax from the [[C Programming Language]] with respect to both the curly syntax as well as its general behavior. For example, like in C, constructs such as {{mirc|if statements}} evaluate to {{mirc|$true}} for anything other than <code>0</code> and <code>$false</code>. For example <code>if (1) { .. }</code>. |
− | Code is embedded among plain text and is evaluated | + | A big departure from most other languages is the fact that mSL makes no distinction between code and plain text. Code is often embedded among plain text and is evaluated as such. For example <code>One $calc(1+1) Three</code> will correctly treat the <code>One</code> as plain text, {{mirc|evaluate}} the {{mirc|$calc}} {{mirc|identifier}} into <code>2</code> and finally treat <code>Three</code> as plain text. The result will be <code>One 2 Three</code>. On the surface this may seem like it could result in many ambiguities, however in practice it works fairly fluidly with just a handful of problematic cases - many of which can be easily escaped. |
− | == Variables and text utilities == | + | === Variables and text utilities === |
{{main|mirc/variables|mirc/string_manipulation|mirc/token_manipulation|l1=mSL Variables|l2=mSL String Manipulation|l3=mSL Token Manipulation}} | {{main|mirc/variables|mirc/string_manipulation|mirc/token_manipulation|l1=mSL Variables|l2=mSL String Manipulation|l3=mSL Token Manipulation}} | ||
− | mSL offers a plethora of facilities that provide an extensive set of ways to work with text and manipulate it. {{mirc|Variables}} can be global, in which case they persist | + | mSL offers a plethora of facilities that provide an extensive set of ways to work with text and manipulate it. {{mirc|Variables}} can be global, in which case they persist for ever until manually removed, or local - which are automatically after returning from an {{mirc|on events|event}} or an {{mirc|alias|alias call}}. Variables are defined using the {{mirc|/var}} command and have no fixed data type. In fact everything is more or less treated as plain text with the exception of a handful of {{mirc|identifiers}} that operate on numbers. |
− | <source lang=mirc> | + | <source lang=mirc>var %variable this is some text, %2ndbar this is more text</source> |
− | There | + | 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 <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. | + | 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. For example, considering the <code>%varaible</code> from above, one can treat spaces as a [[delimiter]] and thus use {{mirc|$gettok}} to obtain the 3rd token using <code>$gettok(%variable, 3)</code>. |
− | == Data Storage == | + | === Data Storage === |
− | {{main | + | {{main|mirc/ini_files|mirc/hash_tables|mirc/text_files|l1=mSL INI Files|l2=mSL Hash Tables|l3=mSL Text Files}} |
− | + | {{empty section}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== History == | == History == | ||
Line 55: | Line 40: | ||
mIRC 7.0 brought about [[Unicode]] support into the language. | mIRC 7.0 brought about [[Unicode]] support into the language. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== References == | == References == | ||
{{reflist}} | {{reflist}} | ||
− | [[Category: mIRC | + | [[Category: mIRC]] |