Revision history for KeyPgLbound


Revision [21639]

Last edited on 2016-10-30 18:19:29 by fxm [Formatting]

No Differences

Revision [20956]

Edited on 2016-03-13 04:14:39 by fxm [Formatting]

No Differences

Revision [20287]

Edited on 2016-02-10 16:01:54 by DkLwikki [Update link format]
Additions:
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Lbound** ( array() [[KeyPgAs|as]] [[KeyPgAny|any]], [[KeyPgByval|byval]] //dimension// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 1 ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
- ##[[KeyPgUbound|Ubound]]##
- ##[[KeyPgStatic|Static]]##
- ##[[KeyPgDim|Dim]]##
- ##[[KeyPgRedim|Redim]]##
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Lbound** ( array() [[KeyPgAs as]] [[KeyPgAny any]], [[KeyPgByval byval]] //dimension// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1 ) [[KeyPgAs as]] [[KeyPgInteger integer]]
- ##[[KeyPgUbound Ubound]]##
- ##[[KeyPgStatic Static]]##
- ##[[KeyPgDim Dim]]##
- ##[[KeyPgRedim Redim]]##


Revision [16820]

Edited on 2013-05-27 15:40:52 by DkLwikki [Update for 0/-1 instead of 1/0]
Additions:
If ##//dimension//## is zero (##0##), ##**Lbound**## returns ##1##, corresponding to the lower bound of the array dimensions ##1##..##//n//##. ##**Ubound**## returns ##//n//##, the number of dimensions, in this case. This can be used to detect the array's number of dimensions.
For any other (non-zero) ##//dimension//## values outside of the valid range ##1##..##//n//##, ##**Lbound**## returns ##0##. ##**Ubound**## returns ##-1## in this case. This can be used to detect whether a certain dimension exists in the array, and also works when used on an empty array which does not have any valid dimensions.
Thus, for empty dynamic arrays, we get:
- ##Lbound(array) = 0## and ##Ubound(array) = -1## (dimension 1 does not exist)
- ##Lbound(array, 0) = 1## and ##Ubound(array, 0) = 0## (zero dimensions)
- ##@array(Lbound(array)) = 0## (no data buffer allocated)
Deletions:
If ##//dimension//## is zero (##0##) or another value outside of the valid range ##1##..##//n//##, the result is ##1##. Combined with the result of Ubound() for such cases, this can be used to detect the number of dimensions of variable-length arrays, for example whether a given dimension exists, or whether the array is empty (zero dimensions).


Revision [16506]

Edited on 2012-12-26 09:38:31 by DkLwikki [formatting]
Additions:
Array dimensions are numbered from one (##1##) to ##//n//##, where ##//n//## is the total number of dimensions. If ##//dimension//## is not specified, ##**Lbound**## will return the lower bound of the first dimension.
If ##//dimension//## is zero (##0##) or another value outside of the valid range ##1##..##//n//##, the result is ##1##. Combined with the result of Ubound() for such cases, this can be used to detect the number of dimensions of variable-length arrays, for example whether a given dimension exists, or whether the array is empty (zero dimensions).
Deletions:
Array dimensions are numbered from one (1) to //n//, where //n// is the total number of dimensions. If ##//dimension//## is not specified, ##**Lbound**## will return the lower bound of the first dimension.
If ##//dimension//## is zero (0) or another value outside of the valid range 1..//n//, the result is 1. Combined with the result of Ubound() for such cases, this can be used to detect the number of dimensions of variable-length arrays, for example whether a given dimension exists, or whether the array is empty (zero dimensions).


Revision [16505]

Edited on 2012-12-26 09:36:33 by DkLwikki [update: invalid dimension is now ok]
Additions:
Array dimensions are numbered from one (1) to //n//, where //n// is the total number of dimensions. If ##//dimension//## is not specified, ##**Lbound**## will return the lower bound of the first dimension.

If ##//dimension//## is zero (0) or another value outside of the valid range 1..//n//, the result is 1. Combined with the result of Ubound() for such cases, this can be used to detect the number of dimensions of variable-length arrays, for example whether a given dimension exists, or whether the array is empty (zero dimensions).
Deletions:
Array dimensions are numbered from one (1) to //n//, where //n// is the total number of dimensions. If ##//dimension//## is not specified, ##**Lbound**## will return the lower bound of the first dimension. If ##//dimension//## is less than one (1) or greater than the total number of dimensions (//n//) in the array, the result is undefined.


Revision [9902]

The oldest known version of this page was created on 2007-07-22 20:49:33 by JeffMarshall [update: invalid dimension is now ok]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode