Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
BRUS Wikipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Road data/strings/doc
(section)
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Get shortened URL
Appearance
move to sidebar
hide
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.
Anti-spam check. Do
not
fill this in!
===Basic string syntax=== The most basic value that can be used for most type table fields is a specially formatted string, which will be referred to in this documentation as a ''format string''. This is the string that will ultimately be parsed and returned by the parser. A format string is an ordinary string object. The power of these strings comes in the form of two special instructions that are recognized by the parser. The first is anything in <code>%argument%</code> form. The parser will replace such a statement with the value of the <code>argument</code> entry in the arguments table described earlier. This is what allows the route number to be spliced into a shield or link name. The second special string is in the form of <code>[arg|equals|then|else]</code>. This functions as a rudimentary if-then-else statement. The parser tests the value of <code>arg</code> to see if it is equal to the value specified in <code>equals</code>. <code>equals</code> may be empty, in which case the parser tests the existence of the <code>arg</code> argument. If the result of the test is true, the statement is replaced with the value of the <code>then</code> block. Otherwise, it is replaced with the value of the <code>else</code> block. The two statements may be combined. The parser will parse the if-then-else statement first, and then perform the argument inclusion. This combination is commonly used with bannered routes in the United States, where the <code>dab</code> argument is tested and the link disambiguation is adjusted accordingly, as follows: <syntaxhighlight lang="lua"> AL["US-Bus"] = { shield = "US %route%.svg", link = "U.S. Route %route% Business ([dab||%dab%, |]Alabama)", abbr = "US-%route% Bus.", banner = "Business plate.svg", width = "expand" } </syntaxhighlight> When parsing the <code>link</code> field, the parser first checks to see if the <code>dab</code> argument was provided. If so, it replaces the statement with <code>%dab%, </code>. If not, the statement is replaced with the empty string placed in the <code>else</code> block. Then, the parser replaces <code>%route%</code> with the route number and, if the <code>dab</code> argument was provided, <code>%dab%</code> with the value of that argument.
Summary:
Please note that all contributions to BRUS Wikipedia 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
BRUS Wikipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template