MACRO
A 'macro' in computer science is a rule or pattern that specifies how a certain input sequence (often a sequence of characters) should be mapped to an output sequence (also often a sequence of characters) according to a defined procedure.
The term originated with macro-assemblers, where the idea is to make available to the programmer a sequence of computing instructions as a single program statement, making the programming task less tedious and less error-prone. Many different macro-instructions have been made available for various purposes, eliminating some of the repetitiveness of the programming, as well as simplifying the writing and the reading and understanding of the program, much of its complexity being hidden (more at #Text substitution macros below).
| Contents |
| Keyboard and mouse macros |
| Application macros and scripting |
| Macro virus |
| Text substitution macros |
| Procedural macros |
| Lisp macros |
Keyboard and mouse macros
'Keyboard macros' and 'mouse macros' allow short sequences of keystrokes and mouse actions to be transformed into other, usually more time-consuming, sequences of keystrokes and mouse actions. In this way, frequently-used or repetitive sequences of keystrokes and mouse movements can be automated. Separate programs for creating these macros are called macro recorders.
During the 1980s, macro programs -- originally SmartKey, then SuperKey, KeyWorks, Prokey -- were very popular, first as a means to automatically format screenplays, then for a variety of business tasks. Since the 1990s, keyboard macros are built into most popular applications, such as word processors and spreadsheets, but are more difficult to use than the older macro programs.
Keyboard macros have in more recent times come to life as a method of exploiting the economy of MMORPGs. By tirelessly performing a boring, repetitive, but low risk action, a player running a macro can earn a large amount of the game's currency. This effect is even larger when a macro-using player operates multiple accounts simultaneously, or operates the accounts for a large amount of time each day. As this money is generated without human intervention, it can dramatically upset the economy of the game by causing runaway inflation. For this reason, use of macros is a violation of the TOS or EULA of most MMORPGs, and administrators of MMORPGs fight a continual war to identify and punish macro users.
Application macros and scripting
Keyboard and mouse macros that are created using an application's built-in macro features are sometimes called 'application macros'. They are sometimes created by carrying out the sequence once and letting the application record the actions. An underlying macro programming language also called 'scripting language' which has direct access to the features of the application may also exist.
The programmers' text editor Emacs (short for "editing macros") follows this idea to a conclusion. In effect, most of the editor is made of macros. Emacs was originally devised as a set of macros in the editing language TECO; it was later ported to dialects of Lisp.
Visual Basic for Applications (VBA) is a programming language included in Microsoft Office and some other applications. However, its function has evolved from and replaced the macro languages which were originally included in some of these applications.
Macro virus
VBA has access to most Microsoft Windows system calls and executes when documents are opened. This makes it relatively easy to write computer viruses in VBA, commonly known as macro viruses. In the mid-to-late 1990s, this became one of the most common types of computer virus. Some applications with macro languages, such as OpenOffice.org, deliberately exclude certain functionality to avoid such susceptibility.
Text substitution macros
Languages such as C and assembly language have simple macro systems, implemented as preprocessors to the compiler or assembler. C preprocessor macros work by simple textual search-and-replace at the token, rather than the character, level.
A classic use of macros is in the computer typesetting system TeX and its derivatives, where most of the functionality is based on macros.
MacroML is an experimental system that seeks to reconcile static typing and macro systems. Nemerle has typed syntax macros, and one productive way to think of these syntax macros is as a multi-stage computation.
Other examples:
★ M4 is a sophisticated, stand-alone, macro processor.
★ TRAC
★ PHP
★ Macro Extension TAL, accompanying Template Attribute Language
★ SMX
★ ml/1
★ The General Purpose Macroprocessor is a contextual pattern matching macro processor, which could be described as a combination of regular expressions, EBNF and AWK
★ SAM76
Procedural macros
The PL/I language is unique in that PL/I macros are written in [a subset of] PL/I itself: the compiler executes "preprocessor statements" at compilation time, and the output of this execution forms part of the code that is compiled. The ability to use a familiar procedural language as the macro language gives power much greater than that of text substitution macros, at the expense of a larger and slower compiler.
Most assembly languages have less powerful procedural macro facilities, for example allowing a block of code to be repeated N times for loop unrolling; but these have a completely different syntax from the actual assembly language.
Lisp macros
Lisp's (lack of) syntax is especially good for macros; languages of the Lisp family, such as Common Lisp and Scheme, have powerful macro systems. Lisp macros transform the program structure itself, with the full language available to express such transformations. Common Lisp and Scheme differ in their macro systems; Scheme's is based on pattern matching, while Common Lisp macros work as functions transforming program text.
Being able to choose the order of evaluation (see lazy evaluation and non-strict functions) enables the creation of new syntactic constructs (e.g. control structures) indistinguishable from those built into the language. For instance, in a Lisp dialect that has
cond but lacks if, it is possible to define the latter in terms of the former using macros.Entire major extensions to Lisp syntax, such as the Common Lisp Object System have been defined as macros.
Macros also make it possible to define data languages which are immediately compiled into code, which means that constructs such as state machines can be implemented in a way that is both natural and efficient.[1]
This article provided by Wikipedia. To edit the contents of this article, click here for original source.
psst.. try this: add to faves
Featured Companies
| Golf Holidays International |
Macro Companies
Below is the list of travel companies in Macro we have in our travel directory
- Travel Agents (2)

العربية
中国
Français
Deutsch
Ελληνική
हिन्दी
Italiano
日本語
Português
Русский
Español



