Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UBOUND
#6
(02-04-2024, 12:28 PM)SMcNeill Wrote: DIM X(1) is an array with one element.
DIM X is a variable.

SUB foo(x, y() )

Now, in that SUB, what values can you pass to those parameters?
For x, you pass a single value, or a variable.
Your y(), you pass a whole array.

A variable is NOT the same as a single element array.

Variables can never be REDIMed to hold more elements.  They have no indexes.  The contain just a single value.  

Even a single-element array has an index.  X(0).  This index tells you, "THIS IS NOT A VARIABLE."  Don't fool yourself into thinking it is.
Ok, It's clear. Thank's!
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)