A macro is just short hand. A subrountine is "called."
Subroutines can save memory by reducing repeated code, but take more time because you have to push arguments and return addresses, and push the result and pop back.
A macro is the code literally inserted where you put it. It doesn't save any memory but is as fast as the bit of code you put there, saves typing, and is easier to read.
For example, if I define a macro
#define TOGGLE_PIN1 PORTD.1=0;PORTD.1=1;PORTD.1=0
and put it in my code like so
putsf("I'm going to toggle PIN1 now");
TOGGLE_PIN1;
putsf("PIN1 was toggled");
it would be exactly the same, to the processor, as
putsf("I'm going to toggle PIN1 now");
PORTD.1=0;PORTD.1=1;PORTD.1=0;
putsf("PIN1 was toggled");
j.
'=============>> Public Sub Main() 'Your code Call One 'your code End Sub '<<============= '=============>> Public Sub One() MsgBox "Hi from One" End Sub '<<============= > Does it matter where the other macros are stored or is it > better to have them all in one module? Unless there are a larger number of macros, they can be stored in a single module. However, for organisational reasons, it is usually better to store macros by type in different modules. Regards Rollick
explain the difference between systems and sub systems
== ==
A Sub Woofer is a type of speaker, but the main difference between normal speakers and a sub woofer is in the range of sound it produces. A sub woofer produces the lower pitches that other speakers can't clearly put out.
A directory within an existing directory is called a sub directory.
Think of 'super' as over or above and 'sub' as under or below.
core culture
Meat is a sub category of food.
It is Almost same
Size of the weapon and size of ammuntion it fires.
You can tell the difference between a 2s sub-shell and 2p sub-shell from their energy levels, because a 2p sub-shell is a higher energy level than a 2s sub-shell.
Both A function and a Sub carry out a procedure, but only A function returns a result while a Sub does not return a result.