RosettaCodeData/Task/Array-length/PureBasic/array-length-1.basic

13 lines
398 B
Plaintext

EnableExplicit
Define Dim fruit$(1); defines array with 2 elements at indices 0 and 1
fruit$(0) = "apple"
fruit$(1) = "orange"
Define length = ArraySize(fruit$()) + 1; including the element at index 0
If OpenConsole()
PrintN("The length of the fruit array is " + length)
PrintN("")
PrintN("Press any key to close the console")
Repeat: Delay(10) : Until Inkey() <> ""
CloseConsole()
EndIf