OpenOffice.org OpenOffice - 3.3 Základní průvodce Strana 305

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 434
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 304
Figure 314: Basic Integrated Development Environment (IDE)
7) Modify the code so that it is the same as that shown in Listing 2.The important
addition is the creation of the NumberFive function, which returns the number
five. The Option Explicit statement forces all variables to be declared before
they are used. If Option Explicit is omitted, variables are automatically defined
at first use as type Variant.
8) Save the modified Module1.
Listing 2. Function that returns five.
REM ***** BASIC *****
Option Explicit
Sub Main
End Sub
Function NumberFive()
NumberFive = 5
End Function
Using a macro as a function
Using the newly created Calc document CalcTestMacros.ods, enter the formula
=NumberFive() (see Figure 315). Calc finds the macro and calls it.
Chapter 12 Calc Macros 305
Zobrazit stránku 304
1 2 ... 300 301 302 303 304 305 306 307 308 309 310 ... 433 434

Komentáře k této Příručce

Žádné komentáře