Warning

You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.

Differences

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

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
functions [2019/05/06 10:07] – created neilsfunctions [2019/05/06 10:10] – [Return type] neils
Line 7: Line 7:
 Some functions may return miscellaneous types and you have to explicitly tell the compiler which type you require. Just like with variables, the return type of a function is denoted with a [[https://en.wikipedia.org/wiki/Sigil_(computer_programming)|sigil]]. For example, the [[ABS|ABS function]] can return an integer or a float: Some functions may return miscellaneous types and you have to explicitly tell the compiler which type you require. Just like with variables, the return type of a function is denoted with a [[https://en.wikipedia.org/wiki/Sigil_(computer_programming)|sigil]]. For example, the [[ABS|ABS function]] can return an integer or a float:
  
-  myInt = ABS(-5) +  myInt = abs(-5) 
-  myFloat = ABS%(-3.14)+  myFloat%abs%(-3.14)
  
 +Another example is [[RND|RND]] that can return three types:
 +
 +  myRandomByte!  = rnd!()
 +  myRandomInt    = rnd()
 +  myRandomFloat% = rnd%()