浏览代码

Updated Examples.

woollybah 6 年之前
父节点
当前提交
f7b6be3ad1
共有 83 个文件被更改,包括 405 次插入219 次删除
  1. 3 1
      blitz.mod/doc/else.bmx
  2. 3 1
      blitz.mod/doc/elseif.bmx
  3. 2 0
      blitz.mod/doc/end.bmx
  4. 2 0
      blitz.mod/doc/endextern.bmx
  5. 4 2
      blitz.mod/doc/endfunction.bmx
  6. 3 1
      blitz.mod/doc/endif.bmx
  7. 7 5
      blitz.mod/doc/endmethod.bmx
  8. 2 0
      blitz.mod/doc/endrem.bmx
  9. 2 1
      blitz.mod/doc/endselect.bmx
  10. 4 2
      blitz.mod/doc/endtype.bmx
  11. 3 0
      blitz.mod/doc/exit.bmx
  12. 23 21
      blitz.mod/doc/extends.bmx
  13. 2 0
      blitz.mod/doc/extern.bmx
  14. 3 1
      blitz.mod/doc/false.bmx
  15. 4 2
      blitz.mod/doc/field.bmx
  16. 9 7
      blitz.mod/doc/final.bmx
  17. 9 7
      blitz.mod/doc/float.bmx
  18. 5 3
      blitz.mod/doc/floor.bmx
  19. 3 1
      blitz.mod/doc/for.bmx
  20. 3 0
      blitz.mod/doc/forever.bmx
  21. 11 9
      blitz.mod/doc/function.bmx
  22. 5 3
      blitz.mod/doc/global.bmx
  23. 2 0
      blitz.mod/doc/if.bmx
  24. 2 0
      blitz.mod/doc/import.bmx
  25. 3 1
      blitz.mod/doc/incbin.bmx
  26. 7 5
      blitz.mod/doc/incbinlen.bmx
  27. 6 4
      blitz.mod/doc/incbinptr.bmx
  28. 6 4
      blitz.mod/doc/int.bmx
  29. 2 0
      blitz.mod/doc/launchdir.bmx
  30. 6 4
      blitz.mod/doc/len.bmx
  31. 5 3
      blitz.mod/doc/local.bmx
  32. 5 3
      blitz.mod/doc/log.bmx
  33. 5 3
      blitz.mod/doc/log10.bmx
  34. 2 0
      blitz.mod/doc/long.bmx
  35. 9 0
      blitz.mod/doc/max.bmx
  36. 0 7
      blitz.mod/doc/maxim.bmx
  37. 7 5
      blitz.mod/doc/method.bmx
  38. 8 0
      blitz.mod/doc/min.bmx
  39. 0 6
      blitz.mod/doc/minim.bmx
  40. 3 1
      blitz.mod/doc/mod.bmx
  41. 2 0
      blitz.mod/doc/module.bmx
  42. 2 0
      blitz.mod/doc/moduleinfo.bmx
  43. 20 6
      blitz.mod/doc/new.bmx
  44. 5 1
      blitz.mod/doc/next.bmx
  45. 2 0
      blitz.mod/doc/not.bmx
  46. 6 4
      blitz.mod/doc/null.bmx
  47. 3 1
      blitz.mod/doc/object.bmx
  48. 3 3
      blitz.mod/doc/onend.bmx
  49. 3 1
      blitz.mod/doc/or.bmx
  50. 2 0
      blitz.mod/doc/pi.bmx
  51. 5 2
      blitz.mod/doc/private.bmx
  52. 3 1
      blitz.mod/doc/ptr.bmx
  53. 4 2
      blitz.mod/doc/public.bmx
  54. 2 0
      blitz.mod/doc/rem.bmx
  55. 5 1
      blitz.mod/doc/repeat.bmx
  56. 6 2
      blitz.mod/doc/restoredata.bmx
  57. 4 2
      blitz.mod/doc/return.bmx
  58. 4 0
      blitz.mod/doc/runtimeerror.bmx
  59. 7 5
      blitz.mod/doc/sar.bmx
  60. 3 1
      blitz.mod/doc/select.bmx
  61. 14 12
      blitz.mod/doc/self.bmx
  62. 2 0
      blitz.mod/doc/sgn.bmx
  63. 7 5
      blitz.mod/doc/shl.bmx
  64. 5 3
      blitz.mod/doc/short.bmx
  65. 7 5
      blitz.mod/doc/shr.bmx
  66. 5 3
      blitz.mod/doc/sin.bmx
  67. 10 8
      blitz.mod/doc/sizeof.bmx
  68. 3 1
      blitz.mod/doc/sqr.bmx
  69. 3 1
      blitz.mod/doc/step.bmx
  70. 3 1
      blitz.mod/doc/string.bmx
  71. 6 4
      blitz.mod/doc/super.bmx
  72. 5 3
      blitz.mod/doc/tan.bmx
  73. 2 0
      blitz.mod/doc/then.bmx
  74. 9 6
      blitz.mod/doc/throw.bmx
  75. 4 2
      blitz.mod/doc/to.bmx
  76. 2 0
      blitz.mod/doc/true.bmx
  77. 10 6
      blitz.mod/doc/try.bmx
  78. 4 2
      blitz.mod/doc/type.bmx
  79. 4 2
      blitz.mod/doc/until.bmx
  80. 4 2
      blitz.mod/doc/var.bmx
  81. 6 4
      blitz.mod/doc/varptr.bmx
  82. 5 1
      blitz.mod/doc/wend.bmx
  83. 4 3
      blitz.mod/doc/while.bmx

+ 3 - 1
blitz.mod/doc/else.bmx

@@ -2,7 +2,9 @@ Rem
 Else provides the ability for an If Then construct to execute a second block of code when the If condition is false.
 End Rem
 
-i=3
+SuperStrict
+
+Local i:Int = 3
 
 If i<5 Print "i<5" Else Print "i>=5"	' single line If Else
 

+ 3 - 1
blitz.mod/doc/elseif.bmx

@@ -2,7 +2,9 @@ Rem
 ElseIf provides the ability to test and execute a section of code if the initial condition failed.
 End Rem
 
-age=Int( Input("How old Are You?") )
+SuperStrict
+
+Local age:Int = Int( Input("How old Are You?") )
 
 If age<13
 	Print "You are young"

+ 2 - 0
blitz.mod/doc/end.bmx

@@ -2,6 +2,8 @@ Rem
 The End command causes a program to exit immediately.
 End Rem
 
+SuperStrict
+
 Print "Hello!"
 End
 Print "This line will never be printed as the program has already been ended."

+ 2 - 0
blitz.mod/doc/endextern.bmx

@@ -2,6 +2,8 @@ Rem
 EndExtern marks the end of an Extern section.
 End Rem
 
+SuperStrict
+
 Extern 
 	Function puts( str$z )
 End Extern

+ 4 - 2
blitz.mod/doc/endfunction.bmx

@@ -2,11 +2,13 @@ Rem
 Function marks the end of a BlitzMax function declaration.
 End Rem
 
+SuperStrict
+
 Function RandomName$()
-	local a$[]=["Bob","Joe","Bill"]
+	Local a$[]=["Bob","Joe","Bill"]
 	Return a[Rnd(Len a)]
 End Function
 
-For i=1 To 5
+For Local i:Int = 1 To 5
 	Print RandomName$()
 Next

+ 3 - 1
blitz.mod/doc/endif.bmx

@@ -2,7 +2,9 @@ Rem
 EndIf marks the end of an If Then block.
 End Rem
 
-i=5
+SuperStrict
+
+Local i:Int = 5
 
 If i<10
 	Print "i<10"

+ 7 - 5
blitz.mod/doc/endmethod.bmx

@@ -2,13 +2,15 @@ Rem
 EndMethod marks the end of a BlitzMax Method declaration.
 End Rem
 
+SuperStrict
+
 Type TPoint
-	field	x,y
+	Field x:Int,y:Int
 
-	Method ToString$()
-		return x+","+y
+	Method ToString:String()
+		Return x+","+y
 	End Method
 End Type
 
-a:TPoint=new TPoint
-print a.ToString()
+Local p:TPoint = New TPoint
+Print p.ToString()

+ 2 - 0
blitz.mod/doc/endrem.bmx

@@ -3,5 +3,7 @@ All code between Rem and EndRem is ignored by the BlitzMax compiler.
 Print "hello"
 End Rem
 
+SuperStrict
+
 Print "goodbye"
  

+ 2 - 1
blitz.mod/doc/endselect.bmx

@@ -2,9 +2,10 @@ Rem
 EndSelect marks the end of a Select block.
 End Rem
 
+SuperStrict
 SeedRnd MilliSecs()
 
-a=Rand(5)
+Local a:Int = Rand(5)
 
 Select a
 	Case 1 Print "one"

+ 4 - 2
blitz.mod/doc/endtype.bmx

@@ -2,11 +2,13 @@ Rem
 EndType marks the end of a BlitzMax custom type.
 End Rem
 
+SuperStrict
+
 Type TVector
-	Field	x,y,z
+	Field x:Int,y:Int,z:Int
 End Type
 
-Local a:TVector=new TVector
+Local a:TVector=New TVector
 
 a.x=10
 a.y=20

+ 3 - 0
blitz.mod/doc/exit.bmx

@@ -2,6 +2,9 @@ Rem
 Exit causes program flow to exit the enclosing While, Repeat or For loop.
 End Rem
 
+SuperStrict
+
+Local n:Int
 Repeat
 	Print n
 	n:+1

+ 23 - 21
blitz.mod/doc/extends.bmx

@@ -2,18 +2,20 @@ Rem
 Extends is used in a BlitzMax Type declaration to derive the Type from a specified base class.
 End Rem
 
+SuperStrict
+
 Type TShape
-	Field	xpos,ypos
+	Field xpos:Int,ypos:Int
 	Method Draw() Abstract
 End Type
 
-Type TCircle extends TShape
-	Field	radius
+Type TCircle Extends TShape
+	Field radius:Int
 	
-	Function Create:TCircle(x,y,r)
-		local c:TCircle=new TCircle
+	Function Create:TCircle(x:Int,y:Int,r:Int)
+		Local c:TCircle=New TCircle
 		c.xpos=x;c.ypos=y;c.radius=r
-		return c
+		Return c
 	End Function
 	
 	Method Draw()
@@ -21,13 +23,13 @@ Type TCircle extends TShape
 	End Method
 End Type
 
-Type TRect extends TShape
-	Field	width,height
+Type TRect Extends TShape
+	Field width:Int,height:Int
 	
-	Function Create:TRect(x,y,w,h)
-		local r:TRect=new TRect
+	Function Create:TRect(x:Int,y:Int,w:Int,h:Int)
+		Local r:TRect=New TRect
 		r.xpos=x;r.ypos=y;r.width=w;r.height=h
-		return r
+		Return r
 	End Function
 	
 	Method Draw()
@@ -35,20 +37,20 @@ Type TRect extends TShape
 	End Method
 End Type
 
-local 	shapelist:TShape[4]
-local	shape:TShape
+Local shapelist:TShape[4]
+Local shape:TShape
 
 shapelist[0]=TCircle.Create(200,50,50)
 shapelist[1]=TRect.Create(300,50,40,40)
 shapelist[2]=TCircle.Create(400,50,50)
 shapelist[3]=TRect.Create(200,180,250,20)
 
-graphics 640,480
-while not keyhit(KEY_ESCAPE)
-	cls
-	for shape=eachin shapelist
+Graphics 640,480
+While Not KeyHit(KEY_ESCAPE)
+	Cls
+	For shape=EachIn shapelist
 		shape.draw
-	next
-	flip
-wend
-end
+	Next
+	Flip
+Wend
+End

+ 2 - 0
blitz.mod/doc/extern.bmx

@@ -2,6 +2,8 @@ Rem
 Extern marks the beginning of an external list of function declarations.
 End Rem
 
+SuperStrict
+
 Extern 
 	Function puts( str$z )
 	Function my_puts( str$z )="puts"

+ 3 - 1
blitz.mod/doc/false.bmx

@@ -2,8 +2,10 @@ Rem
 False is a Constant Integer assigned the value 0.
 End Rem
 
+SuperStrict
+
 Print "False="+False
 
 If False
 	Print "This code will never be executed"
-Endif
+EndIf

+ 4 - 2
blitz.mod/doc/field.bmx

@@ -2,11 +2,13 @@ Rem
 Field is used to declare the member variable(s) of a type.
 End Rem
 
+SuperStrict
+
 Type TVector
-	Field	x,y,z
+	Field	x:Int,y:Int,z:Int
 End Type
 
-Local a:TVector=new TVector
+Local a:TVector=New TVector
 
 a.x=10
 a.y=20

+ 9 - 7
blitz.mod/doc/final.bmx

@@ -2,14 +2,16 @@ Rem
 Final stops methods from being redefined in super classes.
 End Rem
 
+SuperStrict
+
 Type T1
-	Method ToString$() Final
-		return "T1"
-	end method
+	Method ToString:String() Final
+		Return "T1"
+	End Method
 End Type
 
-Type T2 extends T1
-	method ToString$()	'compile time error "Final methods cannot be overridden"
-		return "T2"
-	end method
+Type T2 Extends T1
+	Method ToString:String()	'compile time error "Final methods cannot be overridden"
+		Return "T2"
+	End Method
 End Type

+ 9 - 7
blitz.mod/doc/float.bmx

@@ -2,16 +2,18 @@ Rem
 Float is a 32 bit floating point BlitzMax primitive type.
 End Rem
 
-Local a:float
+SuperStrict
+
+Local a:Float
 
 a=1
 
-for i=1 to 8
-	print a
+For Local i:Int = 1 To 8
+	Print a
 	a=a*0.1
-next
+Next
 
-for i=1 to 8
+For Local i:Int = 1 To 8
 	a=a*10
-	print a
-next
+	Print a
+Next

+ 5 - 3
blitz.mod/doc/floor.bmx

@@ -2,6 +2,8 @@ Rem
 Floor(x!) returns the largest integral value not greater than x
 End Rem
 
-for i!=-1 to 1 step .2
-	print "Floor("+i+")="+Floor(i)
-next
+SuperStrict
+
+For Local i:Double = -1 To 1 Step .2
+	Print "Floor("+i+")="+Floor(i)
+Next

+ 3 - 1
blitz.mod/doc/for.bmx

@@ -4,6 +4,8 @@ End Rem
 
 ' print 5 times table
 
-For i=1 to 12
+SuperStrict
+
+For Local i:Int = 1 To 12
 	Print "5*"+i+"="+5*i
 Next

+ 3 - 0
blitz.mod/doc/forever.bmx

@@ -2,6 +2,9 @@ Rem
 Forever is an alternate ending to a Repeat block that will cause the loop to always repeat.
 End Rem
 
+SuperStrict
+
+Local i:Int
 Repeat
 	Print i+" Ctrl-C to End!" 
 	i:+1

+ 11 - 9
blitz.mod/doc/function.bmx

@@ -5,15 +5,17 @@ When a function does not return a value the use of brackets when
 calling the function is optional.
 End Rem
 
-Function NextArg(a$)
-	Local	p
-	p=instr(a$,",")
-	if p 
-		NextArg a$[p..]
-		print a$[..p-1]
-	else
-		print a$
-	endif
+SuperStrict
+
+Function NextArg(a:String)
+	Local p:Int
+	p=Instr(a,",")
+	If p 
+		NextArg a[p..]
+		Print a[..p-1]
+	Else
+		Print a
+	EndIf
 End Function
 
 NextArg("one,two,three,four")

+ 5 - 3
blitz.mod/doc/global.bmx

@@ -2,11 +2,13 @@ Rem
 Global defines a variable as Global allowing it be accessed from within Methods and Functions.
 End Rem
 
-Global a=20
+SuperStrict
+
+Global a:Int = 20
 
 Function TestGlobal()
-	print "a="+a
+	Print "a="+a
 End Function
 
 TestGlobal
-print "a="+a
+Print "a="+a

+ 2 - 0
blitz.mod/doc/if.bmx

@@ -2,6 +2,8 @@ Rem
 If begins a conditional block.
 End Rem
 
+SuperStrict
+
 If 3<5 Print "3<5"	'single line if
 
 If 5<7				'if block

+ 2 - 0
blitz.mod/doc/import.bmx

@@ -2,6 +2,8 @@ Rem
 :Import specifies the external BlitzMax modules and source files used by the program.
 End Rem
 
+SuperStrict
+
 Framework BRL.GlMax2D
 
 Import BRL.System

+ 3 - 1
blitz.mod/doc/incbin.bmx

@@ -5,6 +5,8 @@ End Rem
 
 ' code snippet from demos/firepaint/firepaint.bmx
 
+SuperStrict
+
 Incbin "stars.png"
 
-Local stars=LoadImage( "incbin::stars.png" )
+Local stars:TImage = LoadImage( "incbin::stars.png" )

+ 7 - 5
blitz.mod/doc/incbinlen.bmx

@@ -2,11 +2,13 @@ Rem
 IncBinLen returns the size in bytes of the specified embedded binary file.
 End Rem
 
-incbin "incbinlen.bmx"
+SuperStrict
 
-local p:byte ptr=IncBinPtr("incbinlen.bmx")
-local bytes=incbinlen("incbinlen.bmx")
+Incbin "incbinlen.bmx"
 
-local s$=StringFromBytes(p,bytes)
+Local p:Byte Ptr = IncbinPtr("incbinlen.bmx")
+Local bytes:Int = IncbinLen("incbinlen.bmx")
 
-Print "StringFromBytes(p,bytes)="+s$
+Local s:String=String.FromBytes(p,bytes)
+
+Print "StringFromBytes(p,bytes)="+s

+ 6 - 4
blitz.mod/doc/incbinptr.bmx

@@ -2,11 +2,13 @@ Rem
 IncBinPtr returns a byte pointer to the specified embedded binary file.
 End Rem
 
+SuperStrict
+
 Incbin "incbinptr.bmx"
 
-Local p:Byte Ptr=IncbinPtr("incbinptr.bmx")
-Local bytes=IncbinLen("incbinptr.bmx")
+Local p:Byte Ptr = IncbinPtr("incbinptr.bmx")
+Local bytes:Int = IncbinLen("incbinptr.bmx")
 
-Local s$=String.FromBytes(p,bytes)
+Local s:String = String.FromBytes(p,bytes)
 
-Print "StringFromBytes(p,bytes)="+s$
+Print "StringFromBytes(p,bytes)="+s

+ 6 - 4
blitz.mod/doc/int.bmx

@@ -2,12 +2,14 @@ Rem
 Int is a signed 32 bit integer BlitzMax primitive type.
 End Rem
 
+SuperStrict
+
 Local a:Int
 
 ' the following values all print 0 as BlitzMax "rounds to zero"
 ' when converting from floating point to integer
 
-a=0.1;print a
-a=0.9;print a
-a=-0.1;print a
-a=-0.9;print a
+a=0.1;Print a
+a=0.9;Print a
+a=-0.1;Print a
+a=-0.9;Print a

+ 2 - 0
blitz.mod/doc/launchdir.bmx

@@ -1,3 +1,5 @@
 ' launchdir.bmx
 
+SuperStrict
+
 Print "This program was launched from "+LaunchDir$

+ 6 - 4
blitz.mod/doc/len.bmx

@@ -2,12 +2,14 @@ Rem
 Len is a BlitzMax operator that returns the number of elements in a container Type.
 End Rem
 
-a$="BlitzMax Rocks"
-Print Len a$	'prints 14
+SuperStrict
 
-Local b[]
+Local a:String = "BlitzMax Rocks"
+Print Len a	'prints 14
+
+Local b:Int[]
 Print Len b		'prints 0
 
-b=new Int[20]
+b=New Int[20]
 Print Len b		'prints 20
 

+ 5 - 3
blitz.mod/doc/local.bmx

@@ -2,12 +2,14 @@ Rem
 Local defines a variable as local to the Method or Function it is defined meaning it is automatically released when the function returns.
 End Rem
 
+SuperStrict
+
 Function TestLocal()
-	Local	a
+	Local a:Int
 	a=20
-	print "a="+a
+	Print "a="+a
 	Return
 End Function
 
 TestLocal
-print "a="+a	'prints 0 or if in Strict mode is an error as a is only local to the TestLocal function
+Print "a="+a	'prints an error as a is only local to the TestLocal function

+ 5 - 3
blitz.mod/doc/log.bmx

@@ -2,6 +2,8 @@ Rem
 Log(n#) returns the natural logarithm of n
 End Rem
 
-for n#=1 to 20
-	print "Log("+n+")="+Log(n)
-next
+SuperStrict
+
+For n:Float = 1 To 20
+	Print "Log("+n+")="+Log(n)
+Next

+ 5 - 3
blitz.mod/doc/log10.bmx

@@ -2,6 +2,8 @@ Rem
 Log10(n#) returns the Base 10 logarithm of n
 End Rem
 
-for n#=0 to 100 step 10
-	print "Log10("+n+")="+Log10(n)
-next
+SuperStrict
+
+For Local n:Float = 0 To 100 Step 10
+	Print "Log10("+n+")="+Log10(n)
+Next

+ 2 - 0
blitz.mod/doc/long.bmx

@@ -2,6 +2,8 @@ Rem
 Long is a signed 64 bit integer BlitzMax primitive type.
 End Rem
 
+SuperStrict
+
 Const MAXLONG:Long=$7fffffffffffffff:Long
 Const MINLONG:Long=$8000000000000000:Long
 

+ 9 - 0
blitz.mod/doc/max.bmx

@@ -0,0 +1,9 @@
+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

+ 0 - 7
blitz.mod/doc/maxim.bmx

@@ -1,7 +0,0 @@
-Rem
-Maxim
-Maxim evaluates to the value of the largest of the two operators.
-End Rem
-
-Print Maxim(10,20)	'20
-Print Maxim(20,10)	'20

+ 7 - 5
blitz.mod/doc/method.bmx

@@ -2,14 +2,16 @@ Rem
 Method marks the beginning of a BlitzMax custom type member function.
 End Rem
 
+SuperStrict
+
 Type TPoint
-	field	x,y
+	Field x:Int,y:Int
 
-	Method ToString$()
-		return x+","+y
+	Method ToString:String()
+		Return x+","+y
 	End Method
 End Type
 
-a:TPoint=new TPoint
-print a.ToString()
+Local a:TPoint=New TPoint
+Print a.ToString()
 	

+ 8 - 0
blitz.mod/doc/min.bmx

@@ -0,0 +1,8 @@
+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

+ 0 - 6
blitz.mod/doc/minim.bmx

@@ -1,6 +0,0 @@
-Rem
-Minim evaluates to the value of the smallest of the two operators.
-End Rem
-
-Print Minim(10,20)	'10
-Print Minim(20,10)	'10

+ 3 - 1
blitz.mod/doc/mod.bmx

@@ -2,6 +2,8 @@ Rem
 Mod is a mathematical operator that performs the Modulo function.
 End Rem
 
-For i=6 to -6 Step -1
+SuperStrict
+
+For Local i:Int = 6 To -6 Step -1
 	Print i+" Mod 3="+(i Mod 3)
 Next 

+ 2 - 0
blitz.mod/doc/module.bmx

@@ -3,6 +3,8 @@ The Module keyword advises the BlitzMax program maker BMK to create a code
 module from the source file.
 End Rem
 
+SuperStrict
+
 Module PUB.Sequencer
 
 ModuleInfo "Framework: Audio Sequencer for use with FreeAudio"

+ 2 - 0
blitz.mod/doc/moduleinfo.bmx

@@ -2,6 +2,8 @@ Rem
 ModuleInfo allows properties such as Author and Copyright to be included in a module file.
 End Rem
 
+SuperStrict
+
 Module PUB.Sequencer
 
 ModuleInfo "Framework: Audio Sequencer for use with FreeAudio"

+ 20 - 6
blitz.mod/doc/new.bmx

@@ -2,26 +2,40 @@ Rem
 New creates a BlitzMax variable of the Type specified.
 End Rem
 
+SuperStrict
+
 Type MyType
-	Field	a,b,c
+	Field a:Int,b:Int,c:Int
 End Type
 
 Local t:MyType
 t=New MyType
 t.a=20
 
-print t.a
+Print t.a
 
 ' if a new method is defined for the type it will also be called
 
 Type MyClass
-	Field	a,b,c
+	Field a:Int,b:Int,c:Int
 	Method New()
-		print "Constructor invoked!"
+		Print "Constructor invoked!"
 		a=10
 	End Method
+	
+	' the new method can be overridden to provide even more construction options
+	Method New(b:Int, c:Int)
+		New() ' the default new can also be called from inside this one
+		Self.b = b
+		Self.c = c
+	End Method
 End Type
 
 Local c:MyClass
-c=new MyClass
-print c.a
+c=New MyClass
+Print c.a
+
+c = New MyClass(5, 15)
+Print c.a
+Print c.b
+Print c.c

+ 5 - 1
blitz.mod/doc/next.bmx

@@ -2,4 +2,8 @@ Rem
 Marks the end of a For section.
 End Rem
 
-For i=1 to 5;print i;Next
+SuperStrict
+
+For Local i:Int = 1 To 5
+	Print i
+Next

+ 2 - 0
blitz.mod/doc/not.bmx

@@ -2,5 +2,7 @@ Rem
 Not is a boolean unary operator that performs the NOT function.
 End Rem
 
+SuperStrict
+
 Print Not 0			'prints 1 (TRUE)
 Print Not 20		'prints 0 (FALSE)

+ 6 - 4
blitz.mod/doc/null.bmx

@@ -2,12 +2,14 @@ Rem
 Null is a BlitzMax Constant representing an empty Object reference.
 End Rem
 
+SuperStrict
+
 Type mytype
-	Field	atypevariable
+	Field atypevariable:Int
 End Type
 
 Global a:mytype
 
-if a=null Print "a is uninitialized"
-a=new mytype
-if a<>null Print "a is initialized"
+If a=Null Print "a is uninitialized"
+a=New mytype
+If a<>Null Print "a is initialized"

+ 3 - 1
blitz.mod/doc/object.bmx

@@ -7,7 +7,9 @@ is an instance of TImage or an instance of a &Type derived
 from TImage.
 End Rem
 
+SuperStrict
+
 Function IsImage(obj:Object)
-	If TImage(obj) return True
+	If TImage(obj) Return True
 	Return False
 End Function

+ 3 - 3
blitz.mod/doc/onend.bmx

@@ -1,11 +1,11 @@
 ' onend.bmx
 
+SuperStrict
+
 Function cleanup()
-Print "cleaning up"
+	Print "cleaning up"
 End Function
 
 OnEnd cleanup
 Print "program running"
 End	'the cleanup function will be called at this time
-
-

+ 3 - 1
blitz.mod/doc/or.bmx

@@ -2,6 +2,8 @@ Rem
 Or is a boolean operator that performs the OR function.
 End Rem
 
-For i=1 To 5
+SuperStrict
+
+For Local i:Int = 1 To 5
 	If i=2 Or i=4 Print "!" Else Print i
 Next

+ 2 - 0
blitz.mod/doc/pi.bmx

@@ -2,4 +2,6 @@ Rem
 Pi is a Constant Double assigned the value 3.1415926535897932384626433832795
 End Rem
 
+SuperStrict
+
 Print "Pi="+Pi

+ 5 - 2
blitz.mod/doc/private.bmx

@@ -3,10 +3,13 @@ Private makes a variable, function or method only accessible from within the
 current source file.
 End Rem
 
+SuperStrict
+
 Public
 
-Global	Score,Lives,Health
+Global Score:Int,Lives:Int,Health:Int
 
 Private
 
-Global	posx,posy,posz
+Global posx:Int,posy:Int,posz:Int
+

+ 3 - 1
blitz.mod/doc/ptr.bmx

@@ -4,7 +4,9 @@ End Rem
 
 ' the following illustrates the use of traditional c style pointers
 
-Local c[]=[1,2,3,4]
+SuperStrict
+
+Local c:Int[]=[1,2,3,4]
 Local p:Int Ptr
 
 p=c

+ 4 - 2
blitz.mod/doc/public.bmx

@@ -2,10 +2,12 @@ Rem
 Public makes a variable, function or method accessible from outside the current source file (default).
 End Rem
 
+SuperStrict
+
 Public
 
-Global	Score,Lives,Health
+Global Score:Int,Lives:Int,Health:Int
 
 Private
 
-Global	posx,posy,posz
+Global posx:Int,posy:Int,posz:Int

+ 2 - 0
blitz.mod/doc/rem.bmx

@@ -7,6 +7,8 @@ First created 9th August, 2004
 
 End Rem
 
+SuperStrict
+
 Print "This program has no useful function"
 
 Rem

+ 5 - 1
blitz.mod/doc/repeat.bmx

@@ -2,7 +2,11 @@ Rem
 Repeat executes the following section of code until a terminating condition is true.
 End Rem
 
+SuperStrict
+
+Local i:Int
+
 Repeat
-	print i
+	Print i
 	i:+1
 Until i=5

+ 6 - 2
blitz.mod/doc/restoredata.bmx

@@ -1,8 +1,12 @@
 ' restoredata.bmx
 
-For i=1 To 5
+SuperStrict
+
+Local name:String, age:Int, skill:Int
+
+For Local i:Int = 1 To 5
 	RestoreData mydata	'reset the data pointer everly loop so we don't read past the end
-	ReadData name$,age,skill
+	ReadData name,age,skill
 	Print "name="+name+" age="+age+" skill="+skill
 Next
 

+ 4 - 2
blitz.mod/doc/return.bmx

@@ -3,14 +3,16 @@ Return exits a BlitzMax function or method with an optional value.
 The type of return value is dictated by the type of the function.
 End Rem
 
+SuperStrict
+
 Function CrossProduct#(x0#,y0#,z0#,x1#,y1#,z1#)
 	Return x0*x1+y0*y1+z0*z1
 End Function
 
 Print "(0,1,2)x(2,3,4)="+CrossProduct(0,1,2,2,3,4)
 
-Function LongRand:long()
-	Return (rand($80000000,$7fffffff) shl 32)|(rand($80000000,$7fffffff))
+Function LongRand:Long()
+	Return (Rand($80000000,$7fffffff) Shl 32)|(Rand($80000000,$7fffffff))
 End Function
 
 Print "LongRand()="+LongRand()

+ 4 - 0
blitz.mod/doc/runtimeerror.bmx

@@ -1,3 +1,7 @@
 ' runtimeerror.bmx
 
+SuperStrict
+
+Local a:Int
+
 If a=0 RuntimeError "This program has failed badly."

+ 7 - 5
blitz.mod/doc/sar.bmx

@@ -2,8 +2,10 @@ Rem
 Sar is a binary operator that performs the arithmetic shift to right function.
 End Rem
 
-b=$f0f0f0f0
-for i=1 to 32
-	print bin(b)
-	b=b sar 1
-next
+SuperStrict
+
+Local b:Int = $f0f0f0f0
+For Local i:Int = 1 To 32
+	Print Bin(b)
+	b=b Sar 1
+Next

+ 3 - 1
blitz.mod/doc/select.bmx

@@ -2,7 +2,9 @@ Rem
 Select begins a block featuring a sequence of multiple comparisons with a single value.
 End Rem
 
-a=Int( Input("Enter Your Country Code ") )
+SuperStrict
+
+Local a:Int = Int( Input("Enter Your Country Code ") )
 
 Select a
 	Case 1

+ 14 - 12
blitz.mod/doc/self.bmx

@@ -2,27 +2,29 @@ Rem
 Self is used in BlitzMax Methods to reference the invoking variable.
 End Rem
 
+SuperStrict
+
 Type MyClass
-	Global	count	
-	Field	id
+	Global count:Int
+	Field id:Int
 	
-	Method new()
+	Method New()
 		id=count
 		count:+1
-		ClassList.AddLast(self)	'adds this new instance to a global list		
+		ClassList.AddLast(Self)	'adds this new instance to a global list		
 	End Method
 End Type
 
 Global ClassList:TList
 
-classlist=new TList
+classlist=New TList
 
-local c:MyClass
+Local c:MyClass
 
-c=new MyClass
-c=new MyClass
-c=new MyClass
+c=New MyClass
+c=New MyClass
+c=New MyClass
 
-for c=eachin ClassList
-	print c.id
-next
+For c=EachIn ClassList
+	Print c.id
+Next

+ 2 - 0
blitz.mod/doc/sgn.bmx

@@ -2,6 +2,8 @@ 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

+ 7 - 5
blitz.mod/doc/shl.bmx

@@ -2,8 +2,10 @@ Rem
 Shl is a binary operator that performs the shift to left function.
 End Rem
 
-b=1
-for i=1 to 32
-	print bin(b)
-	b=b shl 1
-next
+SuperStrict
+
+Local b:Int = 1
+For Local i:Int = 1 To 32
+	Print Bin(b)
+	b=b Shl 1
+Next

+ 5 - 3
blitz.mod/doc/short.bmx

@@ -2,8 +2,10 @@ Rem
 Short is an unsigned 16 bit integer BlitzMax primitive type.
 End Rem
 
-Local a:short
+SuperStrict
 
-a=65536;print "a="+a	'prints 0
-a=-1;print "a="+a	'prints 65535
+Local a:Short
+
+a=65536;Print "a="+a	'prints 0
+a=-1;Print "a="+a	'prints 65535
 

+ 7 - 5
blitz.mod/doc/shr.bmx

@@ -2,8 +2,10 @@ Rem
 Shr is a binary operator that performs the shift to right function.
 End Rem
 
-b=-1
-for i=1 to 32
-	print bin(b)
-	b=b shr 1
-next
+SuperStrict
+
+Local b:Int = -1
+For Local i:Int = 1 To 32
+	Print Bin(b)
+	b=b Shr 1
+Next

+ 5 - 3
blitz.mod/doc/sin.bmx

@@ -2,6 +2,8 @@ Rem
 Sin:Double( x:Double )
 End Rem
 
-for d=0 to 360 step 45
-	print "Sin("+d+")="+sin(d)
-next
+SuperStrict
+
+For Local d:Int = 0 To 360 Step 45
+	Print "Sin("+d+")="+Sin(d)
+Next

+ 10 - 8
blitz.mod/doc/sizeof.bmx

@@ -2,21 +2,23 @@ Rem
 SizeOf returns the number of bytes of system memory used to store the variable.
 End Rem
 
+SuperStrict
+
 Type MyType
-	Field a,b,c
+	Field a:Int,b:Int,c:Int
 End Type
 
 Local t:MyType
-print sizeof t	'prints 12
+Print SizeOf t	'prints 12
 
 Local f!
-print sizeof f	'prints 8
+Print SizeOf f	'prints 8
 
-Local i
-print sizeof i	'prints 4
+Local i:Int
+Print SizeOf i	'prints 4
 
 Local b:Byte
-print sizeof b	'prints 1
+Print SizeOf b	'prints 1
 
-a$="Hello World"
-print sizeof a	'prints 22 (unicode characters take 2 bytes each)
+Local a:String="Hello World"
+Print SizeOf a	'prints 22 (unicode characters take 2 bytes each)

+ 3 - 1
blitz.mod/doc/sqr.bmx

@@ -2,8 +2,10 @@ Rem
 Square root of x
 End Rem
 
+SuperStrict
+
 Function Length!(x!,y!)
-	return Sqr(x*x+y*y)
+	Return Sqr(x*x+y*y)
 End Function
 
 Print "The length of the vector 25,3 is "+Length(25,3)

+ 3 - 1
blitz.mod/doc/step.bmx

@@ -4,6 +4,8 @@ End Rem
 
 ' count backwards from 10 to 0
 
-For i=10 to 0 step -1
+SuperStrict
+
+For Local i:Int = 10 To 0 Step -1
 	Print i
 Next

+ 3 - 1
blitz.mod/doc/string.bmx

@@ -2,5 +2,7 @@ Rem
 String is a BlitzMax container type containing a sequence of unicode characters.
 End Rem
 
-quote:String=Chr(34)
+SuperStrict
+
+Local quote:String=Chr(34)
 Print quote+"Hello World!"+quote

+ 6 - 4
blitz.mod/doc/super.bmx

@@ -2,18 +2,20 @@ Rem
 Super evaluates to Self cast to the method's immediate base class.
 End Rem
 
+SuperStrict
+
 Type TypeA
 	Method Report()
-		print "TypeA reporting"
+		Print "TypeA reporting"
 	End Method
 End Type
 
-Type TypeB extends TypeA
+Type TypeB Extends TypeA
 	Method Report()
 		Print "TypeB Reporting"
-		super.Report()
+		Super.Report()
 	End Method
 End Type
 
-b:TypeB=new TypeB
+Local b:TypeB=New TypeB
 b.Report()

+ 5 - 3
blitz.mod/doc/tan.bmx

@@ -2,6 +2,8 @@ Rem
 Tangent of x degrees
 End Rem
 
-for d=0 to 360 step 45
-	print "Tan("+d+")="+float(Tan(d))
-next
+SuperStrict
+
+For Local d:Int = 0 To 360 Step 45
+	Print "Tan("+d+")="+Float(Tan(d))
+Next

+ 2 - 0
blitz.mod/doc/then.bmx

@@ -2,4 +2,6 @@ Rem
 Then is an optional separator between the condition and the block of code following an If statement.
 End Rem
 
+SuperStrict
+
 If 3<5 Then Print "3<5"

+ 9 - 6
blitz.mod/doc/throw.bmx

@@ -2,12 +2,15 @@ Rem
 Throw generates a BlitzMax exception.
 End Rem
 
+SuperStrict
+
+Local a:Int
 Try
-	repeat
+	Repeat
 		a:+1
-		print a
-		if a>20 throw "chunks"
-	forever
-Catch a$
-	print "caught exception "+a$
+		Print a
+		If a>20 Throw "chunks"
+	Forever
+Catch e:String
+	Print "caught exception "+e
 EndTry

+ 4 - 2
blitz.mod/doc/to.bmx

@@ -2,6 +2,8 @@ Rem
 Followed by a constant which is used to calculate when to exit a For..Next loop.
 End Rem
 
-For i=1 To 5
-	print i
+SuperStrict
+
+For Local i:Int = 1 To 5
+	Print i
 Next

+ 2 - 0
blitz.mod/doc/true.bmx

@@ -2,6 +2,8 @@ Rem
 True is a Constant Integer assigned the value 1.
 End Rem
 
+SuperStrict
+
 Print "True="+True
 
 If True

+ 10 - 6
blitz.mod/doc/try.bmx

@@ -2,13 +2,17 @@ Rem
 Begin declaration of a Try block.
 End Rem
 
+SuperStrict
+
+Local a:Int
+
 Try
-	repeat
+	Repeat
 		a:+1
-		print a
-		if a>20 throw "chunks"
-	forever
-Catch a$
-	print "caught exception "+a$
+		Print a
+		If a>20 Throw "chunks"
+	Forever
+Catch e:String
+	Print "caught exception "+e
 EndTry
 

+ 4 - 2
blitz.mod/doc/type.bmx

@@ -6,11 +6,13 @@ convention to differentiate themselves from standard
 BlitzMax variable names.
 End Rem
 
+SuperStrict
+
 Type TVector
-	Field	x,y,z
+	Field x:Int,y:Int,z:Int
 End Type
 
-Local a:TVector=new TVector
+Local a:TVector=New TVector
 
 a.x=10
 a.y=20

+ 4 - 2
blitz.mod/doc/until.bmx

@@ -2,8 +2,10 @@ Rem
 Until marks the end of a Repeat block and is followed by a terminating condition.
 End Rem
 
-i=2
+SuperStrict
+
+Local i:Int = 2
 Repeat
-	print i
+	Print i
 	i:*2
 Until i>1000000

+ 4 - 2
blitz.mod/doc/var.bmx

@@ -3,16 +3,18 @@ Var is a composite type containing a reference to a variable of the
 specified Type.
 End Rem
 
+SuperStrict
+
 ' the following illustrates parsing function parameters by reference
 
-Function ReturnMultiplevalues(a Var,b Var,c Var)
+Function ReturnMultiplevalues(a:Int Var,b:Int Var,c:Int Var)
 	a=10
 	b=20
 	c=30
 	Return
 End Function
 
-Local x,y,z
+Local x:Int,y:Int,z:Int
 
 ReturnMultipleValues(x,y,z)
 

+ 6 - 4
blitz.mod/doc/varptr.bmx

@@ -2,9 +2,11 @@ Rem
 Varptr returns the address of a variable in system memory.
 End Rem
 
-Local a:int
-Local p:int ptr
+SuperStrict
+
+Local a:Int
+Local p:Int Ptr
 
 a=20
-p=varptr a
-print p[0]
+p=Varptr a
+Print p[0]

+ 5 - 1
blitz.mod/doc/wend.bmx

@@ -2,7 +2,11 @@ Rem
 Wend marks the end of a While section.
 End Rem
 
+SuperStrict
+
+Local i:Int
+
 While i<5
-	print i
+	Print i
 	i:+1
 Wend

+ 4 - 3
blitz.mod/doc/while.bmx

@@ -2,12 +2,13 @@ Rem
 While executes the following section of code repeatedly while a given condition is true.
 End Rem
 
+SuperStrict
+
 Graphics 640,480
 While Not KeyHit(KEY_ESCAPE)	'loop until escape key is pressed
 	Cls
-	For i=1 to 200
-		DrawLine rnd(640),rnd(480),rnd(640),rnd(480)
+	For Local i:Int = 1 To 200
+		DrawLine Rnd(640),Rnd(480),Rnd(640),Rnd(480)
 	Next
 	Flip
 Wend
-