Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best way to put UDG in my program ?
ivanb303 Wrote:It does work even without the --sinclair compile option, but you have to change the indexes in the array around. The old does the
array index start from 1 or 0 Smile
Yes. In "modern" Basic (see FreeBASIC) arrays starts from 0 like in C. This is slightly faster and simplifies some programs.
You can explicitly tell the compiler to start from 1. For example an array from 1 TO 8 will be:
DIM myArray(1 TO 8)
If you omit the "1 TO", it will use "0 TO" as default. If you're copying a Sinclair BASIC listing, it's better to use --sinclair.
If you're starting from scratch, the modern BASIC dialect is recommended. ZX Basic tries to follow Visual Basic / FreeBasic dialects as much as possible.

Messages In This Thread

Forum Jump:

Users browsing this thread: 1 Guest(s)