Ver Fonte

Docs update.
Extra examples.
Added section on enums.

woollybah há 6 anos atrás
pai
commit
14bc71d23f

+ 46 - 4
docs/api/brl/brl.bank/tbank.md

@@ -198,7 +198,7 @@ End
 
 Poke a byte into a bank
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -211,13 +211,24 @@ For Local t:Int = 0 Until BankSize(myBank)
 	Print PeekByte(myBank,t)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Local myBank:TBank=CreateBank(16)
+
+PokeByte myBank,0,$11
+PokeShort myBank,1,$1122 ' new address = 0+1=[1]
+PokeInt myBank,3,$11223344 ' new address = [1]+2=(3)
+PokeLong myBank,7,$1122334455667788 ' new address = (3)+4=7
+```
 <br/>
 
 ### `Method PokeByte( offset:Size_T,value:Int )`
 
 Poke a byte into a bank
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -230,6 +241,17 @@ For Local t:Int = 0 Until BankSize(myBank)
 	Print PeekByte(myBank,t)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Local myBank:TBank=CreateBank(16)
+
+PokeByte myBank,0,$11
+PokeShort myBank,1,$1122 ' new address = 0+1=[1]
+PokeInt myBank,3,$11223344 ' new address = [1]+2=(3)
+PokeLong myBank,7,$1122334455667788 ' new address = (3)+4=7
+```
 <br/>
 
 ### `Method PeekShort:Int( offset:Int )`
@@ -382,7 +404,7 @@ Print PeekInt(myBank,12)
 
 Poke an int into a bank
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -395,13 +417,23 @@ For Local t:Int = 0 Until BankSize(myBank)
 	Print PeekByte(myBank,t)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Local myBank:TBank=CreateBank(16)
+
+For Local t:Int = 0 Until 4
+	PokeInt MyBank,t*4,Int(Rnd($12345678))
+Next
+```
 <br/>
 
 ### `Method PokeInt( offset:Size_T,value:Int )`
 
 Poke an int into a bank
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -414,6 +446,16 @@ For Local t:Int = 0 Until BankSize(myBank)
 	Print PeekByte(myBank,t)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Local myBank:TBank=CreateBank(16)
+
+For Local t:Int = 0 Until 4
+	PokeInt MyBank,t*4,Int(Rnd($12345678))
+Next
+```
 <br/>
 
 ### `Method PeekLong:Long( offset:Int )`

+ 17 - 0
docs/api/brl/brl.blitz/idisposable.md

@@ -0,0 +1,17 @@
+---
+id: idisposable
+title: IDisposable
+sidebar_label: IDisposable
+---
+
+Provides a mechanism for releasing resources.
+
+
+## Methods
+
+### `Method Dispose()`
+
+Performs application-defined tasks associated with freeing, releasing, or resetting resources.
+
+<br/>
+

+ 1 - 1
docs/api/brl/brl.event/tevent.md

@@ -64,7 +64,7 @@ the hook data.
 
 <br/>
 
-### `Method ToString$()`
+### `Method ToString$() Override`
 
 Convert event to a string
 

+ 6 - 0
docs/api/brl/brl.linkedlist/tlist.md

@@ -193,6 +193,12 @@ convert a list to an array
 An array of objects
 
 
+<br/>
+
+### `Method RemoveLink( link:TLink )`
+
+Remove an object from a linked list.
+
 <br/>
 
 ## Functions

+ 19 - 1
docs/api/brl/brl.pixmap/tpixmaploader.md

@@ -22,7 +22,7 @@ Load a pixmap
 This method must be implemented by extending types.
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -39,5 +39,23 @@ Repeat
 	Flip
 Until KeyHit(key_escape) Or AppTerminate()
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Graphics 640 , 480
+
+Local pix:TPixmap=LoadPixmap(blitzmaxpath()+"\samples\hitoro\gfx\boing.png")
+'converts Pixmap to Image
+'note alpha transparency
+Local image:TImage=LoadImage(pix)
+
+Repeat
+	Cls
+	DrawPixmap pix, 50, 50
+	DrawImage image, MouseX(), MouseY()
+	Flip
+Until KeyHit(key_escape) Or AppTerminate()
+```
 <br/>
 

+ 252 - 0
docs/api/brl/brl.random/trandom.md

@@ -0,0 +1,252 @@
+---
+id: trandom
+title: TRandom
+sidebar_label: TRandom
+---
+
+Random number generator
+
+
+
+By creating multiple TRandom objects, multiple independent
+random number generators can be used in parallel.
+
+
+## Constructors
+
+### `Method New()`
+
+Create a new random number generator
+
+<br/>
+
+### `Method New(seed:Int)`
+
+Create a new random number generator with the specified seed
+
+<br/>
+
+## Methods
+
+### `Method RndFloat:Float()`
+
+Generate random float
+
+#### Returns
+A random float in the range 0 (inclusive) to 1 (exclusive)
+
+
+#### Example
+```blitzmax
+' RndFloat.bmx
+' Two players take turns shooting at a target. The first hit wins.
+' Player 1 hits 30% of the time, player 2 hits 40%.
+' What is the probability that player 1 wins?
+
+SuperStrict
+
+Function winner:Int()   ' play game once, return winner 1 or 2
+    Repeat
+        If RndFloat() < 0.3 Then Return 1
+        If RndFloat() < 0.4 Then Return 2
+    Forever
+End Function
+
+Local count:Int[3]
+
+Local trials:Int = 1000000
+
+For Local n:Int = 1 To trials
+    count[ winner() ] :+ 1
+Next
+
+Print "Estimated probability = " + ( Float( count[1] ) / Float( trials ) )
+Print
+Print "    Exact probability = " + ( 15.0 / 29.0 )
+```
+<br/>
+
+### `Method RndDouble:Double()`
+
+Generate random double
+
+#### Returns
+A random double in the range 0 (inclusive) to 1 (exclusive)
+
+
+#### Example
+```blitzmax
+' RndDouble.bmx
+' Two players take turns shooting at a target. The first hit wins.
+' Player 1 hits 30% of the time, player 2 hits 40%.
+' What is the probability that player 1 wins?
+
+SuperStrict
+
+Function winner:Int()   ' play game once, return winner 1 or 2
+    Repeat
+        If RndDouble() < 0.3 Then Return 1
+        If RndDouble() < 0.4 Then Return 2
+    Forever
+End Function
+
+Local count:Int[3]
+
+Local trials:Int = 1000000
+
+For Local n:Int = 1 To trials
+    count[ winner() ] :+ 1
+Next
+
+Print "Estimated probability = " + ( Double( count[1] ) / Double( trials ) )
+Print
+Print "    Exact probability = " + ( 15.0 / 29.0 )
+```
+<br/>
+
+### `Method Rnd:Double(minValue:Double = 1, maxValue:Double = 0)`
+
+Generate random double
+
+
+The optional parameters allow you to use Rnd in 3 ways:
+
+<table><tr><td> <b>Format</b></td><td><b>Result</b></td></tr><tr><td>  &Rnd()</td><td>Random double in the range 0 (inclusive) to 1 (exclusive)</td></tr><tr><td>  &Rnd(_x_)</td><td>Random double in the range 0 (inclusive) to n (exclusive)</td></tr><tr><td>  &Rnd(_x,y_)</td><td>Random double in the range x (inclusive) to y (exclusive)</table>
+
+
+
+#### Returns
+A random double in the range min (inclusive) to max (exclusive)
+
+
+#### Example
+```blitzmax
+' Rnd.bmx
+' Use Rnd() to estimate area inside the unit circle x^2 + y^2 = 1.
+
+SuperStrict
+
+Local totalpoints:Int = 1000000
+Local inpoints:Int
+
+For Local n:Int = 1 To totalpoints
+    Local x:Double = Rnd( -1.0, 1.0 )               ' Generate random point in 2 by 2 square.
+    Local y:Double = Rnd( -1.0, 1.0 )
+
+    If x*x + y*y < 1.0 Then inpoints :+ 1     ' point is inside the circle
+Next
+
+' Note: Ratio of areas circle/square is exactly Pi/4.
+
+Print "Estimated area = " + ( 4.0 * Double(inpoints)/Double(totalpoints) )
+Print
+Print "    Exact area = " + Pi     '  4 * Pi/4, compare with estimate
+```
+<br/>
+
+### `Method Rand:Int(minValue:Int, maxValue:Int = 1)`
+
+Generate random integer
+
+
+The optional parameter allows you to use [Rand](../../../brl/brl.random/trandom/#method-rand-intminvalue-int-maxvalue-int-1) in 2 ways:
+
+<table><tr><td> <b>Format</b></td><td><b>Result</b></td></tr><tr><td>  &Rand(x)</td><td>Random integer in the range 1 to x (inclusive)</td></tr><tr><td>  &Rand(x,y)</td><td>Random integer in the range x to y (inclusive)</table>
+
+
+
+#### Returns
+A random integer in the range min (inclusive) to max (inclusive)
+
+
+#### Example
+```blitzmax
+' Rand.bmx
+' Toss a pair of dice. Result is in the range 1+1 to 6+6.
+' Count how many times each result appears.
+
+SuperStrict
+
+Local count:Int[13]
+
+For Local n:Int = 1 To 3600
+    Local toss:Int = Rand(1,6) + Rand(1,6)
+    count[toss] :+ 1
+Next
+
+For Local toss:Int = 2 To 12
+    Print LSet(toss, 5)+count[toss]
+Next
+```
+<br/>
+
+### `Method SeedRnd(seed:Int)`
+
+Set random number generator seed
+
+#### Example
+```blitzmax
+' RndSeed.bmx and SeedRnd.bmx ( one example for both )
+' Get/Set random number seed.
+
+SuperStrict
+
+SeedRnd MilliSecs()
+
+Local seed:Int = RndSeed()
+
+Print "Initial seed="+seed
+
+For Local k:Int = 1 To 10
+Print Rand(10)
+Next
+
+Print "Restoring seed"
+
+SeedRnd seed
+
+For Local k:Int = 1 To 10
+Print Rand(10)
+Next
+```
+<br/>
+
+### `Method RndSeed:Int()`
+
+Get random number generator seed
+
+Used in conjunction with SeedRnd, RndSeed allows you to reproduce sequences of random
+numbers.
+
+
+#### Returns
+The current random number generator seed
+
+
+#### Example
+```blitzmax
+' RndSeed.bmx and SeedRnd.bmx ( one example for both )
+' Get/Set random number seed.
+
+SuperStrict
+
+SeedRnd MilliSecs()
+
+local seed:int = RndSeed()
+
+Print "Initial seed="+seed
+
+For local k:int = 1 To 10
+	Print Rand(10)
+Next
+
+Print "Restoring seed"
+
+SeedRnd seed
+
+For local k:int = 1 To 10
+	Print Rand(10)
+Next
+```
+<br/>
+

+ 2 - 2
docs/api/brl/brl.stringbuilder/tstringbuilder.md

@@ -91,7 +91,7 @@ Appends a Long value to the string builder.
 
 Appends the new line string to the string builder.
 
-The new line string can be altered using [SetNewLineText](../../../brl/brl.stringbuilder/tstringbuilder/#method-setnewlinetext-tstringbuilder-newline-string). This might be used to force the output to always use Unix line endings even when on Windows.
+The new line string can be altered using [SetNewLineText](../../../brl/brl.stringbuilder/tstringbuilder/#method-setnewlinetext-tstringbuildernewline-string). This might be used to force the output to always use Unix line endings even when on Windows.
 
 
 <br/>
@@ -302,7 +302,7 @@ will return everything from <b>beginIndex</b> until the end of the string builde
 
 <br/>
 
-### `Method ToString:String()`
+### `Method ToString:String() Override`
 
 Converts the string builder to a String.
 

+ 1 - 1
docs/api/brl/brl.threadpool/tthreadpoolexecutor.md

@@ -9,7 +9,7 @@ An executor that executes each submitted task using one of possibly several pool
 
 ## Methods
 
-### `Method execute(command:TRunnable)`
+### `Method execute(command:TRunnable) Override`
 
 Executes the given command at some time in the future.
 

+ 43 - 0
docs/api/brl/brl.xml/txmlnode.md

@@ -457,6 +457,49 @@ End If
 ```
 <br/>
 
+### `Method getContent:String()`
+
+Reads the value of a node.
+
+#### Returns
+The node content.
+
+
+<br/>
+
+### `Method findElement:TxmlNode(element:String = "", attr:String = "", value:String = "")`
+
+Finds an element of the given <b>element</b> name, attribute or attribute/value.
+
+#### Returns
+A node or Null if no match was found.
+
+
+#### Example
+```blitzmax
+SuperStrict
+
+Framework brl.xml
+Import brl.standardio
+
+Local docname:String = "sample.xml"
+Local doc:TxmlDoc
+
+doc = TxmlDoc.parseFile(docname)
+If doc Then
+
+	Local root:TxmlNode = doc.getRootElement()
+	
+	Local node:TxmlNode = root.findElement("author")
+	
+	If node Then
+		Print node.ToString()
+	End If
+
+End If
+```
+<br/>
+
 ### `Method Free()`
 
 Frees a node and all of its children.

+ 46 - 4
docs/api/brl/brl_bank.md

@@ -334,7 +334,7 @@ End
 
 Poke a byte into a bank
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -347,13 +347,24 @@ For Local t:Int = 0 Until BankSize(myBank)
 	Print PeekByte(myBank,t)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Local myBank:TBank=CreateBank(16)
+
+PokeByte myBank,0,$11
+PokeShort myBank,1,$1122 ' new address = 0+1=[1]
+PokeInt myBank,3,$11223344 ' new address = [1]+2=(3)
+PokeLong myBank,7,$1122334455667788 ' new address = (3)+4=7
+```
 <br/>
 
 ### `Function PokeByte( bank:TBank,offset:Size_T,value:Int )`
 
 Poke a byte into a bank
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -366,6 +377,17 @@ For Local t:Int = 0 Until BankSize(myBank)
 	Print PeekByte(myBank,t)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Local myBank:TBank=CreateBank(16)
+
+PokeByte myBank,0,$11
+PokeShort myBank,1,$1122 ' new address = 0+1=[1]
+PokeInt myBank,3,$11223344 ' new address = [1]+2=(3)
+PokeLong myBank,7,$1122334455667788 ' new address = (3)+4=7
+```
 <br/>
 
 ### `Function PeekShort:Int( bank:TBank,offset:Int )`
@@ -560,7 +582,7 @@ Take notice not to exceed the boundaries of the bank.
 > An int value should not be poked at the last possible byte or short address of the bank.
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -573,6 +595,16 @@ For Local t:Int = 0 Until BankSize(myBank)
 	Print PeekByte(myBank,t)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Local myBank:TBank=CreateBank(16)
+
+For Local t:Int = 0 Until 4
+	PokeInt MyBank,t*4,Int(Rnd($12345678))
+Next
+```
 <br/>
 
 ### `Function PokeInt( bank:TBank,offset:Size_T,value:Int )`
@@ -585,7 +617,7 @@ Take notice not to exceed the boundaries of the bank.
 > An int value should not be poked at the last possible byte or short address of the bank.
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -598,6 +630,16 @@ For Local t:Int = 0 Until BankSize(myBank)
 	Print PeekByte(myBank,t)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Local myBank:TBank=CreateBank(16)
+
+For Local t:Int = 0 Until 4
+	PokeInt MyBank,t*4,Int(Rnd($12345678))
+Next
+```
 <br/>
 
 ### `Function PeekLong:Long( bank:TBank,offset:Int )`

+ 534 - 84
docs/api/brl/brl_blitz.md

@@ -21,8 +21,472 @@ Much of the functionality provided by this module is hidden from application pro
 | [TOutOfDataException](../../brl/brl.blitz/toutofdataexception) | Out of data exception |
 | [TRuntimeException](../../brl/brl.blitz/truntimeexception) | Runtime exception |
 
+## Interfaces
+| Interface | Description |
+|---|---|
+| [IDisposable](../../brl/brl.blitz/idisposable) | Provides a mechanism for releasing resources. |
+
 ## Functions
 
+### `Function Max:Int(a:Int, b:Int)`
+
+Returns the larger of the two [Int](../../brl/brl.blitz/#int) arguments.
+
+#### Example
+```blitzmax
+Rem
+Max
+Max evaluates to the value of the largest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Max(10,20)	'20
+Print Max(20,10)	'20
+```
+<br/>
+
+### `Function Max:Long(a:Long, b:Long)`
+
+Returns the larger of the two [Long](../../brl/brl.blitz/#long) arguments.
+
+#### Example
+```blitzmax
+Rem
+Max
+Max evaluates to the value of the largest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Max(10,20)	'20
+Print Max(20,10)	'20
+```
+<br/>
+
+### `Function Max:Float(a:Float, b:Float)`
+
+Returns the larger of the two [Float](../../brl/brl.blitz/#float) arguments.
+
+#### Example
+```blitzmax
+Rem
+Max
+Max evaluates to the value of the largest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Max(10,20)	'20
+Print Max(20,10)	'20
+```
+<br/>
+
+### `Function Max:Double(a:Double, b:Double)`
+
+Returns the larger of the two [Double](../../brl/brl.blitz/#double) arguments.
+
+#### Example
+```blitzmax
+Rem
+Max
+Max evaluates to the value of the largest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Max(10,20)	'20
+Print Max(20,10)	'20
+```
+<br/>
+
+### `Function Max:Byte(a:Byte, b:Byte)`
+
+Returns the larger of the two [Byte](../../brl/brl.blitz/#byte) arguments.
+
+#### Example
+```blitzmax
+Rem
+Max
+Max evaluates to the value of the largest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Max(10,20)	'20
+Print Max(20,10)	'20
+```
+<br/>
+
+### `Function Max:Short(a:Short, b:Short)`
+
+Returns the larger of the two [Short](../../brl/brl.blitz/#short) arguments.
+
+#### Example
+```blitzmax
+Rem
+Max
+Max evaluates to the value of the largest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Max(10,20)	'20
+Print Max(20,10)	'20
+```
+<br/>
+
+### `Function Max:UInt(a:UInt, b:UInt)`
+
+Returns the larger of the two [UInt](../../brl/brl.blitz/#uint) arguments.
+
+#### Example
+```blitzmax
+Rem
+Max
+Max evaluates to the value of the largest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Max(10,20)	'20
+Print Max(20,10)	'20
+```
+<br/>
+
+### `Function Max:ULong(a:ULong, b:ULong)`
+
+Returns the larger of the two [ULong](../../brl/brl.blitz/#ulong) arguments.
+
+#### Example
+```blitzmax
+Rem
+Max
+Max evaluates to the value of the largest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Max(10,20)	'20
+Print Max(20,10)	'20
+```
+<br/>
+
+### `Function Max:Size_T(a:Size_T, b:Size_T)`
+
+Returns the larger of the two [Size_T](../../brl/brl.blitz/#size-t) arguments.
+
+#### Example
+```blitzmax
+Rem
+Max
+Max evaluates to the value of the largest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Max(10,20)	'20
+Print Max(20,10)	'20
+```
+<br/>
+
+### `Function Min:Int(a:Int, b:Int)`
+
+Returns the lesser of the two [Int](../../brl/brl.blitz/#int) arguments.
+
+#### Example
+```blitzmax
+Rem
+Min evaluates to the value of the smallest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Min(10,20)	'10
+Print Min(20,10)	'10
+```
+<br/>
+
+### `Function Min:Long(a:Long, b:Long)`
+
+Returns the lesser of the two [Long](../../brl/brl.blitz/#long) arguments.
+
+#### Example
+```blitzmax
+Rem
+Min evaluates to the value of the smallest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Min(10,20)	'10
+Print Min(20,10)	'10
+```
+<br/>
+
+### `Function Min:Float(a:Float, b:Float)`
+
+Returns the lesser of the two [Float](../../brl/brl.blitz/#float) arguments.
+
+#### Example
+```blitzmax
+Rem
+Min evaluates to the value of the smallest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Min(10,20)	'10
+Print Min(20,10)	'10
+```
+<br/>
+
+### `Function Min:Double(a:Double, b:Double)`
+
+Returns the lesser of the two [Double](../../brl/brl.blitz/#double) arguments.
+
+#### Example
+```blitzmax
+Rem
+Min evaluates to the value of the smallest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Min(10,20)	'10
+Print Min(20,10)	'10
+```
+<br/>
+
+### `Function Min:Byte(a:Byte, b:Byte)`
+
+Returns the lesser of the two [Byte](../../brl/brl.blitz/#byte) arguments.
+
+#### Example
+```blitzmax
+Rem
+Min evaluates to the value of the smallest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Min(10,20)	'10
+Print Min(20,10)	'10
+```
+<br/>
+
+### `Function Min:Short(a:Short, b:Short)`
+
+Returns the lesser of the two [Short](../../brl/brl.blitz/#short) arguments.
+
+#### Example
+```blitzmax
+Rem
+Min evaluates to the value of the smallest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Min(10,20)	'10
+Print Min(20,10)	'10
+```
+<br/>
+
+### `Function Min:UInt(a:UInt, b:UInt)`
+
+Returns the lesser of the two [UInt](../../brl/brl.blitz/#uint) arguments.
+
+#### Example
+```blitzmax
+Rem
+Min evaluates to the value of the smallest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Min(10,20)	'10
+Print Min(20,10)	'10
+```
+<br/>
+
+### `Function Min:ULong(a:ULong, b:ULong)`
+
+Returns the lesser of the two [ULong](../../brl/brl.blitz/#ulong) arguments.
+
+#### Example
+```blitzmax
+Rem
+Min evaluates to the value of the smallest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Min(10,20)	'10
+Print Min(20,10)	'10
+```
+<br/>
+
+### `Function Min:Size_T(a:Size_T, b:Size_T)`
+
+Returns the lesser of the two [Size_T](../../brl/brl.blitz/#size-t) arguments.
+
+#### Example
+```blitzmax
+Rem
+Min evaluates to the value of the smallest of the two operators.
+End Rem
+
+SuperStrict
+
+Print Min(10,20)	'10
+Print Min(20,10)	'10
+```
+<br/>
+
+### `Function Abs:Int(a:Int)`
+
+Returns the absolute value of the [Int](../../brl/brl.blitz/#int) argument.
+
+#### Example
+```blitzmax
+Rem
+Abs is a mathematical operator that performs the Absolute function.
+End Rem
+
+SuperStrict
+
+For Local f:Float = -1 To 1 Step 0.125
+	Print "Abs "+f+"="+Abs f
+Next
+```
+<br/>
+
+### `Function Abs:Float(a:Float)`
+
+Returns the absolute value of the [Float](../../brl/brl.blitz/#float) argument.
+
+#### Example
+```blitzmax
+Rem
+Abs is a mathematical operator that performs the Absolute function.
+End Rem
+
+SuperStrict
+
+For Local f:Float = -1 To 1 Step 0.125
+	Print "Abs "+f+"="+Abs f
+Next
+```
+<br/>
+
+### `Function Abs:Double(a:Double)`
+
+Returns the absolute value of the [Double](../../brl/brl.blitz/#double) argument.
+
+#### Example
+```blitzmax
+Rem
+Abs is a mathematical operator that performs the Absolute function.
+End Rem
+
+SuperStrict
+
+For Local f:Float = -1 To 1 Step 0.125
+	Print "Abs "+f+"="+Abs f
+Next
+```
+<br/>
+
+### `Function Abs:Long(a:Long)`
+
+Returns the absolute value of the [Long](../../brl/brl.blitz/#long) argument.
+
+#### Example
+```blitzmax
+Rem
+Abs is a mathematical operator that performs the Absolute function.
+End Rem
+
+SuperStrict
+
+For Local f:Float = -1 To 1 Step 0.125
+	Print "Abs "+f+"="+Abs f
+Next
+```
+<br/>
+
+### `Function Sgn:Int(a:Int)`
+
+Returns the sign of the [Int](../../brl/brl.blitz/#int) argument.
+
+#### Example
+```blitzmax
+Rem
+Sgn is a mathematical operator that returns the sign of a value.
+End Rem
+
+SuperStrict
+
+Print Sgn 50	'1
+Print Sgn 0		'0
+Print Sgn -50	'-1
+```
+<br/>
+
+### `Function Sgn:Float(a:Float)`
+
+Returns the sign of the [Float](../../brl/brl.blitz/#float) argument.
+
+#### Example
+```blitzmax
+Rem
+Sgn is a mathematical operator that returns the sign of a value.
+End Rem
+
+SuperStrict
+
+Print Sgn 50	'1
+Print Sgn 0		'0
+Print Sgn -50	'-1
+```
+<br/>
+
+### `Function Sgn:Double(a:Double)`
+
+Returns the sign of the [Double](../../brl/brl.blitz/#double) argument.
+
+#### Example
+```blitzmax
+Rem
+Sgn is a mathematical operator that returns the sign of a value.
+End Rem
+
+SuperStrict
+
+Print Sgn 50	'1
+Print Sgn 0		'0
+Print Sgn -50	'-1
+```
+<br/>
+
+### `Function Sgn:Long(a:Long)`
+
+Returns the sign of the [Long](../../brl/brl.blitz/#long) argument.
+
+#### Example
+```blitzmax
+Rem
+Sgn is a mathematical operator that returns the sign of a value.
+End Rem
+
+SuperStrict
+
+Print Sgn 50	'1
+Print Sgn 0		'0
+Print Sgn -50	'-1
+```
+<br/>
+
 ### `Function RuntimeError( message$ )`
 
 Generate a runtime error
@@ -280,7 +744,7 @@ See [GCSuspend](../../brl/brl.blitz/#function-gcsuspend) for more details.
 
 <br/>
 
-### `Function GCCollect:Int()`
+### `Function GCCollect:Size_T()`
 
 Run garbage collector
 
@@ -310,7 +774,7 @@ Returns 0 if there is no more to collect.
 
 <br/>
 
-### `Function GCMemAlloced:Int()`
+### `Function GCMemAlloced:Size_T()`
 
 Memory allocated by application
 
@@ -335,6 +799,44 @@ Private: do not use
 
 Private: do not use
 
+<br/>
+
+### `Function GCRetain(obj:Object)`
+
+Retains a reference to the specified [Object](../../brl/brl.blitz/#object), preventing it from being collected.
+
+<br/>
+
+### `Function GCRelease(obj:Byte Ptr)`
+
+Releases a reference from the specified [Object](../../brl/brl.blitz/#object).
+
+<br/>
+
+### `Function GCThreadIsRegistered:Int()`
+
+Returns [True](../../brl/brl.blitz/#true) if the current thread is registered with the garbage collector.
+
+<br/>
+
+### `Function GCRegisterMyThread:Int()`
+
+Registers the current thread with the garbage collector.
+
+#### Returns
+0 on success, 1 if the thread was already registered, or -1 if threads are not supported.
+
+
+<br/>
+
+### `Function GCUnregisterMyThread:Int()`
+
+Unregisters the previously registered current thread.
+
+Note, that any memory allocated by the garbage collector from the current thread will no longer be
+accessible after the thread is unregistered.
+
+
 <br/>
 
 ### `Function HandleFromObject:Size_T( obj:Object )`
@@ -378,6 +880,9 @@ The [AppDir](../../brl/brl.blitz/#global-appdir-bbappdir) global variable contai
 executing application. An application's initial current directory is also set to [AppDir](../../brl/brl.blitz/#global-appdir-bbappdir)
 when an application starts.
 
+In a compiled DLL, the [AppDir](../../brl/brl.blitz/#global-appdir-bbappdir) global variable will instead contain the fully qualified
+directory of the DLL.
+
 
 #### Example
 ```blitzmax
@@ -401,6 +906,9 @@ Application file name
 The [AppFile](../../brl/brl.blitz/#global-appfile-bbappfile) global variable contains the fully qualified file name of the currently
 executing application.
 
+In a compiled DLL, the [AppFile](../../brl/brl.blitz/#global-appfile-bbappfile) global variable will instead contain the fully qualified
+file name of the DLL.
+
 
 #### Example
 ```blitzmax
@@ -1746,6 +2254,18 @@ End a user defined structure declaration
 
 <br/>
 
+### `Enum`
+
+Begin an enumeration declaration
+
+<br/>
+
+### `EndEnum`
+
+End an enumeration declaration
+
+<br/>
+
 ### `Extends`
 
 Specify supertype(s) of a user defined type
@@ -1924,6 +2444,15 @@ Denote a field as read only, where the value may only be set in its declaration
 
 Denote a function for export to a shared library. The generated function name will not be mangled.
 
+<br/>
+
+### `Override`
+
+Indicates that a method declaration is intended to override a method declaration in a supertype.
+
+Use of [Override](../../brl/brl.blitz/#override) on a method that does not override a method will result in a compilation error.
+
+
 <br/>
 
 ### `Where`
@@ -2092,7 +2621,7 @@ Print GCMemAlloced()
 
 ### `Public`
 
-Make a type, constant, global variable or function accessible from outside the current source file (default)
+Make types, constants, global variables, functions or type members accessible from outside the current source file (default)
 
 #### Example
 ```blitzmax
@@ -2114,7 +2643,7 @@ Global posx:Int,posy:Int,posz:Int
 
 ### `Private`
 
-Make a type, constant, global variable or function only accessible from within the current source file, or make a type member only accessible from within that type.
+Make types, constants, global variables, functions or type members only accessible from within the current source file.
 
 #### Example
 ```blitzmax
@@ -2137,7 +2666,7 @@ Global posx:Int,posy:Int,posz:Int
 
 ### `Protected`
 
-Make a type member accessible only from within that type and from its subtypes.
+Make type members only accessible from within the current source file and within subtypes.
 
 #### Example
 ```blitzmax
@@ -2672,24 +3201,6 @@ Print Len b		'prints 20
 ```
 <br/>
 
-### `Abs`
-
-Numeric 'absolute value' unary operator
-
-#### Example
-```blitzmax
-Rem
-Abs is a mathematical operator that performs the Absolute function.
-End Rem
-
-SuperStrict
-
-For Local f:Float = -1 To 1 Step 0.125
-	Print "Abs "+f+"="+Abs f
-Next
-```
-<br/>
-
 ### `Mod`
 
 Numeric 'modulus' or 'remainder' binary operator
@@ -2708,67 +3219,6 @@ Next
 ```
 <br/>
 
-### `Sgn`
-
-Numeric 'sign' unary operator
-
-#### Example
-```blitzmax
-Rem
-Sgn is a mathematical operator that returns the sign of a value.
-End Rem
-
-SuperStrict
-
-Print Sgn 50	'1
-Print Sgn 0		'0
-Print Sgn -50	'-1
-```
-<br/>
-
-### `Min`
-
-Numeric 'minimum' builtin function
-
-#### Returns
-The lesser of the two numeric arguments
-
-
-#### Example
-```blitzmax
-Rem
-Min evaluates to the value of the smallest of the two operators.
-End Rem
-
-SuperStrict
-
-Print Min(10,20)	'10
-Print Min(20,10)	'10
-```
-<br/>
-
-### `Max`
-
-Numeric 'maximum' builtin function
-
-#### Returns
-The larger of the two numeric arguments
-
-
-#### Example
-```blitzmax
-Rem
-Max
-Max evaluates to the value of the largest of the two operators.
-End Rem
-
-SuperStrict
-
-Print Max(10,20)	'20
-Print Max(20,10)	'20
-```
-<br/>
-
 ### `Varptr`
 
 Find the address of a variable

+ 46 - 2
docs/api/brl/brl_eventqueue.md

@@ -88,7 +88,7 @@ Get current event id
 The <b>id</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -105,6 +105,28 @@ Repeat
    End Select
 Forever
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Import MaxGUI.Drivers
+
+Local window:tgadget=CreateWindow("events",0,0,320,240)
+
+Local button:tgadget=CreateButton("Button1",4,4,80,24,window)
+Local canvas:tgadget=CreateCanvas(84,4,80,24,window,1)
+
+Repeat
+	WaitEvent()
+	If EventID()=EVENT_WINDOWCLOSE End
+	
+	Select EventID()
+		Case EVENT_GADGETACTION Print "gadgetaction (buttonpress, etc.)"
+		Case EVENT_MOUSEMOVE Print "canvas mousemove"
+	End Select
+	
+Forever
+```
 <br/>
 
 ### `Function EventData:Int()`
@@ -253,7 +275,7 @@ Get current event source object
 The <b>source</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -278,6 +300,28 @@ Repeat
    End Select
 Forever
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Import MaxGUI.Drivers
+
+Local window:tgadget=CreateWindow("events",0,0,320,240)
+
+Local button1:tgadget=CreateButton("Button1",4,4,80,24,window)
+Local button2:tgadget=CreateButton("Button2",84,4,80,24,window)
+
+Repeat
+	WaitEvent()
+	If EventID()=EVENT_WINDOWCLOSE End
+	
+	Select EventSource()
+		Case button1 Print "button1"
+		Case button2 Print "button2"
+	End Select
+	
+Forever
+```
 <br/>
 
 ### `Function EventSourceHandle:Size_T()`

+ 31 - 1
docs/api/brl/brl_graphics.md

@@ -450,7 +450,7 @@ and mouse.
 A graphics object
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -461,6 +461,36 @@ Flip
 Repeat
 Until KeyDown(KEY_ESCAPE) Or AppTerminate()
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Import MaxGUI.Drivers
+
+Local G:TGraphics = Graphics(640,480) 'creates the normal graphic screen first
+Local MyWindow:TGadget=CreateWindow("Canvas Example", 200,200,320,240)
+Local MyCanvas:TGadget=CreateCanvas(10,10,290,140,MyWindow)
+
+Repeat
+	WaitEvent()
+	Select EventID()
+		Case EVENT_WINDOWCLOSE
+			End
+		Case EVENT_GADGETPAINT
+			SetGraphics CanvasGraphics (MyCanvas)
+			SetColor Int(Rnd(255)),Int(Rnd(255)),Int(Rnd(255))
+			DrawRect 20 , 20 , 50 , 80
+			Flip
+			SetGraphics G
+			SetColor Int(Rnd(255)),Int(Rnd(255)),Int(Rnd(255))
+			DrawOval 100,100,100,100
+			Flip
+		Case EVENT_MOUSEMOVE
+			RedrawGadget(MyCanvas)
+	End Select
+
+Until AppTerminate()
+```
 <br/>
 
 ### `Function EndGraphics()`

+ 1 - 10
docs/api/brl/brl_linkedlist.md

@@ -11,7 +11,7 @@ A linked list allows you to efficiently add and remove objects to and from a col
 
 To create a linked list, use the [CreateList](../../brl/brl.linkedlist/#function-createlist-tlist) command.
 
-Add objects to a linked list using [ListAddFirst](../../brl/brl.linkedlist/#function-listaddfirst-tlink-list-tlist-value-object) or [ListAddLast](../../brl/brl.linkedlist/#function-listaddlast-tlink-list-tlist-value-object). Both commands return a link object which can be used to later remove the object with the [RemoveLink](../../brl/brl.linkedlist/#function-removelink-link-tlink) command. You can also remove objects with the [ListRemove](../../brl/brl.linkedlist/#function-listremove-list-tlist-value-object) command. However this is not as efficient as using [RemoveLink](../../brl/brl.linkedlist/#function-removelink-link-tlink) because the list must first be searched for the object to be removed.
+Add objects to a linked list using [ListAddFirst](../../brl/brl.linkedlist/#function-listaddfirst-tlink-list-tlist-value-object) or [ListAddLast](../../brl/brl.linkedlist/#function-listaddlast-tlink-list-tlist-value-object). Both commands return a link object which can be used to later remove the object with the [RemoveLink](../../brl/brl.linkedlist/tlist/#method-removelink-link-tlink) command. You can also remove objects with the [ListRemove](../../brl/brl.linkedlist/#function-listremove-list-tlist-value-object) command. However this is not as efficient as using [RemoveLink](../../brl/brl.linkedlist/tlist/#method-removelink-link-tlink) because the list must first be searched for the object to be removed.
 
 To visit all the objects in a linked list, you can use an [EachIn](../../brl/brl.blitz/#eachin) loop.
 
@@ -173,12 +173,3 @@ Remove an object from a linked list
 
 <br/>
 
-### `Function RemoveLink( link:TLink )`
-
-Remove an object from a linked list
-
-[RemoveLink](../../brl/brl.linkedlist/#function-removelink-link-tlink) is more efficient than [ListRemove](../../brl/brl.linkedlist/#function-listremove-list-tlist-value-object).
-
-
-<br/>
-

+ 229 - 7
docs/api/brl/brl_math.md

@@ -15,7 +15,7 @@ Check if a value is NAN
 True if <b>x</b> is 'not a number' (eg: Sqr(-1))
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -34,6 +34,27 @@ Next
 ' Square Root of  0.000000000 = 0.00000000000000000
 ' Square Root of  0.200000003 = 0.44721359883195888
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+For Local f:Float = - 0.4 Until 0.4 Step 0.2
+	If IsInf(Log(f) ) Then
+		Print "Log(" + f + ")=Infinity "+Log(f)
+	Else If IsNan(Log(f) ) Then
+		Print "Log(" + f + ") is not a real number "+Log(f)
+	Else
+		Print "Log(" + f + ")=" + Log(f) 
+   End If
+Next
+
+' ===================
+' Output
+' Log(-0.400000006) is not a real number -1.#IND000000000000
+' Log(-0.200000003) is not a real number -1.#IND000000000000
+' Log(0.000000000)=Infinity -1.#INF000000000000
+' Log(0.200000003)=-1.6094378975329393
+```
 <br/>
 
 ### `Function IsInf( x:Double )`
@@ -44,7 +65,7 @@ Check if a value is infinite (eg: 1.0/0.0)
 True if <b>x</b> is infinite
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -63,6 +84,27 @@ Next
 ' Divide by Zero
 ' inverse of 0.200000003 = 5.00000000
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+For Local f:Float = - 0.4 Until 0.4 Step 0.2
+	If IsInf(Log(f) ) Then
+		Print "Log(" + f + ")=Infinity "+Log(f)
+	Else If IsNan(Log(f) ) Then
+		Print "Log(" + f + ") is not a real number "+Log(f)
+	Else
+		Print "Log(" + f + ")=" + Log(f) 
+   End If
+Next
+
+' ===================
+' Output
+' Log(-0.400000006) is not a real number -1.#IND000000000000
+' Log(-0.200000003) is not a real number -1.#IND000000000000
+' Log(0.000000000)=Infinity -1.#INF000000000000
+' Log(0.200000003)=-1.6094378975329393
+```
 <br/>
 
 ### `Function Sqr:Double( x:Double )`
@@ -95,7 +137,7 @@ Next
 
 Sine of <b>x</b> degrees
 
-#### Example
+#### Example 1
 ```blitzmax
 Rem
 Sin:Double( x:Double )
@@ -107,13 +149,54 @@ For Local d:Int = 0 To 360 Step 45
 	Print "Sin("+d+")="+Sin(d)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Graphics 640,480
+
+SetColor 128,128,128
+DrawRect 0,240,360,1
+
+SetColor 0,255,255
+
+For Local t:Int=0 To 359
+	Plot t,Float(240+Sin(t)*80)
+Next
+
+Flip
+
+Repeat
+	WaitKey()
+Until KeyDown(KEY_ESCAPE)
+```
+#### Example 3
+```blitzmax
+SuperStrict
+
+Graphics 640,480
+
+Local radius:Int=80
+
+SetColor 0,255,255
+
+For Local t:Int=0 To 359 Step 4
+	Plot Float(320+Sin(t)*radius), Float(240+Cos(t)*radius)
+Next
+
+Flip
+
+Repeat
+	WaitKey()
+Until KeyDown(KEY_ESCAPE)
+```
 <br/>
 
 ### `Function Cos:Double( x:Double )`
 
 Cosine of <b>x</b> degrees
 
-#### Example
+#### Example 1
 ```blitzmax
 Rem
 Cosine of x
@@ -125,6 +208,51 @@ For Local d:Int = 0 To 360 Step 45
 	Print "Cos("+d+")="+Cos(d)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Graphics 640,480
+
+SetColor 128,128,128
+DrawRect 0,240,360,1
+
+SetColor 0,255,255
+
+For Local t:Int=0 To 359
+	Plot t,Float(240+Cos(t)*80)
+Next
+
+Flip
+
+Repeat
+	WaitKey()
+Until KeyDown(KEY_ESCAPE)
+```
+#### Example 3
+```blitzmax
+'
+' How to draw a 'dotted' flower using Sin/Cos
+'
+SuperStrict
+
+Graphics 640,480
+
+Local radius:Int
+
+SetColor 0,255,255
+
+For Local t:Int=0 To 359 Step 4
+	radius=Sin(t*8)*40+80
+	Plot Float(320+Sin(t)*radius), Float(240+Cos(t)*radius)
+Next
+
+Flip
+
+Repeat
+	WaitKey()
+Until KeyDown(KEY_ESCAPE)
+```
 <br/>
 
 ### `Function Tan:Double( x:Double )`
@@ -203,7 +331,7 @@ Next
 
 Inverse Tangent of two variables <b>x</b> , <b>y</b>
 
-#### Example
+#### Example 1
 ```blitzmax
 Rem
 ATan2 returns the Inverse Tangent of two variables
@@ -225,6 +353,24 @@ While Not KeyHit(KEY_ESCAPE)
 	Flip
 Wend
 ```
+#### Example 2
+```blitzmax
+'
+' ATan2
+'
+' returns the angle in degrees between two points by giving the width and height between then.
+'
+SuperStrict
+
+Print ATan2(4,4)
+'4^|    / (45 degrees)
+'  |   / 
+'  |  /
+'  | /
+'  |/
+'  +-----
+'       4>
+```
 <br/>
 
 ### `Function Sinh:Double( x:Double )`
@@ -365,7 +511,7 @@ Next
 
 Smallest integral value not less than <b>x</b>
 
-#### Example
+#### Example 1
 ```blitzmax
 Rem
 Ceil(x#) returns the smallest integral value not less than x
@@ -377,13 +523,51 @@ For Local i:Float = -1 To 1 Step .2
 	Print "Ceil("+i+")="+Ceil(i)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Graphics 640,480
+
+Local x:Int,y:Int
+Local mx:Int,my:Int
+
+HideMouse
+Repeat
+	mx=MouseX()
+	my=MouseY()
+	
+	Cls
+	' draw grid
+	SetColor 90,90,90
+	For y=0 Until 480 Step 20
+		For x=0 Until 640 Step 20
+			Plot x,y
+		Next
+	Next
+	
+	'draw mouse mx,my
+	SetColor 255,255,255
+	DrawRect mx-1,my-1,3,3
+	
+	' draw ceiled and floored mouse mx,my
+	SetColor 255,255,0
+	DrawRect Float(Ceil( mx/20.0)*20-1),Float(Ceil(my/20.0)*20-1),3,3
+	
+	SetColor 0,255,255
+	DrawRect Float(Floor(mx/20.0)*20-1),Float(Floor( my/20.0)*20-1),3,3
+	
+	Flip
+	
+Until KeyDown(KEY_ESCAPE)
+```
 <br/>
 
 ### `Function Floor:Double( x:Double )`
 
 Largest integral value not greater than <b>x</b>
 
-#### Example
+#### Example 1
 ```blitzmax
 Rem
 Floor(x!) returns the largest integral value not greater than x
@@ -395,5 +579,43 @@ For Local i:Double = -1 To 1 Step .2
 	Print "Floor("+i+")="+Floor(i)
 Next
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Graphics 640,480
+
+Local x:Int,y:Int
+Local mx:Int,my:Int
+
+HideMouse
+Repeat
+	mx=MouseX()
+	my=MouseY()
+	
+	Cls
+	' draw grid
+	SetColor 90,90,90
+	For y=0 Until 480 Step 20
+		For x=0 Until 640 Step 20
+			Plot x,y
+		Next
+	Next
+	
+	'draw mouse mx,my
+	SetColor 255,255,255
+	DrawRect mx-1,my-1,3,3
+	
+	' draw ceiled and floored mouse mx,my
+	SetColor 255,255,0
+	DrawRect Float(Ceil( mx/20.0)*20-1),Float(Ceil(my/20.0)*20-1),3,3
+	
+	SetColor 0,255,255
+	DrawRect Float(Floor(mx/20.0)*20-1),Float(Floor( my/20.0)*20-1),3,3
+	
+	Flip
+	
+Until KeyDown(KEY_ESCAPE)
+```
 <br/>
 

+ 5 - 5
docs/api/brl/brl_max2d.md

@@ -676,7 +676,7 @@ The horizontal and vertical position of the current drawing handle.
 
 <br/>
 
-### `Function SetRotation( rotation# )`
+### `Function SetRotation( Rotation# )`
 
 Set current rotation
 
@@ -718,7 +718,7 @@ The current x and y scale values in the variables supplied.
 
 <br/>
 
-### `Function SetTransform( rotation#=0,scale_x#=1,scale_y#=1 )`
+### `Function SetTransform( Rotation#=0,scale_x#=1,scale_y#=1 )`
 
 Set current rotation and scale
 
@@ -1040,7 +1040,7 @@ Grab pixmap
 Tests if two images collide
 
 
-[ImagesCollide](../../brl/brl.max2d/#function-imagescollide-image1-timage-x1-y1-frame1-image2-timage-x2-y2-frame2) uses the current Rotation and Scale factors from the most previous
+[ImagesCollide](../../brl/brl.max2d/#function-imagescollideimage1-timage-x1-y1-frame1-image2-timage-x2-y2-frame2) uses the current Rotation and Scale factors from the most previous
 call to [SetScale](../../brl/brl.max2d/#function-setscale-scale-x-scale-y) and [SetRotation](../../brl/brl.max2d/#function-setrotation-rotation) to calculate at a pixel level if the two images collide.
 
 
@@ -1055,7 +1055,7 @@ True if any pixels of the two images specified at the given location overlap.
 Tests if two images with arbitrary Rotation and Scales collide
 
 
-[ImagesCollide2](../../brl/brl.max2d/#function-imagescollide2-image1-timage-x1-y1-frame1-rot1-scalex1-scaley1-image2-timage-x2-y2-frame2-rot2-scalex2-scaley2) uses the specified Rotation and Scale paramteters
+[ImagesCollide2](../../brl/brl.max2d/#function-imagescollide2image1-timage-x1-y1-frame1-rot1-scalex1-scaley1-image2-timage-x2-y2-frame2-rot2-scalex2-scaley2) uses the specified Rotation and Scale paramteters
 to calculate at a pixel level if the two images collide (overlap).
 
 
@@ -1074,7 +1074,7 @@ The BlitzMax 2D collision system manages 32 layers, the <b>mask</b> parameter ca
 be a combination of the following values or the special value COLLISION_LAYER_ALL in order
 to perform collision operations on multiple layers.
 
-Note: COLLISION_LAYER_32 is used by the [ImagesCollide](../../brl/brl.max2d/#function-imagescollide-image1-timage-x1-y1-frame1-image2-timage-x2-y2-frame2) and [ImagesCollide2](../../brl/brl.max2d/#function-imagescollide2-image1-timage-x1-y1-frame1-rot1-scalex1-scaley1-image2-timage-x2-y2-frame2-rot2-scalex2-scaley2) commands.
+Note: COLLISION_LAYER_32 is used by the [ImagesCollide](../../brl/brl.max2d/#function-imagescollideimage1-timage-x1-y1-frame1-image2-timage-x2-y2-frame2) and [ImagesCollide2](../../brl/brl.max2d/#function-imagescollide2image1-timage-x1-y1-frame1-rot1-scalex1-scaley1-image2-timage-x2-y2-frame2-rot2-scalex2-scaley2) commands.
 
 <table><tr><td> <b>Layer</b></td><td><b>Mask value</b></td></tr><tr><td>  COLLISION_LAYER_ALL</td><td>0</td></tr><tr><td>  COLLISION_LAYER_1</td><td>$0001</td></tr><tr><td>  COLLISION_LAYER_2</td><td>$0002</td></tr><tr><td>  COLLISION_LAYER_3</td><td>$0004</td></tr><tr><td>  COLLISION_LAYER_4</td><td>$0008</td></tr><tr><td>  COLLISION_LAYER_5</td><td>$0010</td></tr><tr><td>  COLLISION_LAYER_6</td><td>$0020</td></tr><tr><td>  COLLISION_LAYER_7</td><td>$0040</td></tr><tr><td>  COLLISION_LAYER_8</td><td>$0080</td></tr><tr><td>  COLLISION_LAYER_9</td><td>$0100</td></tr><tr><td>  COLLISION_LAYER_10</td><td>$0200</td></tr><tr><td>  COLLISION_LAYER_11</td><td>$0400</td></tr><tr><td>  COLLISION_LAYER_12</td><td>$0800</td></tr><tr><td>  COLLISION_LAYER_13</td><td>$1000</td></tr><tr><td>  COLLISION_LAYER_14</td><td>$2000</td></tr><tr><td>  COLLISION_LAYER_15</td><td>$4000</td></tr><tr><td>  COLLISION_LAYER_16</td><td>$8000</table>
 

+ 19 - 1
docs/api/brl/brl_pixmap.md

@@ -363,7 +363,7 @@ Load a pixmap
 A pixmap object
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -380,6 +380,24 @@ Repeat
 	Flip
 Until KeyHit(key_escape) Or AppTerminate()
 ```
+#### Example 2
+```blitzmax
+SuperStrict
+
+Graphics 640 , 480
+
+Local pix:TPixmap=LoadPixmap(blitzmaxpath()+"\samples\hitoro\gfx\boing.png")
+'converts Pixmap to Image
+'note alpha transparency
+Local image:TImage=LoadImage(pix)
+
+Repeat
+	Cls
+	DrawPixmap pix, 50, 50
+	DrawImage image, MouseX(), MouseY()
+	Flip
+Until KeyHit(key_escape) Or AppTerminate()
+```
 <br/>
 
 ### `Function ReadPixel( pixmap:TPixmap,x,y )`

+ 1 - 1
docs/api/brl/brl_polledinput.md

@@ -156,7 +156,7 @@ The character code of the next character.
 Flush key states and character queue.
 
 
-[FlushKeys](../../brl/brl.polledinput/#function-flushkeys-resetstates-int-true) resets the state of all keys to 'off', and resets the character queue
+[FlushKeys](../../brl/brl.polledinput/#function-flushkeysresetstates-int-true) resets the state of all keys to 'off', and resets the character queue
 used by [GetChar](../../brl/brl.polledinput/#function-getchar).
 
 

+ 13 - 8
docs/api/brl/brl_random.md

@@ -13,7 +13,7 @@ The numbers generated are not really random, as without special hardware support
 
 Instead, the algorithm produces values that merely appear to be random. In reality, each generated value actually depends on the previously generated value.
 
-You can set the 'state' of the random number generator using the [SeedRnd](../../brl/brl.random/#function-seedrnd-seed-int) command. A common practice is to seed the random number generator with the system time when your program starts up, for example:
+You can set the 'state' of the random number generator using the [SeedRnd](../../brl/brl.random/trandom/#method-seedrndseed-int) command. A common practice is to seed the random number generator with the system time when your program starts up, for example:
 ```
 SeedRnd MilliSecs()
 ````
@@ -21,9 +21,14 @@ SeedRnd MilliSecs()
 This ensures that the random number generator does not start in the same state each time your program is run, which would cause it to produce the same sequence of random numbers.
 
 
+## Types
+| Type | Description |
+|---|---|
+| [TRandom](../../brl/brl.random/trandom) | Random number generator |
+
 ## Functions
 
-### `Function RndFloat#()`
+### `Function RndFloat:Float()`
 
 Generate random float
 
@@ -61,7 +66,7 @@ Print "    Exact probability = " + ( 15.0 / 29.0 )
 ```
 <br/>
 
-### `Function RndDouble!()`
+### `Function RndDouble:Double()`
 
 Generate random double
 
@@ -99,7 +104,7 @@ Print "    Exact probability = " + ( 15.0 / 29.0 )
 ```
 <br/>
 
-### `Function Rnd!( min_value!=1,max_value!=0 )`
+### `Function Rnd:Double(minValue:Double = 1, maxValue:Double = 0)`
 
 Generate random double
 
@@ -139,12 +144,12 @@ Print "    Exact area = " + Pi     '  4 * Pi/4, compare with estimate
 ```
 <br/>
 
-### `Function Rand:Int( min_value:Int,max_value:Int=1 )`
+### `Function Rand:Int(minValue:Int, maxValue:Int = 1)`
 
 Generate random integer
 
 
-The optional parameter allows you to use [Rand](../../brl/brl.random/#function-rand-int-min-value-int-max-value-int-1) in 2 ways:
+The optional parameter allows you to use [Rand](../../brl/brl.random/trandom/#method-rand-intminvalue-int-maxvalue-int-1) in 2 ways:
 
 <table><tr><td> <b>Format</b></td><td><b>Result</b></td></tr><tr><td>  &Rand(x)</td><td>Random integer in the range 1 to x (inclusive)</td></tr><tr><td>  &Rand(x,y)</td><td>Random integer in the range x to y (inclusive)</table>
 
@@ -175,7 +180,7 @@ Next
 ```
 <br/>
 
-### `Function SeedRnd( seed:Int )`
+### `Function SeedRnd(seed:Int)`
 
 Set random number generator seed
 
@@ -210,7 +215,7 @@ Next
 
 Get random number generator seed
 
-Use in conjunction with SeedRnd, RndSeed allows you to reproduce sequences of random
+Used in conjunction with SeedRnd, RndSeed allows you to reproduce sequences of random
 numbers.
 
 

+ 1 - 1
docs/api/brl/brl_system.md

@@ -28,7 +28,7 @@ There can only be one system driver initialised. A second call to this function
 
 ### `Function SystemDriver:TSystemDriver()`
 
-Returns the BlitzMax system driver, or throws an exception if [InitSystemDriver](../../brl/brl.system/#function-initsystemdriver-driver-tsystemdriver)() hasn't been called with one.
+Returns the BlitzMax system driver, or throws an exception if [InitSystemDriver](../../brl/brl.system/#function-initsystemdriverdriver-tsystemdriver)() hasn't been called with one.
 
 <br/>
 

+ 30 - 1
docs/api/brl/brl_timer.md

@@ -24,7 +24,7 @@ If <b>event</b> is Null, an event with an <b>id</b> equal to EVENT_TIMERTICK and
 A new timer object
 
 
-#### Example
+#### Example 1
 ```blitzmax
 SuperStrict
 
@@ -40,6 +40,35 @@ For Local n:Int = 0 Until 18
 	EndIf
 Next
 ```
+#### Example 2
+```blitzmax
+'Animation on MaxGUI canvas
+SuperStrict
+
+Import MaxGUI.Drivers
+
+Local MyWindow:TGadget=CreateWindow("Canvas Example", 200,200,320,240)
+Local MyCanvas:TGadget=CreateCanvas(10,10,290,140,MyWindow)
+Local timer:TTimer=CreateTimer(60)
+Local x:Int=0
+
+Repeat
+  WaitEvent()
+  Select EventID()
+  Case EVENT_WINDOWCLOSE
+     End
+  Case EVENT_TIMERTICK
+     x=x+1
+     If x>240 x=0
+     RedrawGadget(MyCanvas)
+  Case EVENT_GADGETPAINT
+    SetGraphics CanvasGraphics (MyCanvas)
+    Cls
+    DrawRect  x,20,50,80
+    Flip
+   End Select
+Forever
+```
 <br/>
 
 ### `Function TimerTicks:Int( timer:TTimer )`

+ 1 - 1
docs/api/brl/brl_xml.md

@@ -20,7 +20,7 @@ Returns the element name.
 
 <br/>
 
-### `Method ToString:String()`
+### `Method ToString:String() Override`
 
 Returns a string representation of the element.
 

+ 15 - 0
docs/api/maxgui/maxgui_gtk3webkitgtk.md

@@ -0,0 +1,15 @@
+---
+id: maxgui.gtk3webkitgtk
+title: MaxGUI.GTK3WebKitGtk
+sidebar_label: MaxGUI.GTK3WebKitGtk
+---
+
+
+## Methods
+
+### `Method Stop()`
+
+Stops loading of the current document.
+
+<br/>
+

+ 29 - 0
docs/api/maxgui/maxgui_maxguitextareascintilla.md

@@ -0,0 +1,29 @@
+---
+id: maxgui.maxguitextareascintilla
+title: MaxGUI.MaxGUITextAreaScintilla
+sidebar_label: MaxGUI.MaxGUITextAreaScintilla
+---
+
+
+## Methods
+
+### `Method SetText(txt:String)`
+
+Sets the text.
+
+<br/>
+
+### `Method SetSelection(pos:Int, length:Int, units:Int)`
+
+Set the text area selection
+
+<br/>
+
+## Functions
+
+### `Function OnMouseUp:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)`
+
+Callback for mouse button release
+
+<br/>
+

+ 304 - 0
docs/language/enums.md

@@ -0,0 +1,304 @@
+---
+id: enums
+title: Enums
+sidebar_label: Enums
+---
+
+## Introduction
+
+An [Enum] is an efficient way to define a set of constants that can be assigned to variables.
+Say, for example, you'd like to represent the days of the week. Since this is a fixed set of seven
+possible values, you could define those values within an Enum :
+
+```blitzmax
+Enum EDay
+	Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
+End Enum
+```
+
+Comma separators are optional, and elements can be placed on separate lines.
+
+```blitzmax
+Enum ESequence
+	Morning
+	Afternoon
+	Night
+End Enum
+```
+By default, the underlying type of an enum element is an [Int], but you can specify a different numeric
+type by using the standard type declaration syntax, as shown in the following example. Valid integral
+numeric types that can be assigned as a type include, [Byte], [Short], [Int], [UInt], [Long], [ULong] and [Size_T].
+
+```blitzmax
+Enum EMonth:Byte
+	Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
+End Enum
+```
+
+When you do not specify any values for the elements, the default is to assign it the index in
+the list of elements, starting from `0`. So, from the `EDay` example, `EDay.Sunday` is associated
+with the value `0`, `EDay.Monday` with `1`, and so on.
+
+## Using Enums
+
+You assign an enum value to a variable just as you would any other type:
+
+```blitzmax
+Local meetingDay:EDay = EDay.Monday
+```
+
+A variable declared as a particular type of Enum can only be assigned to enum elements of that kind.
+```blitzmax
+meetingDay = EDay.Wednesday ' good
+
+meetingDay = EMonth.Aug ' error
+meetingDay = 3 ' error
+```
+
+To retrieve the numeric value for a particular enum element, you can use the `Ordinal()` method:
+```blitzmax
+Print EMonth.May.Ordinal()
+```
+Would print `4`.
+
+The `ToString()` method returns a [String] representation of the enum element:
+```blitzmax
+Print EMonth.Sep.ToString()
+```
+Would print `Sep`.
+
+The `Values()` function returns an array of all elements:
+```blitzmax
+For Local month:EMonth = Eachin EMonth.Values()
+    Print month.ToString() + " = " + month.Ordinal()
+Next
+```
+
+## Assigning Values
+
+Rather than using just the default values, you can also assign any constant value
+(or something that will evaluate to a constant value at compile time) to the elements of an Enum.
+
+```blitzmax
+Enum EMachineState
+	PowerOff = 0
+	Running = 5
+	Sleeping = 10
+	Hibernating = Sleeping + 5
+End Enum
+```
+
+Subsequent elements that do not specify a value, increment from the preceding entry. So if the preceding element
+had a value of `15`, the next would automatically have the value `16`.
+
+## Bit Flag Enums
+
+You can use an [Enum] to define bit flags, which enables an instance of the Enum to store
+any combination of the values that are defined in its elements.
+
+You create a bit flags enum by applying the `Flags` modifier to the Enum declaration,
+defining the values appropriately so that standard bitwise operations can be performed on them.
+
+In the following example, an Enum called EDays is defined with the Flags modifier. Each
+value is automatically assigned the next greater power of `2`, starting at `1`. This enables you
+to create an `EDays` variable whose value is `EDays.Tuesday | EDays.Thursday`.
+
+```blitzmax
+SuperStrict
+Framework brl.standardio
+
+Local meetingDays:EDays = EDays.Tuesday | EDays.Thursday
+Print meetingDays.ToString()
+
+Enum EDays Flags
+	Sunday
+	Monday
+	Tuesday
+	Wednesday
+	Thursday
+	Friday
+	Saturday
+End Enum
+```
+
+To set a flag on an enum, use the bitwise or operator (`|`) as shown in the following example:
+
+```blitzmax
+' Initialize with two flags using bitwise Or.
+meetingDays = EDays.Tuesday | EDays.Thursday
+
+' Set an additional flag using bitwise Or.
+meetingDays :| EDays.Friday
+
+Print "Meeting days are " + meetingDays.ToString()
+' Output: Meeting days are Tuesday|Thursday|Friday
+
+' Remove a flag using bitwise XOr.
+meetingDays :~ EDays.Tuesday
+Print "Meeting days are " + meetingDays.ToString()
+' Output: Meeting days are Thursday|Friday
+```
+
+To determine whether a specific flag is set, use a bitwise AND operation (`&`), as shown in the following example:
+
+```blitzmax
+' Test value of flags using bitwise AND.
+Local test:Int = (meetingDays & EDays.Thursday) = EDays.Thursday
+If test Then
+	Print "Thursday is a meeting day."
+Else
+	Print "Thursday is not a meeting day."
+End If
+' Output: Thursday is a meeting day.
+```
+
+Bit flag enums can also have their values specified. It is generally advised to make the values
+powers of `2`, so that you can apply bitwise operations to them. Default values for elements will
+always be a power of `2`, the next element being the next logical power of `2` higher than the previous entry.
+
+```blitzmax
+SuperStrict
+Framework brl.standardio
+
+For Local attackType:EAttackType = EachIn EAttackType.Values()
+	Print attackType.ToString() + " = " + attackType.Ordinal()
+Next
+
+Enum EAttackType Flags
+    Melee
+    Fire
+    Ice = $8
+    Poison
+End Enum
+```
+
+Because bit flags are limited to the number of bits for a given type (e.g. 8 bits for a [Byte],
+32 bits for an [Int]), you need to ensure that the type you use for a bit flag Enum has enough
+bits for all the elements you require.
+
+If you try to use more bits than the type allows, the compile will fail with an appropriate error message.
+
+## Enum vs Const
+
+As well as making the code easier to read, by using an Enum instead of a set of [Const] values,
+we can let the compiler ensure that only the specific set of values defined by the Enum be used.
+
+In the following example, we define a set of consts to record the types of available tyres a car can use:
+
+```blitzmax
+SuperStrict
+Framework brl.standardio
+
+Local car:TCar = New TCar
+
+TPitstop.ChangeTyre(car, TYRE_SOFT)
+
+Const TYRE_SOFT:Int = 0
+Const TYRE_MEDIUM:Int = 1
+Const TYRE_HARD:Int = 2
+Const TYRE_INTER:Int = 3
+Const TYRE_WET:Int = 4
+
+Type TPitstop
+
+	Function ChangeTyre(car:TCar, set:Int)
+		If car.tyreSet = set And set <> TYRE_WET Then
+			Throw"Can't change to same kind of tyre"
+		End If
+
+		Local s:String
+		Select set
+			Case TYRE_SOFT
+				s = "Soft"
+			Case TYRE_MEDIUM
+				s = "Medium"
+			Case TYRE_HARD
+				s = "Hard"
+			Case TYRE_INTER
+				s = "Inter"
+			Case TYRE_WET
+				s = "Wet"
+			Default
+				Throw "Not a valid tyre choice"
+		End Select
+		car.tyreSet = set
+		Print "Changing to " + s
+	End Function
+
+End Type
+
+Type TCar
+	Field tyreSet:Int = TYRE_MEDIUM
+End Type
+```
+We expect that users of our code will diligently use the defined constants,
+instead of numbers – `TYRE_SOFT`, `TYRE_MEDIUM` and so on.
+The problem lies in the fact that someone may decide not to use the constants defined
+by us and may submit an invalid number as an argument of our function,
+for example: `-1` or `10`. In this case, if the function does not check for
+invalid value, it will likely result in incorrect behaviour.
+
+To avoid this problem we can replace the constants with an Enum, thereby constraining
+the values that can be passed into the function :
+```blitzmax
+SuperStrict
+Framework brl.standardio
+
+Local car:TCar = New TCar
+
+TPitstop.ChangeTyre(car, ETyre.Soft)
+
+Enum ETyre
+	Soft
+	Medium
+	Hard
+	Inter
+	Wet
+End Enum
+
+Type TPitstop
+
+	Function ChangeTyre(car:TCar, set:ETyre)
+		If car.tyreSet = set And set <> ETyre.Wet Then
+			Throw"Can't change to same kind of tyre"
+		End If
+
+		Local s:String
+		Select set
+			Case ETyre.Soft
+				s = "Soft"
+			Case ETyre.Medium
+				s = "Medium"
+			Case ETyre.Hard
+				s = "Hard"
+			Case ETyre.Inter
+				s = "Inter"
+			Case ETyre.Wet
+				s = "Wet"
+		End Select
+		car.tyreSet = set
+		Print "Changing to " + s
+	End Function
+
+End Type
+
+Type TCar
+	Field tyreSet:ETyre = ETyre.Medium
+End Type
+```
+
+Notice that we no longer need to [Throw] on unsupported values of `set` because we know
+that only the values specified by the [Enum] will ever be used.
+
+
+[Enum]: ../../api/brl/brl.blitz/#enum
+[Byte]: ../../api/brl/brl.blitz/#byte
+[Short]: ../../api/brl/brl.blitz/#short
+[Int]: ../../api/brl/brl.blitz/#int
+[UInt]: ../../api/brl/brl.blitz/#uint
+[Long]: ../../api/brl/brl.blitz/#long
+[ULong]: ../../api/brl/brl.blitz/#ulong
+[Size_T]: ../../api/brl/brl.blitz/#size-t
+[Const]: ../../api/brl/brl.blitz/#const
+[Throw]: ../../api/brl/brl.blitz/#throw
+[String]: ../../api/brl/brl.blitz/#string

+ 1 - 0
website/sidebars.json

@@ -26,6 +26,7 @@
       "language/constants",
       "language/data_types",
       "language/debugging",
+      "language/enums",
       "language/exceptions",
       "language/expressions",
       "language/functions",

+ 1 - 1
website/siteConfig.js

@@ -96,7 +96,7 @@ const siteConfig = {
                             'and or shl shr sar end if then else elseif endif while wend repeat until forever for to step ' +
                             'next return alias rem endrem throw assert try catch finally nodebug incbin endselect endmethod ' +
                             'endfunction endtype endextern endtry endwhile pi release defdata readdata restoredata interface ' +
-                            'endinterface implements size_t uint ulong struct endstruct operator where readonly export',
+                            'endinterface implements size_t uint ulong struct endstruct operator where readonly export enum override',
 
                         built_in: 'DebugLog DebugStop',