What is macro programming: Definition and 2 Discussions

In computer programming, a macro (short for "macro instruction"; from Greek μακρο- 'long, large') is a rule or pattern that specifies how a certain input should be mapped to a replacement output. Applying a macro to an input is known as macro expansion. The input and output may be a sequence of lexical tokens or characters, or a syntax tree. Character macros are supported in software applications to make it easy to invoke common command sequences. Token and tree macros are supported in some programming languages to enable code reuse or to extend the language, sometimes for domain-specific languages.
Macros are used to make a sequence of computing instructions available to the programmer as a single program statement, making the programming task less tedious and less error-prone. Thus, they are called "macros" because a "big" block of code can be expanded from a "small" sequence of characters. Macros often allow positional or keyword parameters that dictate what the conditional assembler program generates and have been used to create entire programs or program suites according to such variables as operating system, platform or other factors. The term derives from "macro instruction", and such expansions were originally used in generating assembly language code.

View More On Wikipedia.org
  1. MillGuy

    CNC Thread Mill Macro Programming

    I've created a macro program used by a CNC milling machine to cut threads in a hole. I like to use macro programs because it allows me to use the same macro for any different size of feature just by changing a few variables. I like to first test out my macro programs using a spread sheet to plug...
  2. MillGuy

    CNC Machinist

    Hi, I'm a Machinist from Canada. I enjoy challenging myself by learning and creating custom macro programs for different manufacturing processes on my CNC machine. I'm hoping to get some insight on some areas that I'm struggling with.
Back
Top