Page 226 - IT 402 v2.0 class 10
P. 226

Step 9:  Select   isplayNumberMacro  and click on   dit  button to edit the library. OpenO ce automatically
                 creates a module named 'Module1' and a macro named 'Main'.























        Step 10:  We will type a code of the 'NumberFive' function, which returns  the number 5. The statement
                 'Option Explicit' forces all variables to be declared before they are used. If 'Option Explicit' is omitted,
                 variables are automatically defined at first use as type  ariant.

        REM  *****  BASIC  *****
        Option Explicit
        Sub Main

        End Sub
        Function NumberFive()
        NumberFive = 5

        End Function




























        Step 11: Click on ‘Save’ button to save the code.
        Using Macro as a Function

         alc offers many functions like S M             O      etc.  alc also allows the users to write Macros.
        These macros can be used work like functions in Calc. It is equally important to understand how macros are
        stored internally.


         224       Touchpad Information Technology-X
   221   222   223   224   225   226   227   228   229   230   231