Shop OBEX P1 Docs P2 Docs Learn Events
check if array is empty — Parallax Forums

check if array is empty

Harry1Harry1 Posts: 29
edited 2007-03-21 22:43 in Propeller 1
i was wondering if there was a way to check with a specific index in the array was empty

e.g. to check if array[noparse][[/noparse]1] = null

Comments

  • Robot FreakRobot Freak Posts: 168
    edited 2007-03-21 20:07
    I think the value then equals to 0
  • Harry1Harry1 Posts: 29
    edited 2007-03-21 20:19
    but it is an array of integers, so some of the values equal 0
  • TransistorToasterTransistorToaster Posts: 149
    edited 2007-03-21 20:35
    Do you want to check just one element or a group of neighboring elements?
  • Jasper_MJasper_M Posts: 222
    edited 2007-03-21 22:43
    No, there is no way to do that. If all the elements are numbers, they are numbers, there's no NULL or special "non-assigned" values. There's nothing like an "empty array" in spin - arrays are just statically allocated memory with no extra functionality. You just have to declare a variable like myArrayEmpty, set it as true when your program starts, and set it as false when your program has filled the array.
Sign In or Register to comment.