Sisukord
Register 🔎︎

# BASICu IDE

Määrab BASICu IDE (integreeritud arenduskeskkonna) sätted, et hõlbustada BASICus makrode redigeerimist.

This feature is experimental and may produce errors or behave unexpectedly. To enable it anyway, choose LibreOffice - Preferences Tools - Options - LibreOffice - Advanced and select Enable experimental features checkbox.

Selle käsu kasutamiseks...

Vali LibreOffice - Eelistused Tööriistad - Sätted - LibreOffice - BASICu IDE

## Koodi lõpetamine

See funktsioon aitab BASICus programmeerimisel koodi lõpetada, säästab liigsetest klahvivajutustest ja aitab vähendada koodivigade arvu.

### Koodi lõpetamise lubamine

Display methods of a Basic object. Code completion will display the methods of a Basic object, provided the object is a UNO extended type. Its does not work on a generic Object or Variant Basic types.

When a variable is a UNO interface or structure, a list box appears when pressing the dot after a variable's name (like aVar. [list box appears] ). Its methods and variables are listed in the list box, displayed just below. You can navigate between the suggested methods and variables with the arrow keys. To insert the selected entry, press the Enter key or double click on it with the mouse. To cancel the list box, press the Esc key.

When typing the method's name, and pressing the Tab key once, it will complete the selected entry, pressing the Tab key again will cycle through the matches with the longest prefix. For example, when aVar.aMeth is typed, it will cycle through aMeth1, aMethod2, aMethod3 entries, and other entries are not hidden.

Näide:

        Dim aPicker As com.sun.star.ui.dialogs.XFilePicker

is a valid variable definition, its methods can be accessed via the dot (".") operator:

        aPicker.getDisplayDirectory()

## Koodisoovitused

These are coding helpers for the Basic programmer.

### Automaatkorrektuur

Correct cases of Basic variables and keywords while typing. LibreOffice Basic IDE will modify the typing of Basic statements and Basic variables of your code to improve coding style and readability. Modifications of the code are based on the program's variables declarations and on the LibreOffice Basic commands parsed.

Näide:

        Dim intVar as Integer

Kui seejärel sisestada Intvar, parandatakse see automaatselt kujule intVar, vastavalt esmasele deklareerimisele.

Ka BASICu võtmesõnu parandatakse automaatselt (võtmesõnade loend saadakse parserilt).

Näited:

Integer, String, ReDim, ElseIf, etc...

### Jutumärkide automaatsulgemine

Automatically close open quotes. LibreOffice Basic IDE will add a closing quote each time you type an opening quote. Handy for inserting strings in the Basic code.

### Sulgude automaatsulgemine

Automatically close open parenthesis. LibreOffice Basic IDE will add a closing parenthesis “)” each time you type an opening parenthesis “(“.

### Protseduuride automaatsulgemine

Automatically insert closing statements for procedures. LibreOffice Basic IDE will add a statement End Sub or End Function after you type a Sub or Function statement and press Enter.

## Keele funktsioonid

### Laiendatud tüüpide kasutamine

Allow UNO object types as valid Basic types. This feature extend the Basic programming language standard types with the LibreOffice UNO types. This allows the programmer to define variables with the right UNO type and is necessary for the code completion feature.

Näide:

        Sub Some_Calc_UNO_Types
        REM A spreadsheet object
            Dim oSheet As com.sun.star.sheet.XSpreadsheet
            oSheet = ThisComponent.getSheets().getByIndex(0)
        REM A cell object
            Dim oCell As com.sun.star.table.XCell
            oCell = oSheet.getCellByPosition(0,0)
        End Sub

The use of UNO Extended Types in Basic programs can restrain interoperability of the program when executed in other office suites.

Sarnased teemad

BASICu IDE