CreateBank.htm 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>CreateBank ([size])</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. size - size of memory bank in bytes (default is 0 bytes)
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. 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 />
  21. <br />
  22. The data types available for use with a bank are: <br />
  23. <br />
  24. Byte - takes up one byte. Values can be in the range 0 to 255. <br />
  25. Short - takes up two bytes. Values can be in the range 0 to 65535. <br />
  26. Int - takes up four bytes. Values can be in the range -2147483647 to 2147483647. <br />
  27. Float - takes up four bytes.
  28. <br>
  29. <br>
  30. See also: <a class=small href=FreeBank.htm>FreeBank</a>.
  31. </td>
  32. </tr>
  33. </table>
  34. <h1><a href=../2d_examples/CreateBank.bb>Example</a></h1>
  35. <table>
  36. <tr>
  37. <td>
  38. ; Bank Commands Example <br />
  39. ; --------------------- <br />
  40. <br />
  41. bnkTest=CreateBank(12) <br />
  42. <br />
  43. PokeByte bnkTest,0,Rand(255) <br />
  44. PokeShort bnkTest,1,Rand(65535) <br />
  45. PokeInt bnkTest,3,Rand(-2147483648,2147483647) <br />
  46. PokeFloat bnkTest,7,0.5 <br />
  47. <br />
  48. Print PeekByte(bnkTest,0) <br />
  49. Print PeekShort(bnkTest,1) <br />
  50. Print PeekInt(bnkTest,3) <br />
  51. Print PeekFloat(bnkTest,7) <br />
  52. <br />
  53. FreeBank bnkTest
  54. </td>
  55. </tr>
  56. </table>
  57. <br>
  58. <a target=_top href=../index.htm>Index</a><br>
  59. <br>
  60. 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>
  61. </html>