Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UBOUND
#4
(02-03-2024, 10:28 PM)SMcNeill Wrote: To highlight what bplus is saying:

DIM x
DIM x(5)

Of the above, which is a variable and which is an array?

That's basically what you've did in your code.
I thought that "x" was an array 1 x 1, as to say made by 1 variable and I thought that x(5) was an array 6 x 1, made by 6 varibles... so to:

Code: (Select All)

OPTION _EXPLICIT
OPTION BASE 1
DIM myArray%
PRINT UBOUND(myArray%)

I expected the answer "1".

So, what is the difference beetween:

DIM x%(1) and DIM x%?

(I generally use OPTION BASE 1. Without it I would expected "0" and DIM x%(1) would be DIM x%(0))
Reply


Messages In This Thread
UBOUND - by bartok - 02-03-2024, 08:54 PM
RE: UBOUND - by bplus - 02-03-2024, 10:03 PM
RE: UBOUND - by SMcNeill - 02-03-2024, 10:28 PM
RE: UBOUND - by bartok - 02-04-2024, 08:34 AM
RE: UBOUND - by SMcNeill - 02-04-2024, 12:28 PM
RE: UBOUND - by bartok - 02-04-2024, 12:45 PM



Users browsing this thread: 1 Guest(s)