lang_ref_arrays.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type"
  4. content="text/html; charset=iso-8859-1">
  5. <title>Language Reference - Arrays</title>
  6. <link rel="stylesheet" href="lang_ref.css" type="text/css">
  7. </head>
  8. <body><br>
  9. &nbsp;<span class="Command">&nbsp;Arrays&nbsp;</span>
  10. <blockquote>
  11. <p>Arrays are created using the standard BASIC '<b>Dim</b>' statement, and may
  12. be of any number of dimensions. For example: </p>
  13. <blockquote>
  14. <p><i>Dim arr(10)</i></p>
  15. </blockquote>
  16. <p> Creates a one dimensional array called 'arr' with 11 elements numbered 0...10.<br>
  17. </p>
  18. <p> Arrays may be of any basic type, or a custom type.<br>
  19. <br>
  20. The type of an array is specified using a type tag. For example: </p>
  21. <blockquote>
  22. <p> <i>Dim Deltas#(100)</i></p>
  23. </blockquote>
  24. <p> Creates an array called 'Deltas' of 101 floating point elements. </p>
  25. <p>If the type tag is omitted, the array defaults to an integer array. </p>
  26. <p>An array may be dimensioned at more than one point in a program, each time
  27. an array is dimensioned, it's previous contents are discarded. Arrays may
  28. be dimensioned inside functions, but a corresponding 'Dim' statement of the
  29. same array must also appear somewhere in the main program. For example:</p>
  30. <blockquote>
  31. <p> <i> Dim test(0,0) </i></p>
  32. <p><i> Function Setup( x,y ) </i></p>
  33. <blockquote>
  34. <p><i>Dim test(x,y) </i></p>
  35. </blockquote>
  36. <p><i> End Function</i> </p>
  37. </blockquote>
  38. </blockquote>
  39. </body>
  40. </html>