Added _release/help

This commit is contained in:
blitz-research
2014-02-26 16:08:39 +13:00
parent 7eb5929eb4
commit 4e8d25d630
790 changed files with 33580 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

@@ -0,0 +1,38 @@
<html><head><title>Command: ACos </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ACos (number)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the smallest angle (in degrees) satisfying the arc cosine (inverse cosine) of the supplied argument.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>number=float or integer representing a ratio of the "X" coordinate to the tangential displacement.<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command is used for translating X/Y coordinate values to angles. Remember that the computer screen uses an inverted y-axis (values get larger the further down the screen).</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Graphics 640,480<br>
Repeat<br>
Cls<br>
; Determine the positions and the length of the hypotenuse<br>
x# = MouseX() ; displacement across the screen.<br>
y# = MouseY() ; displacement down the screen.<br>
r# = Sqr((x#*x#)+(y#*y#)) ; length of the hypotenuse.<br>
<br>
; Draw the axes<br>
Color 104,104,104<br>
Line x#,0,x#,y# ; draw a line from the top to the cursor.<br>
Line 0,y#,x#,y# ; draw a line from the left to the cursor.<br>
Locate x#+10,y#-10 : Write "X=" : Print x#<br>
Locate x#-10,y#+10 : Write "Y=" :Print y#<br>
<br>
; reset any drawing to the top right<br>
Origin 0,0<br>
<br>
; Draw the angled line<br>
Color 255,255,255<br>
Line 0,0,x#,y# ; draw a line from the top right corner of the screen to the cursor.<br>
theta# = ACos(x#/r#) ; the angle between the x axis and the y axis.<br>
Locate 60,10 : Write "Angle:" : Print theta<br>
<br>
; Draws an arc showing the angle.<br>
For degrees#=0 To theta#; Step though all the degrees in the angle<br>
; The next line calculates the X and Y coordinates of the point of the circle using the Sin and Cos<br>
; commands, and multiplies it by 50 (to get a larger radius, try and change it).<br>
cy=Sin(degrees#)*50<br>
cx=Cos(degrees#)*50<br>
Plot cx,cy ; Draw the current point on the circle.<br>
Next ; Give us another angle<br>
<br>
Flip<br>
; Use the ESCAPE key to quit<br>
Until KeyDown(1)<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,38 @@
<html><head><title>Command: ASin </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ASin (number)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the smallest angle (in degrees) satisfying the arc sine (inverse sine) of the supplied argument.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>number=float or integer representing a ratio of the "Y" coordinate to the tangential displacement.<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command is used for translating X/Y coordinate values to angles. Remember that the computer screen uses an inverted y-axis (values get larger the further down the screen).</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Graphics 640,480<br>
Repeat<br>
Cls<br>
; Determine the positions and the length of the hypotenuse<br>
x# = MouseX() ; displacement across the screen.<br>
y# = MouseY() ; displacement down the screen.<br>
r# = Sqr((x#*x#)+(y#*y#)) ; length of the hypotenuse.<br>
; Draw the axes<br>
Color 104,104,104<br>
Line x#,0,x#,y# ; draw a line from the top to the cursor.<br>
Line 0,y#,x#,y# ; draw a line from the left to the cursor.<br>
Locate x#+10,y#-10 : Write "X=" : Print x#<br>
Locate x#-10,y#+10 : Write "Y=" :Print y#<br>
<br>
; reset any drawing to the top right<br>
Origin 0,0<br>
<br>
; Draw the angled line<br>
Color 255,255,255<br>
Line 0,0,x#,y# ; draw a line from the top right corner of the screen to the cursor.<br>
theta# = ASin(y#/r#) ; the angle between the x axis and the y axis.<br>
Locate 60,10 : Write "Angle:" : Print theta<br>
<br>
; Draws an arc showing the angle.<br>
For degrees#=0 To theta#; Step though all the degrees in the angle<br>
; The next line calculates the X and Y coordinates of the point of the circle using the Sin and Cos<br>
; commands, and multiplies it by 50 (to get a larger radius, try and change it).<br>
cy=Sin(degrees#)*50<br>
cx=Cos(degrees#)*50<br>
Plot cx,cy ; Draw the current point on the circle.<br>
Next ; Give us another angle<br>
<br>
Flip<br>
; Use the ESCAPE key to quit<br>
Until KeyDown(1)<br>
End<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,27 @@
<html><head><title>Command: ATan </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ATan (float)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the angle from the X axis to a point (y,x).</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>float = floating point value (degrees)</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Aside from its basic trig usage, this nifty command will allow you to derive an angle based on the x and y speed of a travelling object. Also see <a href='ATan2.htm'>ATan2</a>.<br>
</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Set graphics w/double buffering<br>
Graphics 640,480,16,0<br>
SetBuffer BackBuffer()<br>
<br>
; Starting point for our travelling box<br>
x=0<br>
y=0<br>
<br>
; random speed values for travelling<br>
xSpeed#=Rand(5)<br>
ySpeed#=Rand(5)<br>
<br>
; repeat until the ESC or box travels off the screen<br>
While Not KeyHit(1) Or y > 480 Or x > 640<br>
Cls<br>
; Draw our box<br>
Rect x,y,10,10,1<br>
; increment the box location based on random speed<br>
x=x+xSpeed<br>
y=y+yspeed<br>
; print the angle of our box travel<br>
Text 0,0,ATan(yspeed/xspeed)<br>
Flip<br>
Wend<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,29 @@
<html><head><title>Command: ATan2 </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ATan2 (xvalue,yvalue)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the angle from the X axis to a point (y,x).</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>(yvalue,xvalue)</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Aside from its basic trig usage, this nifty command will allow you to derive an angle based on the x and y speed of a travelling object.<br>
</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Atan2 example<br>
<br>
; Set graphics w/double buffering<br>
Graphics 640,480,16,0<br>
SetBuffer BackBuffer()<br>
<br>
; Starting point for our travelling box<br>
x=0<br>
y=0<br>
<br>
; random speed values for travelling<br>
xSpeed=Rand(5)<br>
ySpeed=Rand(5)<br>
<br>
; repeat until the ESC or box travels off the screen<br>
While Not KeyHit(1) Or y > 480 Or x > 640<br>
Cls<br>
; Draw our box<br>
Rect x,y,10,10,1<br>
; increment the box location based on random speed<br>
x=x+xSpeed<br>
y=y+yspeed<br>
; print the angle of our box travel<br>
Text 0,0,ATan2(yspeed,xspeed)<br>
Flip<br>
Wend<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,7 @@
<html><head><title>Command: Abs </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Abs (number)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the absolute (positive) value of a number.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>number = any valid number or numeric variable</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to return the absolute value of a number; meaning its positive value. A negative 3 would become a positive 3. If what you want is a number without a fraction (say, convert 3.1415 into 3) use the Int() command.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>number=-3<br>
<br>
Print "The absolute value of " + number + " is: " + Abs(number)<br>
<br>
WaitKey()<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,57 @@
<html><head><title>Command: AcceptTCPStream </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;AcceptTCPStream (serverhandle)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Accepts an incoming TCP/IP stream.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>serverhandle = the server handle assigned when the server was created</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Accepts an incoming TCP/IP stream, and returns a TCP/IP stream if one is available, or 0 if not.<br>
<br>
See <a href='CreateTCPServer.htm'>CreateTCPServer</a> and <a href='CloseTCPServer.htm'>CloseTCPServer</a>.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CreateTCPServer, CloseTCPServer, AcceptTCPStream Example<br>
; This code is in two parts, and needs to be run seperately on the same machine<br>
<br>
; --- Start first code set ---<br>
; Create a server and listen for push<br>
<br>
svrGame=CreateTCPServer(8080)<br>
<br>
If svrGame<>0 Then <br>
Print "Server started successfully."<br>
Else<br>
Print "Server failed to start."<br>
End<br>
End If<br>
<br>
While Not KeyHit(1)<br>
strStream=AcceptTCPStream(svrGame)<br>
If strStream Then <br>
Print ReadString$(strStream)<br>
Delay 2000<br>
End<br>
Else <br>
Print "No word from Apollo X yet ..."<br>
Delay 1000<br>
End If <br>
Wend<br>
<br>
End<br>
<br>
; --- End first code set ---<br>
<br>
<br>
; --- Start second code set ---<br>
; Copy this code to another instance of Blitz Basic<br>
; Run the above code first, then run this ... they will 'talk'<br>
<br>
; Create a Client and push data<br>
<br>
strmGame=OpenTCPStream("127.0.0.1",8080)<br>
<br>
If strmGame<>0 Then <br>
Print "Client Connected successfully."<br>
Else<br>
Print "Server failed to connect."<br>
WaitKey <br>
End<br>
End If<br>
<br>
; write stream to server<br>
WriteString strmGame,"Mission Control, this is Apollo X ..."<br>
Print "Completed sending message to Mission control..."<br>
<br>
; --- End second code set ---<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,43 @@
<html><head><title>Command: After </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;After custom_type_variable&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Move the object pointer to the next object in the Type collection.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>custom_type_variable = not the Type name, but the custom Type name</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>If you haven't read up on the <a href='TYPE.htm'>TYPE</a>
command, you might want to do so before continuing.</p>
<p>Use this to assign a custom Type object to the next object in the collection.
See the example.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Define a crafts Type</p>
<p>Type crafts<br>
Field x<br>
Field y<br>
Field dead<br>
Field graphic<br>
End Type</p>
<p>; Create 100 crafts, with the unique name of alien<br>
For t = 1 To 100 <br>
alien.crafts = New crafts<br>
alien\x = Rnd(0,640)<br>
alien\y = Rnd(0,480)<br>
alien\dead = 0<br>
alien\graphic = 1<br>
Next</p>
<p>; Move to the first object<br>
alien.crafts = First crafts</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the next alien object<br>
alien = After alien</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the last alien object<br>
alien.crafts = Last crafts</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the second to the last alien object<br>
alien = Before alien</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,12 @@
<html><head><title>Command: And </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;And &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Logical operator comparative command for testing expressions.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>AND is a logical operator for doing conditional checks of multiple values and/or expressions. Use this to ensure that two or more conditions are true, usually in an <a href='IF.htm'>IF</a> ... <a href='THEN.htm'>THEN</a> conditional. See example and see <a href='OR.htm'>OR</a>, <a href='NOT.htm'>NOT</a>, and <a href='XOR.htm'>XOR</a>.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; AND example<br>
<br>
name$=Input$("Enter your name:")<br>
pw$=Input$("Password:")<br>
<br>
if name$="Shane" and pw$="bluedog" then<br>
print "Access granted! Welcome!"<br>
else<br>
print "Your name or password was not recogized"<br>
end if<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,5 @@
<html><head><title>Command: AppTitle </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;AppTitle string&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Sets the title bar of the program.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>string = any legal string variable</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Allows you to set the text of the program's Title Bar.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Set the title bar<br>
<br>
AppTitle "Super Invaders V1.0"<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,4 @@
<html><head><title>Command: Asc </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Asc (string$)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the ASCII value of the first letter of a string.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>string$ = any valid string variable (only the first character's ASCII value will be returned).</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This will return the ASCII value of the first letter of a string.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>a$=Input$("Enter a letter:")<br>
Print "The ASCII value of the letter is:" + Asc(a$)<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,55 @@
<html><head><title>Command: AutoMidHandle </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;AutoMidHandle true/false&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Automatically sets the image handle of loaded images to the middle of the image.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>true = images load with midhandle set as default<br>
false = images load with default image handles at 0,0<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>When an image is loaded with <a href='LoadImage.htm'>LoadImage</a>, the image handle (the location within the image where the image is 'drawn from') is always defaulted to the top left corner (coordinates 0,0). This means if you draw an image that is 50x50 pixels at screen location 200,200, the image will begin to be drawn at 200,200 and extend to 250,250.<br>
<br>
The <a href='MidHandle.htm'>MidHandle</a> command moves the image's handle to the middle of the image. See this command for more information about the image's handle.<br>
<br>
This command eliminates the need for the <a href='MidHandle.htm'>MidHandle</a> command by making ALL subsequently loaded images default to having their image handles set to mid.<br>
<br>
Note about the term 'handle'. There are two types of 'handles' we discuss in these documents. One is the location within an image - as discussed in this command. The other is a 'file handle', a variable used to hold an image, sound, or font loaded with a command. See <a href='LoadImage.htm'>LoadImage</a> for more information about file handles.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; MidHandle/ImageXHandle()/ImageYHandle()/AutoMidHandle<br>
<br>
; Initiate Graphics Mode<br>
Graphics 640,480,16<br>
<br>
; Set up the image file handle as a global<br>
Global gfxBall<br>
<br>
; Load the image - you may need to change the location of the file<br>
gfxBall=LoadImage ("C:\Program Files\Blitz Basic\samples\ball.bmp")<br>
<br>
; Until the user presses ESC key ...<br>
While Not KeyHit(1)<br>
Text 0,0,"Default Image Handle for gfxBall... Press ESC ..."<br>
Text 0,14,"X handle-" + ImageXHandle(gfxBall) ; Print the location of the image handle x location<br>
Text 0,28,"Y handle-" + ImageYHandle(gfxBall) ; Print the location of the image handle y location<br>
DrawImage gfxBall,200,200,0 ; draw the image at 200,200<br>
Wend<br>
<br>
; Clear the screen<br>
Cls<br>
<br>
; Set the ball's handle to the center of the image<br>
MidHandle gfxBall<br>
<br>
; Until the user presses ESC key ... show the new information<br>
While Not KeyHit(1)<br>
Text 0,0,"New Image Handle for gfxBall... Press ESC ..."<br>
Text 0,14,"X handle-" + ImageXHandle(gfxBall)<br>
Text 0,28,"Y handle-" + ImageYHandle(gfxBall)<br>
DrawImage gfxBall,200,200,0<br>
Wend<br>
<br>
; Makes all images load up with their handles in the center of the image<br>
AutoMidHandle True<br>
Cls<br>
<br>
; Load the image again<br>
gfxBall=LoadImage ("C:\Program Files\Blitz Basic\samples\ball.bmp")<br>
<br>
; Until the user presses ESC key ... show the new information<br>
While Not KeyHit(1)<br>
Text 0,0,"Automatic image handle of gfxBall... Press ESC ..."<br>
Text 0,14,"X handle-" + ImageXHandle(gfxBall)<br>
Text 0,28,"Y handle-" + ImageYHandle(gfxBall)<br>
DrawImage gfxBall,200,200,0<br>
Wend<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,2 @@
<html><head><title>Command: AvailVidMem() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;AvailVidMem() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the available free video memory.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command will return the total bytes of available free video memory. Use this to keep track of your resources!</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Print "Your available video memory is: " + AvailVidMem()<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,21 @@
<html><head><title>Command: BackBuffer() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;BackBuffer() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Indicates the BackBuffer drawing buffer.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This is a value usually used with <a href='SETBUFFER.htm'>SETBUFFER</a> to denote the secondary non-visible drawing buffer called the Back Buffer. In MOST gaming situations, you will want to be using the BackBuffer() for drawing operations then using <a href='Flip.htm'>Flip</a> to bring that buffer to the <a href='FrontBuffer().htm'>FrontBuffer()</a> where it can be seen. There are other uses for the command, but this is the biggie. See <a href='SETBUFFER.htm'>SETBUFFER</a> for more info, and check out the example. Once again - if you set drawing operations to the BackBuffer() you will NOT see any of them until you call FLIP.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Flip/Backbuffer()/Rect Example<br>
<br>
; Set Graphics Mode<br>
Graphics 640,480<br>
<br>
; Go double buffering<br>
SetBuffer BackBuffer()<br>
<br>
; Setup initial locations for the box<br>
box_x = -20 ; negative so it will start OFF screen<br>
box_y = 100<br>
<br>
While Not KeyHit(1)<br>
Cls ; Always clear screen first<br>
Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location<br>
Flip ; Flip it into view<br>
box_x = box_x + 1 ; Move the box over one pixel<br>
If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location<br>
Wend<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,20 @@
<html><head><title>Command: BankSize </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;BankSize (bankhandle)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the size of a bank.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>bankhandle=handle assigned to the bank when created.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to determing the size of an existing bank. See <a href='CreateBank.htm'>CreateBank</a>, <a href='ResizeBank.htm'>ResizeBank</a>, and <a href='CopyBank.htm'>CopyBank</a>.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; BankSize, ResizeBank, CopyBank Example<br>
<br>
; create a bank<br>
bnkTest=CreateBank(5000)<br>
<br>
; Fill it with rand Integers<br>
For t = 0 To 4999<br>
PokeByte bnkTest,t,Rand(9)<br>
Next<br>
<br>
; Resize the bank<br>
ResizeBank bnkTest,10000<br>
<br>
; Copy the first half of the bank to the second half<br>
CopyBank bnkTest,0,bnkTest,5000,5000 <br>
<br>
; Print final banksize<br>
Print BankSize(bnkTest)<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,43 @@
<html><head><title>Command: Before </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Before custom_type_variable&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Move the object pointer to the previous object in the Type collection.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>custom_type_variable = not the Type name, but the custom Type name</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>If you haven't read up on the <a href='TYPE.htm'>TYPE</a>
command, you might want to do so before continuing.</p>
<p>Use this to assign a custom Type object to the previous object in the collection.
See the example.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Define a crafts Type</p>
<p>Type crafts<br>
Field x<br>
Field y<br>
Field dead<br>
Field graphic<br>
End Type</p>
<p>; Create 100 crafts, with the unique name of alien<br>
For t = 1 To 100 <br>
alien.crafts = New crafts<br>
alien\x = Rnd(0,640)<br>
alien\y = Rnd(0,480)<br>
alien\dead = 0<br>
alien\graphic = 1<br>
Next</p>
<p>; Move to the first object<br>
alien.crafts = First crafts</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the next alien object<br>
alien = After alien</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the last alien object<br>
alien.crafts = Last crafts</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the second to the last alien object<br>
alien = Before alien</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,3 @@
<html><head><title>Command: Bin$ </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Bin$ (integer)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Converts an integer value to a binary value.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>integer = any valid integer or integer variable</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Converts integer values into binary values. If you don't know what binary is, you don't need to know this command :)</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>intValue="64738"<br>
Print "The binary value of "+intValue+" is: " + bin$(intValue)<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,7 @@
<html><head><title>Command: CPUTimer() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CPUTimer() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the current value of the CPU timer.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This returns a constantly counting up timer, apparently from the CPU. Seems to always be negative. This could be useful for soem randomize seed, but for any sort of 'time tracking', I would use <a href='Millisecs().htm'>Millisecs()</a>. This command could be outdated, and just not removed from the product.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>;CPUTIMER() example<br>
<br>
While Not keyhit(1)<br>
Print CPUTimer()<br>
Wend<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,27 @@
<html><head><title>Command: Case </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Case value&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Begins the set of commands in a SELECT structure if the value of SELECT is met.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>value = any valid value of the SELECT variable</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>When using a <a href='SELECT.htm'>SELECT</a> structure, the CASE command defines the starting point of command execution if the SELECT value matches the CASE value. If the SELECT value doesn't match the CASE value, the commands following it are ignored until the next CASE, <a href='DEFAULT.htm'>DEFAULT</a>, or <a href='END SELECT.htm'>END SELECT</a> command is encountered. See <a href='SELECT.htm'>SELECT</a> and the example for a better understanding.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; SELECT/CASE/DEFAULT/END SELECT Example<br>
; Assign a random number 1-10<br>
mission=Rnd(1,10)<br>
<br>
; Start the selection process based on the value of 'mission' variable<br>
Select mission<br>
<br>
; Is mission = 1?<br>
Case 1<br>
Print "Your mission is to get the plutonium and get out alive!"<br>
<br>
; Is mission = 2?<br>
Case 2<br>
Print "Your mission is to destroy all enemies!"<br>
<br>
; Is mission = 3?<br>
Case 3 <br>
Print "Your mission is to steal the enemy building plans!"<br>
<br>
; What do do if none of the cases match the value of mission<br>
Default <br>
Print "Missions 4-10 are not available yet!"<br>
<br>
; End the selection process<br>
End Select<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,12 @@
<html><head><title>Command: Ceil# </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Ceil# (float)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Rounds a decimal floating variable up to the nearest whole number.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>float=floating point number</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Many times, you will need to round up or down a floating point decimal variable. This command rounds it up to the nearest whole number. Use <a href='Floor#.htm'>Floor#</a> to round the number down.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Floor#/Ceil# Example<br>
<br>
; Set a floating point variable<br>
myVal#=0.5<br>
<br>
; Round it up<br>
Print Floor#(myval)<br>
<br>
;Round it down<br>
Print Ceil#(myval)<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,6 @@
<html><head><title>Command: ChangeDir </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ChangeDir directory/path&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Changes the currently selected directory for file operations.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>directory/path = full path to directory/folder</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command will change the currently selected directory for disk operations, useful for advanced file operations. Use <a href='CURRENTDIR$().htm'>CURRENTDIR$()</a> to see what the current directory is.<br>
Use a directory/path of ".." to change to the parent of the current directory, unless you are at the root directory of the drive, then no change happens.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; ChangeDir example<br>
<br>
ChangeDir "c:\winnt\system32"<br>
Print "The folder has been changed to: " + currentdir$()<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,43 @@
<html><head><title>Command: ChannelPan </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ChannelPan channel_handle, pan#&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Pans sound channel between the left and right channels.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>channel_handle = variable assigned to the channel when played<br>
pan# = panning floating value to denote channel playback<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>When you want to do real sound panning effects, this is the command you'll use. This will allow you to pan the sound channels on a 'per channel' basis between the left and right speakers. This command makes it very easy to produce some really killer stereophonic effects!<br>
<br>
The pan value is between -1 and 1 with 0 being perfect center. -1 is full left, and 1 is full right. To make it somewhere in between, try -.5 for 50% left or .75 for 75% right.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Channel examples<br>
<br>
Print "Loading sound ..."<br>
; Load the sample - you'll need to point this to a sound on your computer<br>
; For best results, make it about 5-10 seconds...<br>
sndWave=LoadSound("level1.wav")<br>
; Prepare the sound for looping<br>
LoopSound sndWave<br>
<br>
chnWave=PlaySound(sndWave)<br>
<br>
Print "Playing sound for 2 seconds ..."<br>
Delay 2000<br>
<br>
Print "Pausing sound for 2 seconds ..."<br>
PauseChannel chnWave<br>
Delay 2000<br>
<br>
Print "Restarting sound ..."<br>
ResumeChannel chnWave<br>
Delay 2000<br>
<br>
Print "Changing Pitch of sound ..."<br>
ChannelPitch chnWave, 22000<br>
Delay 2000<br>
<br>
Print "Playing new pitched sound ..."<br>
Delay 2000<br>
<br>
Print "Left speaker only"<br>
ChannelPan chnWave,-1<br>
Delay 2000<br>
<br>
Print "Right speaker only"<br>
ChannelPan chnWave,1<br>
Delay 2000<br>
<br>
Print "All done!"<br>
StopChannel chnWave<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,43 @@
<html><head><title>Command: ChannelPitch </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ChannelPitch channel_handle, hertz&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Alters the hertz pitch of a playing sound channel.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>channel_handle = variable assigned to the channel when played<br>
hertz = pitch to apply to the channel (try 8000-44000)<br>
</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>You can alter the hertz pitch of a sound channel that is playing (or in use and just paused). I'm sure you can think of numerous uses for this command! Use the frequency of your sound as the 'baseline' for pitch change. So if your sample is at 11025 hertz, increase the pitch to 22050 to make the pitch higher, 8000 to make it lower, etc. While similar to <a href='SoundPitch.htm'>SoundPitch</a>, this command let's you change the pitch individually of each and every channel in use.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Channel examples<br>
<br>
Print "Loading sound ..."<br>
; Load the sample - you'll need to point this to a sound on your computer<br>
; For best results, make it about 5-10 seconds...<br>
sndWave=LoadSound("level1.wav")<br>
; Prepare the sound for looping<br>
LoopSound sndWave<br>
<br>
chnWave=PlaySound(sndWave)<br>
<br>
Print "Playing sound for 2 seconds ..."<br>
Delay 2000<br>
<br>
Print "Pausing sound for 2 seconds ..."<br>
PauseChannel chnWave<br>
Delay 2000<br>
<br>
Print "Restarting sound ..."<br>
ResumeChannel chnWave<br>
Delay 2000<br>
<br>
Print "Changing Pitch of sound ..."<br>
;StopChannel chnWave<br>
ChannelPitch chnWave, 22000<br>
Delay 2000<br>
<br>
Print "Playing new pitched sound ..."<br>
Delay 2000<br>
<br>
Print "Left speaker only"<br>
ChannelPan chnWave,-1<br>
Delay 2000<br>
<br>
Print "Right speaker only"<br>
ChannelPan chnWave,1<br>
Delay 2000<br>
<br>
Print "All done!"<br>
StopChannel chnWave<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,16 @@
<html><head><title>Command: ChannelPlaying </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ChannelPlaying (channel_handle)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Checks to see if a sound channel is still playing.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>channel_handle = variable assigned to the channel when played<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Often you will need to know if a sound channel has completed playing or not. This command will return 1 if the sound is still playing or 0 if it has stopped. Use this to restart your background music or some other sound that might have stopped unintentionally.<br>
<br>
Note: This command currently doesn't seem to work with a channel assigned to CD track playback.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Channel examples<br>
<br>
Print "Loading sound ..."<br>
; Load the sample - you'll need to point this to a sound on your computer<br>
; For best results, make it about 5-10 seconds...<br>
sndWave=LoadSound("level1.wav")<br>
<br>
Print "Playing full sample until sound is done ..."<br>
chnWave=PlaySound(sndWave) <br>
While ChannelPlaying(chnWave)<br>
Wend
<br>
Print "All done!"<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,43 @@
<html><head><title>Command: ChannelVolume </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ChannelVolume channel_handle, volume#&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Adjusts the volume level of a sound channel.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>channel_handle = variable assigned to the channel when played<br>
volume# = volume level floating value between 0 and 1<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>While <a href='SoundVolume.htm'>SoundVolume</a> happily changes the volume of the entire program, this command will let you adjust volume rates on a 'per channel' basis. Extremely useful.<br>
<br>
The volume value is a floating point value between 0 and 1 (0 = silence, .5 = half volume, 1= full volume). You can do other cool stuff like <a href='ChannelPitch.htm'>ChannelPitch</a> and <a href='ChannelPan.htm'>ChannelPan</a> too!</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Channel examples<br>
<br>
Print "Loading sound ..."<br>
; Load the sample - you'll need to point this to a sound on your computer<br>
; For best results, make it about 5-10 seconds...<br>
sndWave=LoadSound("level1.wav")<br>
; Prepare the sound for looping<br>
LoopSound sndWave<br>
<br>
chnWave=PlaySound(sndWave)<br>
<br>
Print "Playing sound for 2 seconds ..."<br>
Delay 2000<br>
<br>
Print "Pausing sound for 2 seconds ..."<br>
PauseChannel chnWave<br>
Delay 2000<br>
<br>
Print "Restarting sound ..."<br>
ResumeChannel chnWave<br>
Delay 2000<br>
<br>
Print "Changing volume of sound ..."<br>
ChannelVolume chnWave, .5<br>
Delay 2000<br>
<br>
Print "Playing new half-volume sound ..."<br>
Delay 2000<br>
<br>
Print "Left speaker only"<br>
ChannelPan chnWave,-1<br>
Delay 2000<br>
<br>
Print "Right speaker only"<br>
ChannelPan chnWave,1<br>
Delay 2000<br>
<br>
Print "All done!"<br>
StopChannel chnWave<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,2 @@
<html><head><title>Command: Chr$ </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Chr$ (integer)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Converts an ASCII code to its corresponding character string.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>integer = valid ASCII code integer value</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to convert a known ASCII code (for example 65) to its character string equivelant (i.e. the letter "A").</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Print " The character for ASCII value 65 is: " + Chr$(65)<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,32 @@
<html><head><title>Command: CloseDir </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CloseDir filehandle&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Closes a directory previously opened with the ReadDir command.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>filehandle = valid filehandle assigned from the ReadDir command</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Once you are finished with <a href='NextFile$.htm'>NextFile$</a> on the directory previously opened for read with the <a href='ReadDir.htm'>ReadDir</a> command, use this command to close the directory. This is good programming practice!
</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; ReadDir/NextFile$/CloseDir example<br>
<br>
; Define what folder to start with ...<br>
folder$="C:\"<br>
<br>
; Open up the directory, and assign the handle to myDir<br>
myDir=ReadDir(folder$)<br>
<br>
; Let's loop forever until we run out of files/folders to list!<br>
Repeat<br>
; Assign the next entry in the folder to file$<br>
file$=NextFile$(myDir)<br>
<br>
; If there isn't another one, let's exit this loop<br>
If file$="" Then Exit<br>
<br>
; Use FileType to determine if it is a folder (value 2) or a file and print results<br>
If FileType(folder$+"\"+file$) = 2 Then<br>
Print "Folder:" + file$<br>
Else<br>
Print "File:" + file$<br>
End If<br>
Forever<br>
<br>
; Properly close the open folder<br>
CloseDir myDir<br>
<br>
; We're done!<br>
Print "Done listing files!"<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,51 @@
<html><head><title>Command: CloseFile </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CloseFile filehandle&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Closes a file previously opened with a file operations command.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>filehandle = variable defined with the WriteFile or OpenFile command</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to close a file previously opened. You should always close a file as soon as you have finished reading or writing to it.<br>
<br>
See also:<br>
<a href='ReadByte.htm'>ReadByte</a>, <a href='ReadShort.htm'>ReadShort</a>, <a href='ReadInt.htm'>ReadInt</a>, <a href='ReadFloat.htm'>ReadFloat</a>, <a href='ReadString$.htm'>ReadString$</a>, <a href='ReadLine$.htm'>ReadLine$</a>, <a href='WriteByte.htm'>WriteByte</a>, <a href='WriteShort.htm'>WriteShort</a>, <a href='WriteInt.htm'>WriteInt</a>, <a href='WriteFloat.htm'>WriteFloat</a>, <a href='WriteShort.htm'>WriteShort</a>, <a href='WriteString.htm'>WriteString</a>, <a href='WriteLine.htm'>WriteLine</a>, <a href='ReadFile.htm'>ReadFile</a>, <a href='WriteFile.htm'>WriteFile</a>, <a href='OpenFile.htm'>OpenFile</a>, <a href='CloseFile.htm'>CloseFile</a>, <a href='Eof.htm'>Eof</a>, <a href='FileType.htm'>FileType</a>, <a href='FilePos.htm'>FilePos</a>, <a href='SeekFile.htm'>SeekFile</a></td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Reading and writing custom types to files using ReadFile, WriteFile and CloseFile<br>
<br>
; Initialise some variables for the example<br>
Type HighScore<br>
Field Name$<br>
Field Score%<br>
Field Level%<br>
End Type<br>
<br>
Best.HighScore = New HighScore<br>
Best\Name = "Mark"<br>
Best\Score = 11657<br>
Best\Level = 34<br>
<br>
; Open a file to write to<br>
fileout = WriteFile("mydata.dat")<br>
<br>
; Write the information to the file<br>
WriteString( fileout, Best\Name )<br>
WriteInt( fileout, Best\Score )<br>
WriteByte( fileout, Best\Level )<br>
<br>
; Close the file<br>
CloseFile( fileout )<br>
<br>
; Open the file to Read<br>
filein = ReadFile("mydata.dat")<br>
<br>
; Lets read the Greatest score from the file<br>
Greatest.HighScore = New HighScore<br>
Greatest\Name$ = ReadString$( filein )<br>
Greatest\Score = ReadInt( filein )<br>
Greatest\Level = ReadByte( filein )<br>
<br>
; Close the file once reading is finished<br>
CloseFile( fileout )<br>
<br>
Print "High score record read from - mydata.dat "<br>
Print<br>
Write "Name = "<br>
Print Greatest\Name<br>
Write "Score = "<br>
Print Greatest\Score<br>
Write "Level = "<br>
Print Greatest\Level<br>
<br>
WaitKey()<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,55 @@
<html><head><title>Command: CloseTCPServer </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CloseTCPServer serverhandle&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Closes a TCP server.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>serverhandle = handle assigned when the server was created.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Closes a TCP/IP server previously created with the <a href='CreateTCPServer.htm'>CreateTCPServer</a> command.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CreateTCPServer, CloseTCPServer, AcceptTCPStream Example<br>
; This code is in two parts, and needs to be run seperately on the same machine<br>
<br>
; --- Start first code set ---<br>
; Create a server and listen for push<br>
<br>
svrGame=CreateTCPServer(8080)<br>
<br>
If svrGame<>0 Then <br>
Print "Server started successfully."<br>
Else<br>
Print "Server failed to start."<br>
End<br>
End If<br>
<br>
While Not KeyHit(1)<br>
strStream=AcceptTCPStream(svrGame)<br>
If strStream Then <br>
Print ReadString$(strStream)<br>
Delay 2000<br>
End<br>
Else <br>
Print "No word from Apollo X yet ..."<br>
Delay 1000<br>
End If <br>
Wend<br>
<br>
End<br>
<br>
; --- End first code set ---<br>
<br>
<br>
; --- Start second code set ---<br>
; Copy this code to another instance of Blitz Basic<br>
; Run the above code first, then run this ... they will 'talk'<br>
<br>
; Create a Client and push data<br>
<br>
strmGame=OpenTCPStream("127.0.0.1",8080)<br>
<br>
If strmGame<>0 Then <br>
Print "Client Connected successfully."<br>
Else<br>
Print "Server failed to connect."<br>
WaitKey <br>
End<br>
End If<br>
<br>
; write stream to server<br>
WriteString strmGame,"Mission Control, this is Apollo X ..."<br>
Print "Completed sending message to Mission control..."<br>
<br>
; --- End second code set ---<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,27 @@
<html><head><title>Command: CloseTCPStream </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CloseTCPStream streamhandle&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Closes the specified TCP stream.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>streamhandle = handle assigned when the stream was opened.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Once you've completed the use of your TCP/IP stream, close the connection you opened with <a href='OpenTCPStream.htm'>OpenTCPStream</a> with this command.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; OpenTCPStream/CloseTCPStream Example<br>
<br>
Print "Connecting..."<br>
tcp=OpenTCPStream( "www.blitzbasement.com",80 )<br>
<br>
If Not tcp Print "Failed.":WaitKey:End<br>
<br>
Print "Connected! Sending request..."<br>
<br>
WriteLine tcp,"GET http://www.blitzbasement.com HTTP/1.0"<br>
WriteLine tcp,Chr$(10)<br>
<br>
If Eof(tcp) Print "Failed.":WaitKey:End<br>
<br>
Print "Request sent! Waiting for reply..."<br>
<br>
While Not Eof(tcp)<br>
Print ReadLine$( tcp )<br>
Wend<br>
<br>
If Eof(tcp)=1 Then Print "Success!" Else Print "Error!"<br>
<br>
CloseTCPStream tcp<br>
<br>
WaitKey<br>
End<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,2 @@
<html><head><title>Command: Cls </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Cls &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Clears the current current drawing buffer.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command will wipe the current drawing buffer clean of any graphics or text present and reset the drawing buffer back to the color defined in the <a href='ClsColor.htm'>ClsColor</a> command</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>;set ClsColor to red<br>ClsColor 255,0,0<br><br>;set current drawing buffer to the color set by the ClsColor command<br>Cls</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,2 @@
<html><head><title>Command: ClsColor </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ClsColor red,green,blue&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Selects the color for the Cls command.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>red, green and blue = number between 0 and 255</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This changes the color for subsequent <a href='CLS.htm'>CLS</a> calls. Use this command when you need CLS to 'clear' the screen with some other color than black.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>;set ClsColor to red<br>ClsColor 255,0,0 <br><br> ;set current drawing buffer to the color set by the ClsColor command<br>Cls</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,19 @@
<html><head><title>Command: Color </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Color red,green,blue&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Sets the drawing color for all drawing operations with a red, green, blue color value.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>red = value of red component (0-255)<br>
green = value of green component (0-255)<br>
blue = value of blue component (0-255)<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command sets the drawing color (using RGB values) for all subsequent drawing commands (<a href='Line.htm'>Line</a>, <a href='Rect.htm'>Rect</a>, <a href='Text.htm'>Text</a>, etc.) You must be in <a href='Graphics.htm'>Graphics</a> mode to execute this command.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Color, ColorRed(), ColorBlue(), ColorGreen() Example<br>
<br>
; Gotta be in graphics mode<br>
Graphics 640,480<br>
<br>
; Change the random seed<br>
SeedRnd MilliSecs()<br>
<br>
; Let's set the color to something random<br>
Color Rnd(0,255),Rnd(0,255),Rnd(0,255)<br>
<br>
; Now let's see what they are!<br>
While Not KeyHit(1)<br>
Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"<br>
Wend<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,17 @@
<html><head><title>Command: ColorBlue() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ColorBlue() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the blue component of the current drawing color.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to return the blue component of the RGB color of the current drawing color. Use <a href='ColorRed().htm'>ColorRed()</a> and <a href='ColorGreen().htm'>ColorGreen()</a> for the other two color components.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Color, ColorRed(), ColorBlue(), ColorGreen() Example<br>
<br>
; Gotta be in graphics mode<br>
Graphics 640,480<br>
<br>
; Change the random seed<br>
SeedRnd MilliSecs()<br>
<br>
; Let's set the color to something random<br>
Color Rnd(0,255),Rnd(0,255),Rnd(0,255)<br>
<br>
; Now let's see what they are!<br>
While Not KeyHit(1)<br>
Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"<br>
Wend<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,17 @@
<html><head><title>Command: ColorGreen() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ColorGreen() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the green component of the current drawing color.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to return the green component of the RGB color of the current drawing color. Use <a href='ColorRed().htm'>ColorRed()</a> and <a href='ColorBlue().htm'>ColorBlue()</a> for the other two color components.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Color, ColorRed(), ColorBlue(), ColorGreen() Example<br>
<br>
; Gotta be in graphics mode<br>
Graphics 640,480<br>
<br>
; Change the random seed<br>
SeedRnd MilliSecs()<br>
<br>
; Let's set the color to something random<br>
Color Rnd(0,255),Rnd(0,255),Rnd(0,255)<br>
<br>
; Now let's see what they are!<br>
While Not KeyHit(1)<br>
Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"<br>
Wend<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,17 @@
<html><head><title>Command: ColorRed() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ColorRed() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the red component of the current drawing color.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to return the red component of the RGB color of the current drawing color. Use <a href='ColorBlue().htm'>ColorBlue()</a> and <a href='ColorGreen().htm'>ColorGreen()</a> for the other two color components.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Color, ColorRed(), ColorBlue(), ColorGreen() Example<br>
<br>
; Gotta be in graphics mode<br>
Graphics 640,480<br>
<br>
; Change the random seed<br>
SeedRnd MilliSecs()<br>
<br>
; Let's set the color to something random<br>
Color Rnd(0,255),Rnd(0,255),Rnd(0,255)<br>
<br>
; Now let's see what they are!<br>
While Not KeyHit(1)<br>
Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"<br>
Wend<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,20 @@
<html><head><title>Command: CommandLine$() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CommandLine$() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Reads command line parameters passed at runtime.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>If you are writing an application or game that allows starting with special parameters on the command line, you can use this command to retrieve the parameters.<br>
<br>
For example, you might want to start the program with a debug variable set so you can track stuff during execution. So, you could offer the ability to run the executatble with a /debug parameter. If they execute the program with the parameter, then you can set a flag inside your game.<br>
<br>
To simulate the command line passing in the editor, select PROGRAM->PROGRAM COMMAND LINE from the pulldowns and enter a value to be passed at runtime. <br>
<br>
See the example.<br></td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CommandLine$() Example<br>
; Be sure to use PROGRAM->PROGRAM COMMAND LINE from the<br>
; pull down and put /debug in there to test with.<br>
<br>
a$=CommandLine$()<br>
<br>
If a$="/debug" Then <br>
Print "Debug mode is on!"<br>
debug=1<br>
Else<br>
Print "No debugging activated."<br>
debug=0<br>
End If<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,13 @@
<html><head><title>Command: Const </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Const variablename&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Declare a variable as a constant and assign it a value.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>variablename = any valid variable name and its assignment</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This delares a variable as a constant (a variable whose value will never change and cannot be changed) and assigns the value to it.<br>
<br>
Assign constants to values you know will not change in your game (screen width, height - scoring values - etc). This reduces the load of the variable memory, since Blitz knows it will never change size unlike other variables which can grow and shrink in size based on what value it holds.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CONST Example<br>
<br>
Const scrWidth=640<br>
Const scrHeight=480<br>
Const alienscore=100<br>
<br>
Graphics scrWidth,scrHeight<br>
<br>
Print "The point value for shooting any alien is always " + alienscore<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,24 @@
<html><head><title>Command: CopyBank </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CopyBank src_bank,src_offset,dest_bank,dest_offset,count&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Copies data from one bank to another.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>src_bank = handle of source memory bank<br>
src_offset = offset location to start copying from<br>
dest_bank = handle of destination memory bank<br>
dest_offset = offset location to start writing to<br>
count = how many bytes to copy<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Copies data from one meomry bank to another. If copying between the same banks, handles overlapping memory ranges.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; BankSize, ResizeBank, CopyBank Example<br>
<br>
; create a bank<br>
bnkTest=CreateBank(5000)<br>
<br>
; Fill it with rand Integers<br>
For t = 0 To 4999<br>
PokeByte bnkTest,t,Rand(9)<br>
Next<br>
<br>
; Resize the bank<br>
ResizeBank bnkTest,10000<br>
<br>
; Copy the first half of the bank to the second half<br>
CopyBank bnkTest,0,bnkTest,5000,5000 <br>
<br>
; Print final banksize<br>
Print BankSize(bnkTest)<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,11 @@
<html><head><title>Command: CopyFile </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CopyFile from$, to$&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Copies a file on the disk to a new location.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>from$ = valid path/filename to the file to be copied<br>
to$ = valid path/filename to copy the file to<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to copy a file from one location to another. Perhaps you'll write your own installer and need to copy files from the installation folder to the installed location folder. Make sure you do your own validation to ensure that the files/paths are valid and accurate before executing this command.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>file$="c:\autoexec.bat"<br>
destination$="a:\autoexec.bat"<br>
<br>
Print "Press any key to copy your Autoexec.bat file to floppy"<br>
<br>
WaitKey()<br>
<br>
CopyFile file$,destination$<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,11 @@
<html><head><title>Command: CopyImage </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CopyImage (handle)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Duplicates a previously loaded image to a new handle.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>handle=the variable you gave the handle to when you loaded the image</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Instead of loading a graphic twice in two different handles, you can load the image ONCE then use the CopyImage command to make as many copies in memory as you want.<br>
<br>
Why would you want to do this? So you still have a copy of the original image in case you want to alter a copy later for another purpose.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CopyImage Example<br>
<br>
; Load an image and give its handle to gfxOld variable<br>
gfxOld=LoadImage("mypicture.bmp")<br>
<br>
; Duplicate the gfxOld image to a new handle variable<br>
gfxNew=CopyImage(gfxOld)<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,40 @@
<html><head><title>Command: CopyPixel </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CopyPixel src_x,src_y,src_buffer,dest_x,dest_y,[dest_buffer]&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Copys pixels from one image buffer to another.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>src_x = x location of the source pixel to copy<br>
src_y = y location of the source pixel to copy<br>
src_buffer = buffer to copy from<br>
dest_x = x location to write pixel to<br>
dest_y = y location to write pixel to<br>
dest_buffer = optional</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this to directly copy pixels from one buffer to another. You do not need to <a href='LockBuffer.htm'>LockBuffer</a> to use this command, but it will make the operations faster.<br>
<br>
Although fast, this command will not be fast enough to perform real-time screen effects.<br></td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CopyPixel/CopyPixelFast commands<br>
<br>
Graphics 640,480,16<br>
<br>
; Draw a bunch of crap on the screen<br>
For t= 1 To 1000<br>
Color Rnd(255),Rnd(255),Rnd(255)<br>
Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)<br>
Next<br>
<br>
Delay 3000<br>
<br>
; Copy the top half of the screen over the bottom half<br>
; using fast pixels and locked buffers<br>
For x = 1 To 640<br>
For y = 1 To 240<br>
LockBuffer FrontBuffer()<br>
CopyPixelFast x,y,FrontBuffer(),x,y+241<br>
UnlockBuffer FrontBuffer()<br>
Next<br>
Next<br>
<br>
Delay 3000<br>
<br>
; Draw the left half of the screen over the right half<br>
; using the slower direct pixel access<br>
For x = 1 To 320<br>
For y = 1 To 480<br>
CopyPixel x,y,FrontBuffer(),x+320,y<br>
Next<br>
Next<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,40 @@
<html><head><title>Command: CopyPixelFast </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CopyPixelFast src_x,src_y,src_buffer,dest_x,dest_y,[dest_buffer]&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Quickly copies pixels from one image buffer to another.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>src_x = x location of the source pixel to copy<br>
src_y = y location of the source pixel to copy<br>
src_buffer = buffer to copy from<br>
dest_x = x location to write pixel to<br>
dest_y = y location to write pixel to<br>
dest_buffer = optional</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this to directly copy pixels from one buffer to another. You MUST use <a href='LockBuffer.htm'>LockBuffer</a> on BOTH image buffers to use this command.<br>
<br>
Although very fast, this command will not be fast enough to perform real-time screen effects.<br></td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CopyPixel/CopyPixelFast commands<br>
<br>
Graphics 640,480,16<br>
<br>
; Draw a bunch of crap on the screen<br>
For t= 1 To 1000<br>
Color Rnd(255),Rnd(255),Rnd(255)<br>
Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)<br>
Next<br>
<br>
Delay 3000<br>
<br>
; Copy the top half of the screen over the bottom half<br>
; using fast pixels and locked buffers<br>
For x = 1 To 640<br>
For y = 1 To 240<br>
LockBuffer FrontBuffer()<br>
CopyPixelFast x,y,FrontBuffer(),x,y+241<br>
UnlockBuffer FrontBuffer()<br>
Next<br>
Next<br>
<br>
Delay 3000<br>
<br>
; Draw the left half of the screen over the right half<br>
; using the slower direct pixel access<br>
For x = 1 To 320<br>
For y = 1 To 480<br>
CopyPixel x,y,FrontBuffer(),x+320,y<br>
Next<br>
Next<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,33 @@
<html><head><title>Command: CopyRect </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CopyRect src_x,src_y,src_width,src_height,dest_x,dest_y,[src_buffer],[dest_buffer]&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Copies a rectangle of graphics from one buffer to another.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>src_x = source top left x location to begin copying from<br>
src_y = source top left y location to begin copying from<br>
src_width = width of source area to copy<br>
src_height = height of source area to copy<br>
dest_x = destination top left x location to copy to<br>
dest_y = destination top left y location to copy to<br>
src_buffer = handle to the source image buffer (optional)<br>
dest_buffer = handle to the destination image buffer (optional)<br>
</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Copies a rectangle of graphics from one buffer to another. If a buffer is omitted, the current buffer is used.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CopyRect Example<br>
<br>
; Turn on graphics mode<br>
Graphics 800,600,16<br>
<br>
; create a blank image<br>
gfxBlank=CreateImage (300,300)<br>
<br>
; Fill the screen with random boxes in random colors<br>
For t = 1 To 1000<br>
Rect Rand(800),Rand(600),Rand(100),Rand(100),Rand(0,1) <br>
Color Rand(255),Rand(255),Rand(255)<br>
Next<br>
<br>
; Wait a couple of seconds so the user can see it<br>
Delay 2000<br>
<br>
; Copy graphics randomly from the front buffer to the blank image<br>
CopyRect Rand(800),Rand(600),300,300,0,0,FrontBuffer(),ImageBuffer(gfxBlank)<br>
<br>
; Clear the screen, draw the copied to image, wait for user to hit a key<br>
Cls<br>
DrawImage gfxBlank,0,0<br>
WaitKey <br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,42 @@
<html>
<head>
<title>Command: CopyStream</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../css/commands.css">
</head>
<body>
<p><span class="Command">&nbsp;&nbsp;CopyStream&nbsp;&nbsp;</span></p>
<p>
<span class="header">Parameters:</span><br>
</p>
<table width="100%" border="0" cellspacing="2" cellpadding="2" align="center">
<tr>
<td>
src_stream -- <BR>
dest_stream -- <BR>
[buffer_size] -- <BR>
</td>
</tr>
</table>
<p class="header">Description:<br>
<br>
<table width="100%" border="0" cellspacing="2" cellpadding="2" align="center">
<tr>
<td>CopyStream () ...</td>
</tr>
</table>
<p class="header"><a href="../3d_examples/CopyStream.bb">Example:</a><br>
<br>
<table width="100%" border="0" cellspacing="2" cellpadding="2" align="center">
<tr>
<td>
; Example
</td>
</tr>
</table>
</body>
</html>
@@ -0,0 +1,26 @@
<html><head><title>Command: Cos </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Cos (Number)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>The Cos command is a trigonometry function, that returns a number between -1 and 1. This value represents the "X" coordinate of point x,y.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>number=float or integer representing a value in degree</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command is used for translating angle values to coordinates, but there are a few things you have to take into account when doing it. First of all the Cos() command assumes the point you want is at radius 1 (pixel), next it uses a circle where 0 degrees is due EAST and increases in a counterclockwise direction, then you've got to take into account the the Y axis on a computer screen is up-side-down compared to a normal mathematical coordinate system.<br>
<br>
See also <a href='ASin.htm'>ASin</a>, <a href='Cos.htm'>Cos</a>, <a href='ACos.htm'>ACos</a>, <a href='Tan.htm'>Tan</a>, <a href='Atan.htm'>Atan</a>, <a href='ATan2.htm'>ATan2</a><br></td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Graphics 640,480; Change to graphics mode, nothing tricky yet.<br>
Origin 320,240 ; Move the point of orign for all drawing commands to the middle of the screen.<br>
<br>
For degrees=0 To 359; Step though all the degrees in a circle (360 in all)<br>
Delay(5); Wait 5 milli secsonds.<br>
<br>
; The next line calculates the Y coordinate of the point of the circle using the Sin<br>
; command, and multiplies it by 100 (to get a larger radius, try and change it).<br>
y=Sin(degrees)*100<br>
<br>
y=-y ; Invert Y coordinate to represent it properly on screen.<br>
<br>
; The next line calculates the X coordinate of the point of the circle using the Cos,<br>
; command, and multiplies it by 100 (to get a larger radius, try and change it).<br>
x=Cos(degrees)*100<br>
<br>
Rect x,y,1,1 ; Draw the current point on the circle.<br>
<br>
Next ; Give us another angle<br>
<br>
MouseWait ; Wait for the mouse.<br>
End ; Terminate the program.<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,14 @@
<html><head><title>Command: CountGFXModes() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CountGFXModes() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the number of video graphic modes available.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to return the number of video modes the user's video card can display in. Use the <a href='GFXModeWidth.htm'>GFXModeWidth</a>, <a href='GFXModeHeight.htm'>GFXModeHeight</a>, and <a href='GFXModeDepth.htm'>GFXModeDepth</a> with each number of video mode to determine the width, height, and color depth capabilities of each mode. See example.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CountGFXModes()/GfxModeWidth/GfxModeHeight/GfxModeDepth example<br>
<br>
intModes=CountGfxModes()<br>
<br>
Print "There are " + intModes + "graphic modes available:"<br>
<br>
; Display all modes including width, height, and color depth<br>
For t = 1 To intModes<br>
Print "Mode " + t + ":<br>
Print "Width=" + GfxModeWidth(t)<br>
Print "Height=" + GfxModeHeight(t)<br>
Print "Height=" + GfxModeDepth(t)<br>
Next<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,22 @@
<html><head><title>Command: CountGfxDrivers() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CountGfxDrivers() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the number of graphic drivers on the system.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Some computers may have more than one video card and/or video driver installed (a good example is a computer system with a primary video card and a Voodoo2 or other pass-through card).
Once you know how many drivers there are, you can iterate through them with <a href='GfxDriverName$.htm'>GfxDriverName$</a> and display them for the user to choose from. Once the user has chosen (or you decide), you can set the graphics driver with <a href='SetGfxDriver.htm'>SetGfxDriver</a>.
Normally, this won't be necessary with 2D programming.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; GfxDriver Examples<br>
<br>
; Count how many drivers there are<br>
totalDrivers=CountGfxDrivers()<br>
Print "Choose a driver to use:"<br>
<br>
; Go through them all and print their names (most people will have only 1)<br>
For t = 1 To totalDrivers<br>
Print t+") " + GfxDriverName$(t)<br>
Next<br>
<br>
; Let the user choose one<br>
driver=Input("Enter Selection:")<br>
<br>
; Set the driver!<br>
SetGfxDriver driver<br>
Print "Your driver has been selected!"<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,22 @@
<html><head><title>Command: CreateBank </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CreateBank (size)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Create a data bank.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>size = size of memory bank in bytes<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>The bank commands allow you to make your own memory bank to perform your own read and write operations to. This is useful for compression/decompression, level data, and tons of other uses.<br>
<br>
This command allocates the memory and creates a handle to the bank.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Bank Commands Example<br>
<br>
bnkTest=CreateBank(500)<br>
<br>
For t = 1 To 50<br>
PokeByte bnkTest,t,Rnd(255)<br>
PokeInt bnkTest,t+1,Rnd(10000)<br>
PokeShort bnkTest,t+2,Rnd(10000)<br>
PokeFloat bnkTest,t+3,Rnd(-.999,.999)<br>
Next<br>
<br>
For t = 1 To 50<br>
Print PeekByte (bnkTest,t)<br>
Print PeekInt (bnkTest,t+1)<br>
Print PeekShort (bnkTest,t+2)<br>
Print PeekFloat (bnkTest,t+3)<br>
Next<br>
<br>
Freebank bnkTest<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,7 @@
<html><head><title>Command: CreateDir </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CreateDir path/name&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Creates a directory/folder on a storage device.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>path/name = full path and name for new directory</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Creates a directory (file folder) at the destination specified. Do not use a trailing slash at the end of the path/name parameter. You cannot be sure the directory was created with this command, so you will need to verify its existance yourself (use the <a href='FILETYPE.htm'>FILETYPE</a> command).</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CREATEDIR example<br>
<br>
fldr$="c:\winnt\system32\myfolder"<br>
createDir fldr$<br>
Print "Folder created!"<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,43 @@
<html><head><title>Command: CreateImage </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CreateImage (width,height[,frames])&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Create a new image in memory and give its handle to a variable.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>width=width of the new image (or its frames)<br>
height=height of the new image<br>
frames= optional number of frames (assumed to be a single frame)<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Sometimes you want to create a completely new graphic on the fly (using other images, drawing commands, etc.) instead of loading one. This command will let you create a new image with a single frame or multiple frames for animation. You specify the width, height, and optional number of frames. The example should be pretty self-explainatory.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CreateImage/TileImage/ImageBuffer example<br>
<br>
; Again, we'll use globals even tho we don't need them here<br>
; One variable for the graphic we'll create, one for a timer<br>
Global gfxStarfield, tmrScreen<br>
<br>
; Declare graphic mode<br>
Graphics 640,480,16<br>
<br>
; Create a blank image that is 320 pixels wide and 32 high with 10 frames of 32x32<br>
gfxStarfield=CreateImage(32,32,10)<br>
<br>
; loop through each frame of the graphic we just made<br>
For t = 0 To 9<br>
; Set the drawing buffer to the graphic frame so we can write on it<br>
SetBuffer ImageBuffer(gfxStarfield,t)<br>
; put 50 stars in the frame at random locations<br>
For y = 1 To 50<br>
Plot Rnd(32),Rnd(32)<br>
Next<br>
Next<br>
<br>
; Double buffer mode for smooth screen drawing<br>
SetBuffer BackBuffer()<br>
<br>
; Loop until ESC is pressed<br>
While Not KeyHit(1)<br>
<br>
; Only update the screen every 300 milliseconds. Change 300 for faster or<br>
; slower screen updates<br>
If MilliSecs() > tmrScreen+300 Then <br>
Cls ; clear the screen<br>
<br>
; Tile the screen with a random frame from our new graphic starting at<br>
; x=0 and y=0 location.<br>
TileImage gfxStarfield,0,0,Rnd(9)<br>
Flip ; Flip the screen into view<br>
tmrScreen=MilliSecs() ; reset the time<br>
End If<br>
Wend <br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,30 @@
<html><head><title>Command: CreateNetPlayer </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CreateNetPlayer (name$)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Creates a new local player on the network game.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>name$ = any valid string holding the player's name.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Creates a new local player. This also causes a special message to be sent to all remote machines (see <a href='NetMsgType.htm'>NetMsgType</a>). This returns an integer player number to be used in sending/receiving messages. Note that you must create at least one player before you can send and receive messages. </td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CreateNetPlayer example<br>
<br>
newGame = StartNetGame()<br>
; Check the status of the new game.<br>
If newGame = 0 Then<br>
Print "Could not start or join net game."<br>
End<br>
<br>
ElseIf newGame = 1<br>
Print "Successfully joined the network game"<br>
ElseIf newGame = 2<br>
Print "A new network game was started!"<br>
EndIf<br>
<br>
; Create a random player name<br>
name$="Player" + Rand(100)<br>
<br>
; Get a unique player id number for the player<br>
; and create the player<br>
playerID=CreateNetPlayer(name$)<br>
<br>
If playerID = 0 Then <br>
Print "Player could not be created!"<br>
Else<br>
Print "Player " + name$ + " was created and given ID#" +
playerID<br>
End If<br>
WaitKey()<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,57 @@
<html><head><title>Command: CreateTCPServer </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CreateTCPServer (port)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Creates a TCP server on the specified port.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>port = the port to use when creating the server</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Creates a TCP/IP server with the designated port. Use this for communications between other clients and the local box. See <a href='OpenTCPStream.htm'>OpenTCPStream</a>, <a href='CloseTCPServer.htm'>CloseTCPServer</a>, and <a href='CloseTCPStream.htm'>CloseTCPStream</a> for more information.<br>
<br>
Returns a TCP/IP server handle if successful or 0 if not.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CreateTCPServer, CloseTCPServer, AcceptTCPStream Example<br>
; This code is in two parts, and needs to be run seperately on the same machine<br>
<br>
; --- Start first code set ---<br>
; Create a server and listen for push<br>
<br>
svrGame=CreateTCPServer(8080)<br>
<br>
If svrGame<>0 Then <br>
Print "Server started successfully."<br>
Else<br>
Print "Server failed to start."<br>
End<br>
End If<br>
<br>
While Not KeyHit(1)<br>
strStream=AcceptTCPStream(svrGame)<br>
If strStream Then <br>
Print ReadString$(strStream)<br>
Delay 2000<br>
End<br>
Else <br>
Print "No word from Apollo X yet ..."<br>
Delay 1000<br>
End If <br>
Wend<br>
<br>
End<br>
<br>
; --- End first code set ---<br>
<br>
<br>
; --- Start second code set ---<br>
; Copy this code to another instance of Blitz Basic<br>
; Run the above code first, then run this ... they will 'talk'<br>
<br>
; Create a Client and push data<br>
<br>
strmGame=OpenTCPStream("127.0.0.1",8080)<br>
<br>
If strmGame<>0 Then <br>
Print "Client Connected successfully."<br>
Else<br>
Print "Server failed to connect."<br>
WaitKey <br>
End<br>
End If<br>
<br>
; write stream to server<br>
WriteString strmGame,"Mission Control, this is Apollo X ..."<br>
Print "Completed sending message to Mission control..."<br>
<br>
; --- End second code set ---<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,2 @@
<html><head><title>Command: CreateTimer </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CreateTimer (frequency)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Creates a timer to track a frequency.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>frequency = usually a framerate like 50 or 60</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command in conjunction with the WaitTimer command to control the speed of program execution (fps). You will use this in your main screen redraw loop to control the playback speed to match the proper speed. This will prevent your games from playing back too fast on computers faster than yours. Use of this system is VERY GOOD practice, as your game will be played on a variety of computers.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Create the timer to track speed<br>frameTimer=CreateTimer(60)<br><br>; Your main screen draw loop<br>While Not KeyHit(1)<br>WaitTimer(frameTimer) ; Pause until the timer reaches 60<br>Cls<br>; Draw your screen stuff<br>Flip<br>Wend<br><br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,5 @@
<html><head><title>Command: CurrentDate$() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CurrentDate$() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the current system date.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the current date in the format: DD MON YYYY (i.e. 10 DEC 2000).</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Print the current date to the screen<br>
<br>
Print "The date is:" + CurrentDate$()<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,7 @@
<html><head><title>Command: CurrentDir$() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CurrentDir$() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns a string containing the currently selected directory.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command will return the currently selected directory for disk operations, useful for advanced file operations. Use <a href='CHANGEDIR.htm'>CHANGEDIR</a> to change the current directory. The value returned doesn't have a trailing slash - aside from the root directory of the drive.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; CurrentDir$() example<br>
<br>
; Print the current directory until ESC key<br>
While Not KeyHit(1)<br>
Print CurrentDir$()<br>
Wend<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,5 @@
<html><head><title>Command: CurrentTime$() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;CurrentTime$() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the current system time.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the current time in the format: HH:MM:SS (i.e. 14:31:57).</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Print the current time to the screen<br>
<br>
Print "The Time is:" + CurrentTime$()<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,28 @@
<html><head><title>Command: Data </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Data list_of_values&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Creates a list of constant values to be parsed through within your program</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>list_of_values = a list of comma delimited values (strings must be inside quotes)</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Data is used to create neat, comma delimited lists of values of a constant nature that you will be reading (and probably reusing) during the execution of your game. You may store level information (number of enemies, stars, etc) there or just about anything you can think of! You can easily mix datatypes (strings, integers, floats) in your Data statements, as long as they are read properly with the <a href='Read.htm'>Read</a> command later. You will need to use the <a href='Restore.htm'>Restore</a> command to point to the <a href='..htm'>.</a>Label that begins your Data statements. See the related commands for more information and more examples.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Print "Here we go!"<br>
<br>
; Restore to the start of the Data statements<br>
Restore startData<br>
<br>
; Get the first number which is the total number of users<br>
Read Users<br>
<br>
; Print them all!<br>
For T = 1 To Users<br>
Read firstname$<br>
Read age<br>
Read accuracy#<br>
Read lastname$<br>
Print firstname$ + " " + lastname$ + " is " + age + " years old with " + accuracy# + " accuracy!"<br>
Next <br>
<br>
While Not KeyHit(1)<br>
Wend<br>
End<br>
<br>
.startData<br>
Data 3<br>
Data "Shane", 31, 33.3333, "Monroe"<br>
Data "Bob", 28, 12.25, "Smith"<br>
Data "Roger", 54, 66.66, "Rabbit"<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,18 @@
<html><head><title>Command: DebugLog </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;DebugLog message&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Writes a message to the debug log for debugging purposes.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>message = message text string value<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>You power programmers will just love this. You have your own debug log to write to!<br>
<br>
For those not familiar to this sort of thing, think of the Debug log like your own private 'in program notepad'. Use this to write messages to yourself during program execution. For example, you could write the graphic modes that the user has on his system, or just little alerts to let you know your code execution made it to a certain point in the execution without interrupting it. I'm sure you'll find a lot of uses for this! See the example if you're still lost.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; DebugLog Example<br>
<br>
; Let's start graphics mode<br>
Graphics 640,480,16<br>
<br>
; Now, let's load an image that doesn't exist!<br>
gfxPlayer=LoadImage("noimagefound.jpg")<br>
If gfxPlayer=0 Then<br>
DebugLog "Player's Graphics failed to load!"<br>
End If<br>
<br>
; This is supposed to generate an error. Press F9 to see the log!<br>
While Not KeyHit(1)<br>
DrawImage gfxPlayer,100,100<br>
Wend<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,27 @@
<html><head><title>Command: Default </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Default &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Specifies the set of commands that executes in a Select structure if none of the CASEs are met.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>In a <a href='SELECT.htm'>SELECT</a> structure, you may wish to execute code if none of the cases you specify are met. All code after DEFAULT to <a href='END SELECT.htm'>END SELECT</a> will be executed if no case is met. See <a href='SELECT.htm'>SELECT</a>, <a href='CASE.htm'>CASE</a>, and the example for more.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; SELECT/CASE/DEFAULT/END SELECT Example<br>
; Assign a random number 1-10<br>
mission=Rnd(1,10)<br>
<br>
; Start the selection process based on the value of 'mission' variable<br>
Select mission<br>
<br>
; Is mission = 1?<br>
Case 1<br>
Print "Your mission is to get the plutonium and get out alive!"<br>
<br>
; Is mission = 2?<br>
Case 2<br>
Print "Your mission is to destroy all enemies!"<br>
<br>
; Is mission = 3?<br>
Case 3 <br>
Print "Your mission is to steal the enemy building plans!"<br>
<br>
; What do do if none of the cases match the value of mission<br>
Default <br>
Print "Missions 4-10 are not available yet!"<br>
<br>
; End the selection process<br>
End Select<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,5 @@
<html><head><title>Command: Delay </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Delay milliseconds&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Pause program execution for a certain time.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>milliseconds = the amount of milliseconds to delay. 1000=1 second</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command stops all program execution for the designated time period. All execution stops. If you need program execution to continue, consider trapping time elapsed with a custom timer function using <a href='Millisecs().htm'>Millisecs()</a>.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Delay for 5 seconds<br>
<br>
Delay 5000<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,15 @@
<html><head><title>Command: Delete </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Delete custom_type_name&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Delete an object from a custom TYPE collection.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>custom_type_name = the custom name of an existing object</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>If you haven't read up on the <a href='TYPE.htm'>TYPE</a>
command, you might want to do so before continuing.</p>
<p>Use the Delete command to remove an object from the Type collection. Use the
commands FIRST, LAST, BEFORE, and NEXT to move the object pointer to the object
you want to delete, then issue the Delete command with the custom Type name.</p>
<p>This is often used in a FOR ... EACH loop when a collision happens and you
wish to remove the object (an alien ship object for example) from the collection.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Move them all over 1 (like the description example from TYPE command)<br>
; If the chair isn't on the screen anymore, delete that chair object from the<br>
; collection.</p>
<p>For room.chair = Each chair<br>
room\x = room\x + 1<br>
if room\x > 640 then<br>
Delete room<br>
Next<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,5 @@
<html><head><title>Command: DeleteDir </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;DeleteDir directory/path&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Deletes a specified folder/directory.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>directory/path = full path/name of directory</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Deletes a specified folder/directory from the device. Note: This only works on EMPTY directories - you cannot delete a folder with other folders or files inside with this command. Do not apply a trailing slash.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; DeleteDir example<br>
<br>
DeleteDir "C:\test"<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,4 @@
<html><head><title>Command: DeleteFile </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;DeleteFile path/filename&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Deletes a specified file.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>path/filename = full path/filename to the file to delete</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Deletes a specified file from the drive. You will need to make sure the file exists before execution and be sure its been deleted AFTER execution. Use <a href='FILETYPE.htm'>FILETYPE</a> to determine this.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; DELETEFILE example<br>
<br>
DeleteFile "C:\test\myfile.bb"<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,34 @@
<html><head><title>Command: DeleteNetPlayer </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;DeleteNetPlayer playerID&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Deletes a local player from the network game.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>playerID = value assigned when player was created with CreateNetPlayer</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Using the playerID generated by the <a href='CreateNetPlayer.htm'>CreateNetPlayer</a> command, this command will remove the designated player from the network game.<br>
<br>
This also causes a special message to be sent to all remote machines (see <a href='NetMsgType.htm'>NetMsgType</a>). </td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; DeleteNetPlayer example<br>
<br>
newGame = StartNetGame()<br>
; Check the status of the new game.
If newGame = 0 Then<br>
Print "Could not start or join net game."<br>
End<br>
<br>
ElseIf newGame = 1<br>
Print "Successfully joined the network game"<br>
ElseIf newGame = 2<br>
Print "A new network game was started!"<br>
EndIf<br>
<br>
; Create a random player name<br>
name$="Player" + Rand(100)<br>
<br>
; Get a unique player id number for the player<br>
; and create the player<br>
playerID=CreateNetPlayer(name$)<br>
<br>
If playerID = 0 Then <br>
Print "Player could not be created!"<br>
Else<br>
Print "Player " + name$ + " was created and given ID#" + playerID<br>
WaitKey()<br>
; delete the player!<br>
DeleteNetPlayer playerID<br>
Print "The local player was deleted!"<br>
End If<br>
waitkey()<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,27 @@
<html><head><title>Command: Dim </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Dim variable(elements)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Dimensions an array variable for storage.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>variable = variable of desired type (string, floating, integer)<br>
elements = number of elements to be created. Can be multi-dimensional.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Prepares an array using the specified variable type as its type and specified elements for the number of containers it should hold. You may use as many dimension elements as you like (just watch your memory). There is no way in Blitz to 'Redimension' arrays, so define them accordingly. Use the proper notation on the declaration variable to make it a string($), floating(#), or integer type array. Note: Arrays always start at ZERO reference - so variable(0) is always the first element.<br>
<br>
To use this command effectively, you must understand arrays. Think of an array like a variable that has multiple slots to hold many values, all under the same variable name. Before <a href='TYPE.htm'>TYPE</a>s came around, this was the best way to track repeating elements (say, alien ships) because you can iterate through an array collection easily.<br>
<br>
Take for example, you want to track 100 aliens on the screen. You could have two variables - alienx and alieny. By making these arrays - alienx() and alieny() and each having 100 elements each, you could easily set or retrieve the first alien's location by using alienx(1), alieny(1). The next alien's coordinates would be alienx(2), alienx(2) and so on. This makes it easy to use a <a href='FOR.htm'>FOR</a> ... <a href='NEXT.htm'>NEXT</a> or <a href='EACH.htm'>EACH</a> loop to go through all the elements.<br>
<br>
Arrays are also useful for 'multi-dimensional' notation too. Instead of tracking our 100 aliens in the method mentioned above, you could use a single variable: alien(100,1). The first element collection are the 100 aliens, the second element is the X and Y location of that alien - the 0 element being the alien's X location, and the 1 element being the alien's Y location. So to set the position of alien 57 to X=640,Y=480 you could do this:<br>
<br>
alien(57,0)=640<br>
alien(57,1)=480<br>
DrawImage imgAlien,alien(57,0),alien(57,1)<br>
<br>
Of course, TYPEs are a much better way of doing this sort of multiple value sort of routine.<br>
<br>
Arrays are great for tracking collections of items with a single, common element - but often times TYPEs will prove to be more useful.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; DIM example<br>
; Create a collection of 100 random numbers<br>
<br>
; Declare our array<br>
Dim nums(100)<br>
<br>
; Fill each element with a random number<br>
For T = 1 to 100<br>
nums(t) = Rnd(1,100)<br>
Next<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,31 @@
<html><head><title>Command: DrawBlock </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;DrawBlock image,x,y,[frame]&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Draws an image at a location without regards to transparency.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>image = variable of the image handle<br>
x = x location to draw the image<br>
y = y location to draw the image<br>
frame = image's frame to draw (optional - default is 0)<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This is similar to the <a href='DrawImage.htm'>DrawImage</a> command except that any transparency or <a href='MaskImage.htm'>MaskImage</a> is ignored and the entire image (including masked colors) is drawn. The frame is optional.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; DrawBlock Example<br>
<br>
; Turn on graphics mode<br>
Graphics 640,480,16<br>
<br>
; Create new empty graphic to store our circle in<br>
gfxCircle=CreateImage(50,50)<br>
<br>
; Draw the circle image<br>
; Set drawing operations to point to our new empty graphic<br>
SetBuffer ImageBuffer(gfxCircle)<br>
Color 255,0,0<br>
; Note the extra space between the circle and the edge of the graphic<br>
Oval 10,10,30,30,1<br>
<br>
; Let's not forget to put the drawing buffer back!<br>
SetBuffer BackBuffer()<br>
; Set the CLS color to white<br>
ClsColor 255,255,255<br>
<br>
; Let the user move the circle graphic around a white screen<br>
; putting the graphic at the MouseX,Y coordinates<br>
While Not KeyHit(1)<br>
Cls<br>
DrawBlock gfxCircle,MouseX(),MouseY()<br>
Flip<br>
Wend<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,38 @@
<html><head><title>Command: DrawBlockRect </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;DrawBlockRect image,x,y,rect_x,rect_y,rect_width,rect_height,[frame]&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Draws a rectangular area of an image at the designated location without transparency.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>image = variable holding the image handle<br>
x = x location on the screen to draw the image<br>
y = y location on the screen to draw the image<br>
rect_x = starting x location within the image to draw<br>
rect_y = starting y location within the image to draw<br>
rect_width = the height of the area to draw<br>
rect_height = the width of the area to draw<br>
frame = optional frame number of image to draw<br>
</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command will let you draw a rectangular PORTION of an image to the designated location on the screen. The transparent/masked portions of the original image will be ignored and drawn with the image.<br>
<br>
This is handy if you are doing something like revealing part of a screen when the player uncovers something (think QIX). You could load the 'picture' into an image, then when the player clears a rectangular region, you could paste that portion of the final image onto the playfield. If you want to draw the image portion with transparency or masking, use <a href='DrawImageRect.htm'>DrawImageRect</a> instead.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; DrawBlockRect Example<br>
<br>
; Turn on graphics mode<br>
Graphics 640,480,16<br>
<br>
; Create new empty graphic to store our circle in<br>
gfxCircle=CreateImage(50,50)<br>
<br>
; Draw the circle image<br>
; Set drawing operations to point to our new empty graphic<br>
SetBuffer ImageBuffer(gfxCircle)<br>
Color 255,0,0<br>
; Note the extra space between the circle and the edge of the graphic<br>
Oval 10,10,30,30,1<br>
SetBuffer FrontBuffer()<br>
<br>
; Set the screen to white so you can see the transparent areas<br>
ClsColor 255,255,255<br>
Cls <br>
<br>
; Let's draw portions of the circle randomly<br>
While Not KeyHit(1)<br>
; We take random sized portions of the circle and put them<br>
; at a random location ... wash, rinse, and repeat<br>
DrawBlockRect gfxCircle,Rnd(640),Rnd(480),0,0,Rnd(50),Rnd(50),0<br>
Delay 100<br>
Wend<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,35 @@
<html><head><title>Command: DrawImage </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;DrawImage handle,x,y,[frame]&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Draws an image or frame of an animImage on the screen.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>handle = variable image handle previously designated<br>
x = the 'x' location of the screen to display the graphic<br>
y = the 'y' location of the screen to display the graphic<br>
frame = the frame number of the AnimImage to display (optional; 0 is assumed)<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command draws a previously loaded graphic. This command draws both single image graphics (loaded with the <a href='LoadImage.htm'>LoadImage</a> command) as well as animated images (loaded with the <a href='LoadAnimImage.htm'>LoadAnimImage</a> command).<br>
<br>
You specify where on the screen you wish the image to appear. You can actually 'draw' off the screen as well by using negative values or positive values that are not visible 'on the screen'.<br>
<br>
Finally, if you are using an animated image (loaded with the <a href='LoadAnimImage.htm'>LoadAnimImage</a>), you can specify which frame of the imagestrip is displayed with the DrawImage command.<br>
<br>
One of the most common problems new Blitz programmers face when using drawing commands is that even though they draw the graphic to the screen, they never see it!<br>
<br>
Remember, Blitz Basic is fast ... too fast for the human eye. You will have to either continuously draw the image over and over again (like the way a cartoon or TV works), clearing the screen each time a change is made (this is called double buffering); or you will need to delay Blitz's execution long enough in 'human time' to let you SEE the picture. We will do the double buffering approach.<br></td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; LoadImage and DrawImage example<br>
<br>
; Declare a variable to hold the graphic file handle<br>
Global gfxPlayer<br>
<br>
; Set a graphics mode<br>
Graphics 640,480,16<br>
<br>
; Set drawing operations for double buffering<br>
SetBuffer BackBuffer()<br>
<br>
; Load the image and assign its file handle to the variable<br>
; - This assumes you have a graphic called player.bmp in the<br>
; same folder as this source code<br>
gfxPlayer=LoadImage("player.bmp")<br>
<br>
; Let's do a loop where the graphic is drawn wherever the<br>
; mouse is pointing. ESC will exit.<br>
While Not KeyHit(1)<br>
Cls ; clear the screen<br>
DrawImage gfxPlayer,MouseX(),MouseY() ; Draw the image!<br>
Flip ; flip the image into view and clear the back buffer<br>
Wend<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,34 @@
<html><head><title>Command: DrawImageRect </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;DrawImageRect image,x,y,rect_x,rect_y,rect_width,rect_height,[frame]&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Draws a rectangular area of an image at the designated location.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>image = variable holding the image handle<br>
x = x location on the screen to draw the image<br>
y = y location on the screen to draw the image<br>
rect_x = starting x location within the image to draw<br>
rect_y = starting y location within the image to draw<br>
rect_width = the height of the area to draw<br>
rect_height = the width of the area to draw<br>
frame = optional frame number of image to draw<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command will let you draw a rectangular PORTION of an image to the designated location on the screen. The transparent/masked portions of the original image will be drawn transparent, just as you normally would draw an image.<br>
<br>
This is handy if you are doing something like revealing part of a screen when the player uncovers something (think QIX). You could load the 'picture' into an image, then when the player clears a rectangular region, you could paste that portion of the final image onto the playfield. If you want to draw the image portion with no transparency or mask, use <a href='DrawBlockRect.htm'>DrawBlockRect</a> instead.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; DrawImageRect Example<br>
<br>
; Turn on graphics mode<br>
Graphics 640,480,16<br>
<br>
; Create new empty graphic to store our circle in<br>
gfxCircle=CreateImage(50,50)<br>
<br>
; Draw the circle image<br>
; Set drawing operations to point to our new empty graphic<br>
SetBuffer ImageBuffer(gfxCircle)<br>
Color 255,0,0<br>
; Note the extra space between the circle and the edge of the graphic<br>
Oval 10,10,30,30,1<br>
SetBuffer FrontBuffer()<br>
<br>
<br>
; Let's draw portions of the circle randomly<br>
While Not KeyHit(1)<br>
; We take random sized portions of the circle and put them<br>
; at a random location ... wash, rinse, and repeat<br>
DrawImageRect gfxCircle,Rnd(640),Rnd(480),0,0,Rnd(50),Rnd(50),0<br>
Delay 100<br>
Wend<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,19 @@
<html><head><title>Command: EOF </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;EOF (filehandle|stream)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Checks to see if the End Of File (or stream) has been reached.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>filehandle|stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Checks to see if the End of File of an opened file or stream has been reached. Use this to determine if you should continue to pull more information from a file/stream or not. Use this to read a text file of unknown length (say a README.TXT) and display it. See example.<br>
<br>
Eof returns 1 if eof has been reached or, in the case of a TCP stream, the stream has been 'nicely' closed.<br>
<br>
Eof returns -1 if something has gone wrong during stream processing.<br><br>
Streams can only be used in Blitz Basic v1.52 or greater.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; EOF sample<br>
<br>
file$="c:\autoexec.bat"<br>
<br>
filein = ReadFile(file$)<br>
<br>
Print "Here is your Autoexec.bat file ..."<br>
<br>
; Loop this until we reach the end of file<br>
While Not Eof(filein)<br>
Print ReadLine$(filein)<br>
Wend<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,9 @@
<html><head><title>Command: Each </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Each type_variable&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Used to iterate through a collection of TYPE objects.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>type_variable = A previously declared TYPE object</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>If you haven't read up on the <a href='TYPE.htm'>TYPE</a>
command, you might want to do so before continuing.</p>
<p>The For .. Each loop allows you to walk through each object in the Type collection.
This is perfect for updating a large group of objects (such as a group of alien
invaders). Do look over the Type command.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Move them all over 1 (like the description example from TYPE command)</p>
<p>For room.chair = Each chair<br>
room\x = room\x + 1<br>
Next<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,20 @@
<html><head><title>Command: Else If </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Else If &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Performs an additional IF condition check during an IF ... THEN conditional structure.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>During a standard <a href='IF.htm'>IF</a> ... <a href='THEN.htm'>THEN</a> conditional structure, you may wish to check another condition if the original condition fails. This 'nested IF' situation can get WAY out of hand, and once you have more than two nested conditionals, you should consider a <a href='SELECT.htm'>SELECT</a>/<a href='CASE.htm'>CASE</a> structure. See the example.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; ELSE IF Example<br>
<br>
; Input the user's name<br>
name$=Input$("What is your name? ")<br>
<br>
; Doesn't the person's name equal SHANE?<br>
If name$ = "Shane" Then<br>
<br>
Print "You are recognized, Shane! Welcome!"<br>
<br>
Else If name$="Ron" then<br>
Print "You are recognized too, Ron! Welcome!"<br>
<br>
Else<br>
Print "Sorry, you don't belong here!"<br>
<br>
; End of the condition checking<br>
End If<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,11 @@
<html><head><title>Command: Else </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Else &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Begins the code to be executed in the event the IF conditional fails.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>There are times during an <a href='IF.htm'>IF</a> ... <a href='THEN.htm'>THEN</a> conditional that you will want code to execute in the event that the conditional is NOT met. The ELSE command begins that block of code, and is terminated by the <a href='END IF.htm'>END IF</a> command. See example.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; ELSE example<br>
<br>
name$=Input$("What is your name?")<br>
<br>
If name$="Shane" then <br>
Print "Hello Shane!"<br>
Else<br>
Print "I have NO clue who you are!"<br>
End If<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,2 @@
<html><head><title>Command: ElseIf </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ElseIf &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Alternate command for the END IF command, it performs an additional IF condition check during an IF ... THEN conditional structure.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>During a standard <a href='IF.htm'>IF</a> ... <a href='THEN.htm'>THEN</a> conditional structure, you may wish to check another condition if the original condition fails. This 'nested IF' situation can get WAY out of hand, and once you have more than two nested conditionals, you should consider a <a href='SELECT.htm'>SELECT</a>/<a href='CASE.htm'>CASE</a> structure. See the example.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; ELSEIF Example<br><br>; Input the user's name<br>name$=Input$("What is your name? ")<br><br>; Doesn't the person's name equal SHANE?<br>If name$ = "Shane" Then<br><br>Print "You are recognized, Shane! Welcome!"<br><br>ElseIf name$="Ron" then<br>Print "You are recognized too, Ron! Welcome!"<br><br>Else<br>Print "Sorry, you don't belong here!"<br><br>; End of the condition checking<br>End If<br><br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,16 @@
<html><head><title>Command: End Function </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;End Function &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Denotes the end of a Function structure.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This line terminates a <a href='FUNCTION.htm'>FUNCTION</a> structure. Upon reaching this line, Blitz will branch program execution to the next command following the original call to the function. See the <a href='FUNCTION.htm'>FUNCTION</a> command for more information.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; End Function Example<br>
<br>
; Get the user's name<br>
name$=Input$("Enter Your Name:")<br>
<br>
; Call a function to print how many letters the name has<br>
numletters(name$);<br>
<br>
;The program basically ends here, because functions don't run unless called.<br>
<br>
; The actual function<br>
Function numletters(passedname$)<br>
Print "Your name has " + Len(passedname$) + " letters in it."<br>
End Function<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,18 @@
<html><head><title>Command: End If </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;End If &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Closing element of an IF/THEN condition checking structure.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>END IF signals the end of an IF THEN condition check. See <a href='IF.htm'>IF</a> for more information. You can also use ENDIF as a single word command - it functions identically.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; IF THEN Example<br>
<br>
; Input the user's name<br>
name$=Input$("What is your name? ")<br>
<br>
; Doesn't the person's name equal SHANE?<br>
If name$ = "Shane" Then<br>
<br>
Print "You are recognized, Shane! Welcome!"<br>
<br>
Else<br>
<br>
Print "Sorry, you don't belong here!"<br>
<br>
; End of the condition checking<br>
End If<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,27 @@
<html><head><title>Command: End Select </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;End Select &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>The closing command in a SELECT structure.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command ends the <a href='SELECT.htm'>SELECT</a> structure. If you are using <a href='DEFAULT.htm'>DEFAULT</a> commands, this is the ending point of that command set's execution. See <a href='SELECT.htm'>SELECT</a>, <a href='CASE.htm'>CASE</a>, and <a href='DEFAULT.htm'>DEFAULT</a> for more information.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; SELECT/CASE/DEFAULT/END SELECT Example<br>
; Assign a random number 1-10<br>
mission=Rnd(1,10)<br>
<br>
; Start the selection process based on the value of 'mission' variable<br>
Select mission<br>
<br>
; Is mission = 1?<br>
Case 1<br>
Print "Your mission is to get the plutonium and get out alive!"<br>
<br>
; Is mission = 2?<br>
Case 2<br>
Print "Your mission is to destroy all enemies!"<br>
<br>
; Is mission = 3?<br>
Case 3 <br>
Print "Your mission is to steal the enemy building plans!"<br>
<br>
; What do do if none of the cases match the value of mission<br>
Default <br>
Print "Missions 4-10 are not available yet!"<br>
<br>
; End the selection process<br>
End Select<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,12 @@
<html><head><title>Command: End Type </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;End Type &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>The last command of the TYPE ... END TYPE object creation.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>If you haven't read up on the <a href='TYPE.htm'>TYPE</a>
command, you might want to do so before continuing.<br>
<br>
After assigning all the <a href='Field.htm'>Field</a> variables in your Type object, use this to finish the creation of the Type.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Define the CHAIR Type<br>
<br>
Type CHAIR<br>
Field X<br>
Field Y<br>
Field HEIGHT<br>
End Type<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,5 @@
<html><head><title>Command: End </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;End &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Stops the program execution and exits the program.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to stop your program running. You will be returned to the editor if running from there, or the program will completely exit if running a compiled EXE version.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; If the game is over, then quit<br>
<br>
if gameOver=1 then End<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,22 @@
<html><head><title>Command: EndGraphics </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;EndGraphics &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Ends the graphics mode.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command ends the graphics mode, and puts Blitz back into 'text' mode (for lack of a better term).</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; End Graphics Example<br>
<br>
; Enter graphics mode<br>
Graphics 640,480,16<br>
<br>
; Print hello 10 times on the graphic screen<br>
For t = 1 To 10<br>
Print "Hello"<br>
Next<br>
<br>
; Wait for a left mouse button<br>
While Not MouseHit(1)<br>
Wend <br>
<br>
; End the graphics mode<br>
EndGraphics <br>
<br>
; Print again, this time to the text screen<br>
For t = 1 To 10<br>
Print "There"<br>
Next<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,18 @@
<html><head><title>Command: EndIF </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;EndIF &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Another acceptable version of the END IF statement</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Terminates an <a href='IF.htm'>IF</a> ... <a href='THEN.htm'>THEN</a> condition structure. See <a href='END IF.htm'>END IF</a> for more information.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; IF THEN Example<br>
<br>
; Input the user's name<br>
name$=Input$("What is your name? ")<br>
<br>
; Doesn't the person's name equal SHANE?<br>
If name$ = "Shane" Then<br>
<br>
Print "You are recognized, Shane! Welcome!"<br>
<br>
Else<br>
<br>
Print "Sorry, you don't belong here!"<br>
<br>
; End of the condition checking<br>
EndIf<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,20 @@
<html><head><title>Command: ExecFile </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;ExecFile (filename$)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Runs an external executable program from within a Blitz program.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>filename$ = any valid variable or path/filename to the executable program</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to halt execution of your program and run an external program.<br>
<br>
The usefulness of this command is really mostly for calling some system level command, launching a browser, etc. Without the ability to playback a movie (for cutscenes, etc) I would think the most useful part of this is command would be calling a self-contained .exe movie (a la BLINK) to play as an intro, then when its completed, return to your program for continued execution.<br>
<br>
Note: This command uses ShellExecute to allow you to 'open' any file (like a .doc or .txt) file with its default associated program.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; ExecFile sample - RUN THIS WINDOWED!<br>
; Win9x users will need to change location of calc.exe<br>
<br>
filename$="c:\winnt\system32\calc.exe"<br>
<br>
Print "Press any key to run CALC.EXE!"<br>
<br>
WaitKey()<br>
<br>
ExecFile(filename$)<br>
<br>
Print "Press any key to quit."<br>
<br>
WaitKey()<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,7 @@
<html><head><title>Command: Exit </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Exit &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Exits a loop prematurely.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command will allow you to leave a <a href='For.htm'>For</a> .. <a href='Next.htm'>Next</a> loop as well as many other types of loops prematurely (assuming a condition was met or other planned event). It exits the IMMEDIATE loop - you'll need one for each 'nest' of loops you want to exit from.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; EXIT Command sample<br>
<br>
For t = 1 To 100<br>
Print t<br>
If t = 50 Then Exit<br>
Next<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,6 @@
<html><head><title>Command: Exp </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Exp (number)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the base of the natural system of logarithms e, raised to the power of the supplied argument.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>number=float or integer<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Exp() is the exponential function. Logarithms to the base <i>e</i> are called the Natural or Napierian logarithms. The Exp() and <a href='Log.htm'>Log</a> functions use the transcendental number <i>e</i> as a base (approx 2.718). Exp() is the inverse of the antilogarithm <a href='Log.htm'>Log</a> function.
See also: <a href='Log.htm'>Log</a> <a href='Log10.htm'>Log10</a></td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; To find the value of e<br>
print Exp(1) ; i.e. e^1, returns 2.718281<br>
; To find the value of e^5<br>
print Exp(5) ; returns 148.413162<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,21 @@
<html><head><title>Command: False </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;False &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>A boolean expression used in comparisons. Actually returns a value of 0.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>FALSE is a keyword to denote a negative result in a conditional statement. Often times, FALSE is implied and doesn't need to be directly referenced - or a <a href='NOT.htm'>NOT</a> command is used in the comparison. FALSE can also be used as a <a href='RETURN.htm'>RETURN</a> value from a <a href='FUNCTION.htm'>FUNCTION</a>. Also see the <a href='TRUE.htm'>TRUE</a> command. See the example.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; FALSE example<br>
<br>
; Assign test a random number of 0 or 1<br>
test= Rnd(0,1)<br>
<br>
; FALSE is implied because of the NOT<br>
If not test=1 Then<br>
Print "Test was valued at 0"<br>
End If<br>
<br>
; Let's set test to be false<br>
test=False<br>
<br>
; Pointlessly test it<br>
If test=False Then<br>
Print "Test is false"<br>
else<br>
print "Test is true"<br>
End If<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,28 @@
<html><head><title>Command: Field </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Field variable&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Assigns a variable for use into a TYPE object structure.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>variable = any legal variable</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>If you haven't read up on the <a href='TYPE.htm'>TYPE</a>
command, you might want to do so before continuing.</p>
<p>When you define a custom Type, you need to assign some variables to track within
in. Using the Field command within the Type .. <a href='End
Type.htm'>End
Type</a> commands, you set a variable that can be used for EACH object created
with the <a href='NEW.htm'>NEW</a>
command.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Define the CHAIR Type<br>
<br>
Type CHAIR<br>
Field X<br>
Field Y<br>
Field HEIGHT<br>
End Type</p>
<p>; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM</p>
<p>For tempx = 1 to 10<br>
For tempy = 1 to 10<br>
room.chair = New Chair<br>
room\x = tempx<br>
room\y = tempy<br>
room\height = Rnd(0,10) ; set a random height 0 to 10<br>
Next<br>
Next</p>
<p>; Move them all over 1 (like the description example from TYPE command)</p>
<p>For room.chair = Each chair<br>
room\x = room\x + 1<br>
Next<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,69 @@
<html><head><title>Command: FilePos </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;FilePos (filehandle)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the current position within a file that is being read, written or modified.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>filehandle = the variable returned by the Readfile WriteFile or OpenFile when the file was opened. The value returned is the offset from the start of the file. ( 0 = Start of
the file )</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command returns the current position within a file that is being processed following ReadFile, WriteFile or OpenFile. The returned integer is the offsets in bytes from the start of the file to the current read/write position. Note, this is zero when pointing to the first byte of the file.<br>
<br>
By using FilePos and SeekFile the position within the file that is being read or written can be determined and also changed. This allows a file to be read and updated without having to make a new copy of the file or working through the whole file sequentially. This could be useful if you have
created a database file and you want to find and update just a few records within it. It is also possible to create an index file that contains pointers to where each record starts in a data file.<br>
<br>
See also:<br>
<a href='ReadByte.htm'>ReadByte</a>, <a href='ReadShort.htm'>ReadShort</a>, <a href='ReadInt.htm'>ReadInt</a>, <a href='ReadFloat.htm'>ReadFloat</a>, <a href='ReadString$.htm'>ReadString$</a>, <a href='ReadLine$.htm'>ReadLine$</a>, <a href='WriteByte.htm'>WriteByte</a>, <a href='WriteShort.htm'>WriteShort</a>, <a href='WriteInt.htm'>WriteInt</a>, <a href='WriteFloat.htm'>WriteFloat</a>, <a href='WriteShort.htm'>WriteShort</a>, <a href='WriteString.htm'>WriteString</a>, <a href='WriteLine.htm'>WriteLine</a>, <a href='ReadFile.htm'>ReadFile</a>, <a href='WriteFile.htm'>WriteFile</a>, <a href='OpenFile.htm'>OpenFile</a>, <a href='CloseFile.htm'>CloseFile</a>, <a href='Eof.htm'>Eof</a>, <a href='FileType.htm'>FileType</a>, <a href='FilePos.htm'>FilePos</a>, <a href='SeekFile.htm'>SeekFile</a></td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Changing part of a file using OpenFile, SeekFile, FilePos<br>
; note FilePos is used in the SearchFile function at the end of this example<br>
<br>
; Open/create a file to Write<br>
fileout = WriteFile("mydata.dat")<br>
<br>
; Write the information to the file<br>
WriteInt( fileout, 1 )<br>
WriteInt( fileout, 2 )<br>
WriteInt( fileout, 3 )<br>
WriteInt( fileout, 4 )<br>
WriteInt( fileout, 5 )<br>
<br>
; Close the file<br>
CloseFile( fileout )<br>
<br>
DisplayFile( "The file as originally written", mydata.dat" )<br>
Position = SearchFile( 4 , "mydata.dat" )<br>
Write "Value 4 was found "<br>
Write Position<br>
Print " bytes from the start."<br>
Print<br>
<br>
; Open the file and change the value 3 to 9999<br>
<br>
file = OpenFile("mydata.dat")<br>
SeekFile( file, Position ) ; Move to the found location<br>
WriteInt( file, 9999 ) ; Replace the original value with 9999<br>
CloseFile( file )<br>
<br>
<br>
DisplayFile( "The file after being modified", "mydata.dat" )<br>
WaitKey()<br>
End ; End of program<br>
<br>
; **** Function Definitions follow ****<br>
<br>
; Read the file and print it<br>
Function DisplayFile( Tittle$, Filename$ )<br>
Print tittle$<br>
file = ReadFile( Filename$ )<br>
While Not Eof( file )<br>
Number = ReadInt( file )<br>
Print Number<br>
Wend<br>
CloseFile( file )<br>
Print<br>
End Function<br>
<br>
; Search a file of integers for the Wanted data value<br>
; Note the need to subtract 4 from the location since having read it<br>
; we are now pointing at the next Integer also Return() was placed<br>
; after closing the file so it is closed properly<br>
Function SearchFile( Wanted, Filename$ )<br>
file = ReadFile( Filename$ )<br>
While Not Eof( file )<br>
If ReadInt( file ) = Wanted Then Location = FilePos( file ) - 4<br>
Wend<br>
CloseFile( file )<br>
Return( Location )<br>
End Function<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,10 @@
<html><head><title>Command: FileSize </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;FileSize (filename$)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the size of the requested file - in bytes.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>filename$ = any valid variable with path/filename</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Often it will be useful to return the size of a file. File size is important for copying, reading, and other file evolutions.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Windows 9x users will need to change location of calc.exe<br>
<br>
filename$="c:\winnt\system32\calc.exe"<br>
<br>
Print "The size of the file is: " + FileSize(filename$)<br>
<br>
Print "Press any key to quit."<br>
<br>
WaitKey()<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,18 @@
<html><head><title>Command: FileType </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;FileType (filename$)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Checks to see if the designated filename exists or is a directory.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>filename$ = any valid variable with path/filename</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command checks the filename you pass and determines if it exists and whether or not it is a valid filename or if it is a directory. Here are the values it returns:<br>
<br>
1 = The filename exists<br>
0 = The filename doesn't exist<br>
2 = The filename is not a file - but a directory<br>
<br>
Use this to validate that a file exists before you do something to it.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Windows 9x users will need to change location of calc.exe<br>
<br>
filename$="c:\winnt\system32\calc.exe"<br>
<br>
if fileType(filename$)=1 then Print "The file exists!"<br>
if fileType(filename$)=0 then Print "File not found!"<br>
if fileType(filename$)=2 then Print "This is a directory!"<br>
<br>
Print "Press any key to quit."<br>
<br>
WaitKey()<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,18 @@
<html><head><title>Command: FindGfxMode </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;FindGfxMode (width,height,depth) &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the mode number of a graphic mode meeting your criteria.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>width = width, in pixels (i.e. 640)<br>
height = height, in pixels (i.e. 480)<br>
depth = color depth (i.e. 16, 24, 32)<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to determine which of the user's graphic card mode supports the parameters you supply. You can get a full detailed list of the video card modes - see <a href='CountGFXModes().htm'>CountGFXModes()</a>.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; FindGFXMode example<br>
<br>
; change values to see different mode numbers<br>
mode=FindGfxMode(800,600,16) <br>
<br>
; If there is a mode, tell user<br>
If mode > 0 Then <br>
Print "The mode you requested is: " + mode<br>
Else<br>
Print "That mode doesn't exist for this video card."<br>
End If<br>
<br>
; Wait for ESC press from user<br>
While Not KeyHit(1)<br>
Wend<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,43 @@
<html><head><title>Command: First </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;First type_variable&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Move the Type object pointer to the first object in the collection.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>type_variable = the actual Type name, not the custom Type name</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>If you haven't read up on the <a href='TYPE.htm'>TYPE</a>
command, you might want to do so before continuing.</p>
<p>Use this to assign a custom Type object to the first object in the collection.
See the example.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Define a crafts Type</p>
<p>Type crafts<br>
Field x<br>
Field y<br>
Field dead<br>
Field graphic<br>
End Type</p>
<p>; Create 100 crafts, with the unique name of alien<br>
For t = 1 To 100 <br>
alien.crafts = New crafts<br>
alien\x = Rnd(0,640)<br>
alien\y = Rnd(0,480)<br>
alien\dead = 0<br>
alien\graphic = 1<br>
Next</p>
<p>; Move to the first object<br>
alien.crafts = First crafts</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the next alien object<br>
alien = After alien</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the last alien object<br>
alien.crafts = Last crafts</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the second to the last alien object<br>
alien = Before alien</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,21 @@
<html><head><title>Command: Flip </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Flip [vwait] &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>In a double buffering environment, flips the BackBuffer into view.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>vwait = set to TRUE to wait for vertical blank to finish</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>When you are double buffering (or doing all drawing operations to the <a href='BackBuffer().htm'>BackBuffer()</a>, at some point, after you've drawn all your elements - you will need to 'flip' that Backbuffer into the visible <a href='FrontBuffer().htm'>FrontBuffer()</a> so it can be seen. This command will perform this function. This allows you to draw massive amounts of information quickly, then flip it into view. See BackBuffer() for more info.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Flip/Backbuffer()/Rect Example<br>
<br>
; Set Graphics Mode<br>
Graphics 640,480<br>
<br>
; Go double buffering<br>
SetBuffer BackBuffer()<br>
<br>
; Setup initial locations for the box<br>
box_x = -20 ; negative so it will start OFF screen<br>
box_y = 100<br>
<br>
While Not KeyHit(1)<br>
Cls ; Always clear screen first<br>
Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location<br>
Flip ; Flip it into view<br>
box_x = box_x + 1 ; Move the box over one pixel<br>
If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location<br>
Wend<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,10 @@
<html><head><title>Command: Float </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Float variable/value&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Convert integer value to a floating point number.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>variable/value = integer value or variable</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Use this command to transform an integer value to a floating point value (presumably to perform a floating point related math function on it). Blitz does a good job of adding dissimilar number types, but if you want to play by the rules and/or port code to/from Blitz, remember to convert your integers to floating point before doing math upon them with dissimilar types.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Float example<br>
<br>
a=100<br>
b#=2.5<br>
c#=Float a<br>
<br>
Print b# + c#<br>
<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,12 @@
<html><head><title>Command: Floor# </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Floor# (float)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Rounds a decimal floating variable down to the nearest whole number.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>float=floating point number</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Many times, you will need to round up or down a floating point decimal variable. This command rounds it down to the nearest whole number. Use <a href='Ceil#.htm'>Ceil#</a> to round the number up.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Floor#/Ceil# Example<br>
<br>
; Set a floating point variable<br>
myVal#=0.5<br>
<br>
; Round it up<br>
Print Floor#(myval)<br>
<br>
;Round it down<br>
Print Ceil#(myval)<br>
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,10 @@
<html><head><title>Command: FlushJoy </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;FlushJoy &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Flushes out all the queued up joystick button presses.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>There are many times when you aren't interested in the dozens of possible joystick button pressed the player might have made before you are checking for one in particular. Or perhaps you want to pause the game and wait for any joystick button to be hit, but you don't want a 'queued' button press bypassing this. Use this command before you specifically want to poll a joystick button hit from the user.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; FlushJoy sample<br>
<br>
FlushJoy<br>
<br>
Print "Press a joystick button to exit!"<br>
<br>
WaitJoy()<br>
<br>
End<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,4 @@
<html><head><title>Command: FlushKeys </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;FlushKeys &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Flushes all the currently queued keystrokes.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command 'resets' or 'empties out' the queue holding the keyboard inputs. Can't make it much easier than that.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; clear all keystrokes from the queue<br>
FlushKeys<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,10 @@
<html><head><title>Command: FlushMouse </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;FlushMouse &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Flushes out all the queued up mouse button presses.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>There are many times when you aren't interested in the dozens of possible mouse button pressed the player might have made before you are checking for one in particular. Or perhaps you want to pause the game and wait for any mouse button to be hit, but you don't want a 'queued' button press bypassing this. Use this command before you specifically want to poll a mouse button hit from the user.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Flushmouse sample<br>
<br>
FlushMouse<br>
<br>
Print "Press a mouse button to exit!"<br>
<br>
WaitMouse()<br>
<br>
End<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,23 @@
<html><head><title>Command: FontHeight() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;FontHeight() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the height of the currently selected font.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This returns the height, in pixels, of the currently selected font (using <a href='SetFont.htm'>SetFont</a> - previously loaded with <a href='LoadFont.htm'>LoadFont</a>).</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; FontWidth()/FontHeight example<br>
<br>
; enable graphics mode<br>
Graphics 800,600,16<br>
<br>
; Set global on font variable<br>
Global fntArial<br>
<br>
;Load fonts to a file handle variables<br>
fntArial=LoadFont("Arial",13,False,False,False)<br>
<br>
; set the font and print sizes<br>
SetFont fntArial<br>
Text 400,0,"The font width of the widest character is:"+ FontWidth(),True,False<br>
Text 400,30,"The height of the font is:"+ FontHeight(),True,False<br>
<br>
; Standard 'wait for ESC' from user<br>
While Not KeyHit(1)<br>
Wend<br>
<br>
; Clear all the fonts from memory!<br>
FreeFont fntArial<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>
@@ -0,0 +1,23 @@
<html><head><title>Command: FontWidth() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;FontWidth() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the width of the widest character of the currently selected font.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This returns the width, in pixels, of the currently selected font (using <a href='SetFont.htm'>SetFont</a> - previously loaded with <a href='LoadFont.htm'>LoadFont</a>). This command returns the width of the WIDEST character of the font.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; FontWidth()/FontHeight example<br>
<br>
; enable graphics mode<br>
Graphics 800,600,16<br>
<br>
; Set global on font variable<br>
Global fntArial<br>
<br>
;Load fonts to a file handle variables<br>
fntArial=LoadFont("Arial",13,False,False,False)<br>
<br>
; set the font and print sizes<br>
SetFont fntArial<br>
Text 400,0,"The font width of the widest character is:"+ FontWidth(),True,False<br>
Text 400,30,"The height of the font is:"+ FontHeight(),True,False<br>
<br>
; Standard 'wait for ESC' from user<br>
While Not KeyHit(1)<br>
Wend<br>
<br>
; Clear all the fonts from memory!<br>
FreeFont fntArial<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>

Some files were not shown because too many files have changed in this diff Show More