none
Is this a bug? RRS feed

  • Question

  • Hi everyone,

    As far as I know Small basic array indexing starts from 1 to keep things simple, however it is possible to use index 0 which from my tests holds the same value as index 1.

    Kirk.

    Sunday, April 29, 2012 5:33 PM

Answers

  • The indexing for SmallBasic arrays can be anything, even a string or even a shape, so any of these is valid.

    array[1] = 5

    array[0] = 12

    array[Controls.AddButton("TEST",100,100)] = 8

    So you can easily index starting from 0 or even -10!

    • Marked as answer by Kirkkaf Sunday, April 29, 2012 8:05 PM
    Sunday, April 29, 2012 6:23 PM
    Moderator

All replies

  • The indexing for SmallBasic arrays can be anything, even a string or even a shape, so any of these is valid.

    array[1] = 5

    array[0] = 12

    array[Controls.AddButton("TEST",100,100)] = 8

    So you can easily index starting from 0 or even -10!

    • Marked as answer by Kirkkaf Sunday, April 29, 2012 8:05 PM
    Sunday, April 29, 2012 6:23 PM
    Moderator
  • Thanks Litdev,

    It appears there was an error in my code.

    Kirk.

    Sunday, April 29, 2012 7:55 PM