ArraySize

Size of array.

Declaration

Sintaxe

ArraySize(expr v, expr? dim, ttype type, expr? value)

Argumentos

Argument Name

Argument Description

v

expressão

dim

expression dimension

type

table entry type

value

expression value

Valores de retorno

The return value is the expression that the ArraySize represents.

Descrição

ArraySize represents size of array.

Tipos

Only accepts integers.

Exemplos

integer :: a(3)
integer(8) :: size_a8
size_a8 = size(a, kind=8)

ASR:

(TranslationUnit
    (SymbolTable
        1
        {
            a:
                (Variable
                    1
                    a
                    Local
                    ()
                    ()
                    Default
                    (Integer 4 [((IntegerConstant 1 (Integer 4 []))
                    (IntegerConstant 3 (Integer 4 [])))])
                    Source
                    Public
                    Required
                    .false.
                ),
            size_a8:
                (Variable
                    1
                    size_a8
                    Local
                    ()
                    ()
                    Default
                    (Integer 8 [])
                    Source
                    Public
                    Required
                    .false.
                )

        })
    [(=
        (Var 1 size_a8)
        (ArraySize
            (Var 1 a)
            ()
            (Integer 8 [])
            (IntegerConstant 3 (Integer 8 []))
        )
        ()
    )]
)

Veja Também