62 lines
1.7 KiB
HTML
62 lines
1.7 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>CreateBank ([size])</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
size - size of memory bank in bytes (default is 0 bytes)
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
The bank commands allow you to perform high-speed data operations on a block of memory. This is useful for writing your own compression/decompression routines, passing and receiving data to and from a DLL and more. Banks start at 0 and finish at size-1.
|
|
<br />
|
|
|
|
<br />
|
|
The data types available for use with a bank are:
|
|
<br />
|
|
|
|
<br />
|
|
Byte - takes up one byte. Values can be in the range 0 to 255.
|
|
<br />
|
|
Short - takes up two bytes. Values can be in the range 0 to 65535.
|
|
<br />
|
|
Int - takes up four bytes. Values can be in the range -2147483647 to 2147483647.
|
|
<br />
|
|
Float - takes up four bytes.
|
|
<br>
|
|
<br>
|
|
See also: <a class=small href=FreeBank.htm>FreeBank</a>.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../2d_examples/CreateBank.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; Bank Commands Example
|
|
<br />
|
|
; ---------------------
|
|
<br />
|
|
|
|
<br />
|
|
bnkTest=CreateBank(12)
|
|
<br />
|
|
|
|
<br />
|
|
PokeByte bnkTest,0,Rand(255)
|
|
<br />
|
|
PokeShort bnkTest,1,Rand(65535)
|
|
<br />
|
|
PokeInt bnkTest,3,Rand(-2147483648,2147483647)
|
|
<br />
|
|
PokeFloat bnkTest,7,0.5
|
|
<br />
|
|
|
|
<br />
|
|
Print PeekByte(bnkTest,0)
|
|
<br />
|
|
Print PeekShort(bnkTest,1)
|
|
<br />
|
|
Print PeekInt(bnkTest,3)
|
|
<br />
|
|
Print PeekFloat(bnkTest,7)
|
|
<br />
|
|
|
|
<br />
|
|
FreeBank bnkTest
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=CreateBank&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|