Thanks guys, that's exactly what I needed, and it works great. Now to make things more tricky..... the data I'm sending out is in an array, and I normally use this macro inside a for loop that's cycling through the array.
The old code:
<code>
For Sample = 0 to (N_SAMPLES - 1)
Hserout [Sample_Array[Sample] / 100, Sample_Array[Sample] // 100]
Next
</code>
For obvious reasons, I can't just write:
<code>
@ Transmit _Sample_Array[_Sample]
</code>
I will rewrite the macro to so that the argument is the Index of the Sample_Array array, so the macro will be dedicated to using that one array, like such:
<code>
@ Transmit _Sample
</code>
I'll post my macro when I've finished writing it, but just for discussions sake, is there some easy way to call a member of an array using a macro? I could use something like:
<code>
Addr = Sample_Array + (2 * Sample)
@ Transmit _Addr
</code>
To do the same thing, right? This doesn't help much since my aim is to improve readability here.
I guess I could use a macro that takes a word array and an index as arguments:
<code>
@ TX_Array _Sample_Array, _Sample
</code>
Hmmm. I seem to be answering my own questions by writing it down. Macros now seem much more useful. How would I write the above macro, but have it be able to take Word and Byte arrays? In other words, how do you use If statements in macros?
Thanks guys,
forgie
Bookmarks