User Tools

Site Tools


function

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
function [2014/07/02 04:57]
l [either(value, value, ...)]
function [2017/10/10 00:39] (current)
Line 1: Line 1:
 +<- [[expression|About Expressions]] --------- [[print|Printing Variables and Functions]] ->
 +
 ===== Functions ===== ===== Functions =====
  
Line 71: Line 73:
 With your sword and hat, nothing can stop you! With your sword and hat, nothing can stop you!
 <<​endif>>​\</​code>​ <<​endif>>​\</​code>​
 +
 +**Advanced use**: if you want to display something on every third time you visit a passage (no matter if you visit it 3 times, 10 times, or 100 times), then you can use the [[expression|modulo operator]] ''​%''​ to transform the number:
 +<​code><<​if visited() % 3 is 0>>\
 +"Every 3 visits to this passage, I walk the Earth again,"​ croons Count Dracula.
 +<<​endif>>​\</​code>​
 +Feel free to modify the "​3"​ to any number you wish, to make something happen on every four visits, every ten visits, etc.
  
 ====visitedTag(string,​ string...)==== ====visitedTag(string,​ string...)====
Line 128: Line 136:
 Displays an alert box, with the given text string displayed. This is a browser built-in. It has no value - feel free to use it by simply writing <<set alert("​message"​)>>​. Displays an alert box, with the given text string displayed. This is a browser built-in. It has no value - feel free to use it by simply writing <<set alert("​message"​)>>​.
  
 +====open(string)====
 +
 +When given a URL in string form, it opens a new browser tab containing that web page. This is a browser built-in. It has no value - feel free to use it by simply writing <<set open("​url"​)>>​.
 +
 +
 +<- [[expression|About Expressions]] --------- [[print|Printing Variables and Functions]] ->
  
function.1404277021.txt.gz ยท Last modified: 2017/10/10 00:37 (external edit)