Module
Contents
Index 🔎︎

# ReDim Statement

Declares a variable or an array.

## Sintaksa:

    [ReDim]Dim VarName [(start To end)] [As VarType][, VarName2 [(start To end)] [As VarType][,...]]

Dobrovoljno, moze se dodati Preservekljucne rijeci kao parametri da kontekst nizova bude redimenzijonalna

## Parametri:

VarName: Any variable or array name.

Start, End: Numerical values or constants that define the number of elements (NumberElements=(end-start)+1) and the index range.

Pocetak i kraj mogu biti brojcano izrazeni ako ReDim je koristen kao procedurni dio.

VarType: Klucne rijeci, koje deklarisu bazni tip varijable.

Keyword: Default variable type

Bool: Bulovske varijable (Tacno, Netacno)

Date: Date variable

Double: Dupli plovece tacke variable (1.79769313486232x10E+308 - 4.94065645841247x10E-324)

Integer: Integer variable (-32768 - 32767)

Long: Dugi brojac variabli (-2,147,483,648 - 2,147,483,647)

Object: Objekat variable (moze samo biti odredzen od strane aparata!)

[Single]: Slobodne plovece variable (3.402823x10E+38 - 1.401298x10E-45). Ako kljucna rijec nije odredzena, variabla je odredzena kao slobodna, ako ne red od DefBool do DefVar je koristen.

String:Brojcane varijable sadrze maksimalnoof 64,000 ASCII karaktera.

Variant: Varianta varijable tipa(moze sadrzavati sve tipove i jeste postavljena definicijom).

In LibreOffice Basic, you do not need to declare variables explicitly. However, you need to declare an array before you can use them. You can declare a variable with the Dim statement, using commas to separate multiple declarations. To declare a variable type, enter a type-declaration character following the name or use a corresponding key word.

LibreOffice Basic supports single or multi-dimensional arrays that are defined by a specified variable type. Arrays are suitable if the program contains lists or tables that you want to edit. The advantage of arrays is that it is possible to address individual elements according to indexes, which can be formulated as numeric expressions or variables.

Nalaze se sva tipa da postave oblast indeksa za niz deklarisan sa Dim redom

DIM text(20) Kao string REM 21 brojcani elementi od 0 do 20

DIM tekst (5 do 25) kao streing REM 21 elementi izbrojani od 5 do 25

DIM text$(-15 do 5)kao string REM 21 element (0 ukljucuje),

rem izbrojan od -15 do 5

Polja varijabli, bez obzira na tip, moze biti napravljeno dinamicno ako iako su dimenzijonirani od strane ReDim na nivou subrutirana ili funkcijonalna. Normalno, mozete samo postaviti oblast nekog niza i ne mozete je mjenjati. Bez procedure, mozete deklarisati niz korsitec ReDim red sa brojcanim izrazom da definise oblast velicine polja

## Primjer:

    Sub ExampleRedim
    Dim iVar() As Integer, iCount As Integer
    ReDim iVar(5) As Integer
    For iCount = 1 To 5
        iVar(iCount) = iCount
    Next iCount
    ReDim iVar(10) As Integer
    For iCount = 1 To 10
        iVar(iCount) = iCount
    Next iCount
    End Sub