INCLAN: subroutine

From CYANA Wiki
Revision as of 16:29, 12 August 2009 by Admin (talk | contribs) (Created page with 'Usage: subroutine ''name'' ''sequence of statements'' end command ''name'' ''sequence of statements'' end command The statements …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Usage: subroutine name

        sequence of statements
      end
      command name
        sequence of statements
      end
      command

The statements "subroutine" and "command" define a new user-defined command within a macro, i.e. a macro within a macro. User-defined commands defined by a "subroutine" statement are local to the current macro (or macros called through it), whereas "command" declares a globally visible user-defined command. User-defined commands defined by "subroutine" or "command" state- ments are called by their name, possibly followed by parameters, in exactly the same way as macros. Within a macro, a user-defined command can only be called after it was defined. The statement "command" without parameters gives a list of all user-defined commands, and indicates where they are defined.