Short list with things to finish for D2

Ellery Newcomer ellery-newcomer at utulsa.edu
Wed Nov 25 10:11:48 PST 2009


On 11/25/2009 10:46 AM, Don wrote:
> Denis Koroskin wrote:
>>>> I recall that Visual Basic has UBound function that returns upper
>>>> bound of a multi-dimensional array:
>>>> Dim a(100, 5, 4) As Byte
>>>> UBound(a, 1) -> 100
>>>> UBound(a, 2) -> 5
>>>> UBound(a, 3) -> 4
>>>> Works for single-dimensional arrays, too:
>>>> Dim b(8) As Byte
>>>> UBound(b) -> 8
>
>> I brought a point that VB has a UBound function that does exactly what
>> opDollar is supposed to do, so something like opUpperBound() might fit.
>
> Finally, a viable alternative to opDollar! I could live with
> opUpperBound.

<nitpick>

VB's ubound doesn't do exactly the same thing as $; in your code snippet

b(0)
b(8)

are both valid elements.

Does opUpperBound imply an opLowerBound?

In VB you can declare things like

dim a(20 to 100, 5, 1 to 4) as Byte

LBound(a,1) -> 20

Yep. Visual Basic. Awesome language. *Cough*



More information about the Digitalmars-d mailing list