From WikiChip
Editing mirc/token manipulation
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 6: | Line 6: | ||
To better understand this concept; let's consider a simple alias that returns the day of the week from a given Nth day. In this case, our list of tokens will look something like this: | To better understand this concept; let's consider a simple alias that returns the day of the week from a given Nth day. In this case, our list of tokens will look something like this: | ||
− | <pre>Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday</pre> | + | <pre>Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday</pre> |
The first thing you can see is that we have the tokens (in this case, the days of the week) separated by a comma. In this example, the comma is called a delimiter. In mSL, a '''delimiter''' is a single character used to specify the boundary between two separate tokens in a list. The example above also has a special name: '''comma-separated values''' ('''CSV'''). | The first thing you can see is that we have the tokens (in this case, the days of the week) separated by a comma. In this example, the comma is called a delimiter. In mSL, a '''delimiter''' is a single character used to specify the boundary between two separate tokens in a list. The example above also has a special name: '''comma-separated values''' ('''CSV'''). | ||
Line 21: | Line 21: | ||
halt | halt | ||
} | } | ||
− | var %days = Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday | + | var %days = Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday |
return $gettok(%days, $1, 44) | return $gettok(%days, $1, 44) | ||
}</syntaxhighlight> | }</syntaxhighlight> |