Contents

# User-Defined Functions

आप LibreOffice कॅल्क में उपयोक्ता-निर्धारित फ़ंक्शन निम्न तरीके से लागू कर सकते हैं:

- You can define your own functions using the Basic-IDE. This method requires a basic knowledge of programming.

- You can program functions as add-ins. This method requires an advanced knowledge of programming.

## Defining A Function Using LibreOffice Basic

1. Choose Tools - Macros - Edit Macros.

2. You will now see the Basic IDE.

3. In the Object Catalog window, double-click on the module where you want to store your macro.

4. Enter the function code. In this example, we define a VOL(a; b; c) function that calculates the volume of a rectangular solid with side lengths a, b and c:

        Function VOL(a, b, c)
            VOL = a*b*c
        End Function

- बेसिक-आईडीई विंडो चुनें.

  Your function is automatically saved in the selected module and is now available. If you apply the function in a Calc document that is to be used on another computer, you can copy the function to the Calc document as described in the next section.

## फ़ंक्शन को किसी दस्तावेज़ में नक़ल करना

In stage 2 of "Defining A Function Using LibreOffice Basic", in the Macro dialog you clicked on Edit . As the default, in the Macro from field the My Macros - Standard - Module1 module is selected. The Standard library resides locally in your user directory.

यदि आप उपयोक्ता पारिभाषित फंक्शन को किसी कॅल्क दस्तावेज़ में नक़ल करना चाहते हैं:

1. Choose Tools - Macros - Organize Macros - Basic.

2. In the Macro from field select My Macros - Standard - Module1 and click Edit.

3. In the Basic-IDE, select the source of your user-defined function and copy it to the clipboard.

4. बेसिक आईडीई बन्द करें

5. Choose Tools - Macros - Organize Macros - Basic .

6. In the Macro from field select (Name of the Calc document) - Standard - Module1. Click Edit.

7. बेसिक आईडीई दस्तावेज़ में क्लिपबोर्ड सामग्री को चिपकाएँ

## LibreOffice कॅल्क में उपयोक्ता पारिभाषित फ़ंक्शन लागू करना

Once you have defined the function VOL(a; b; c) in the Basic-IDE, you can apply it the same way as the built-in functions of LibreOffice Calc.

1. Open a Calc document and enter numbers for the function parameters a, b and c in cells A1, B1, and C1.

2. संकेतक को किसी अन्य कक्ष में सेट करें व निम्न प्रविष्ट करें:

   =VOL(A1;B1;C1)

3. फ़ंक्शन का मूल्यांकन किया गया तथा परिणाम आप चयनित कक्ष में देख सकते हैं.

Related Topics

Calculating in Spreadsheets

Entering Formulas

Calling Python Scripts from Basic