Browse Source

Added retro examples.

woollybah 6 years ago
parent
commit
7a3cbda4f6

+ 7 - 0
retro.mod/doc/bin.bmx

@@ -0,0 +1,7 @@
+' Prints the binary representation of a number
+
+SuperStrict
+
+Print Bin(1)
+Print Bin(554)
+Print Bin(1 | 554) ' OR in action

+ 6 - 0
retro.mod/doc/hex.bmx

@@ -0,0 +1,6 @@
+SuperStrict
+
+For Local t:Int=0 To 255
+	If Not(t Mod 16) Print
+	Print "decimal: "+RSet(t,3)+" | hex: "+Hex(t)
+Next

+ 11 - 0
retro.mod/doc/instr.bmx

@@ -0,0 +1,11 @@
+SuperStrict
+
+Local mystring:String = "*sniffage*, I need more media!"
+
+' check for the position
+Print Instr(mystring,"more")
+
+If Instr(mystring,"new PC") Print "large!"
+If Not Instr(mystring,"new PC") Print "*sniff*"
+
+If Instr(mystring,"media") Print "large!"

+ 3 - 0
retro.mod/doc/left.bmx

@@ -0,0 +1,3 @@
+SuperStrict
+
+Print Left("12345678",4)   ' prints 1234

+ 3 - 0
retro.mod/doc/lower.bmx

@@ -0,0 +1,3 @@
+SuperStrict
+
+Print Lower("abcdEFGH")     ' prints abcdefgh

+ 9 - 0
retro.mod/doc/lset.bmx

@@ -0,0 +1,9 @@
+SuperStrict
+
+Print LSet("12345678",3)
+Print "["+LSet("12345678",10)+"]"
+
+' ==============
+' Output
+' 123
+' [12345678  ]

+ 4 - 0
retro.mod/doc/mid.bmx

@@ -0,0 +1,4 @@
+SuperStrict
+
+Local a:String = "abcd1234efgh"
+Print Mid(a,5,5)   ' prints 1234e

+ 8 - 0
retro.mod/doc/replace.bmx

@@ -0,0 +1,8 @@
+SuperStrict
+
+Local str:String = "This is a test of the Replace command."
+Print "Original: "+str
+
+str = Replace(str,"e","*")
+
+Print "Altered: "+str

+ 3 - 0
retro.mod/doc/right.bmx

@@ -0,0 +1,3 @@
+SuperStrict
+
+Print Right("12345678",4)   ' prints 5678

+ 9 - 0
retro.mod/doc/rset.bmx

@@ -0,0 +1,9 @@
+SuperStrict
+
+Print RSet("12345678",3)
+Print "["+RSet("12345678",10)+"]"
+
+' ==============
+' Output
+' 678
+' [  12345678]

+ 3 - 0
retro.mod/doc/upper.bmx

@@ -0,0 +1,3 @@
+SuperStrict
+
+Print Upper("Hello World") ' prints HELLO WORLD