Multi-Edit CMac has the ability to call external user-written routines that are in a Dynamic Link Library (DLL). You can write your code using any language, such as C++. (I don't explain how to create a dll here.)
Add an import statement to your CMac code, then you can call your external user-written routine.
Attached here is a simple example. The attached .zip file contains:
testmydll.s — CMac macro which calls routine set_all in file testdll.dlltestdll.dll — Compiled Dynamic Link Library containing routine set_alltestdll.cpp — Source code for testdll.dllstdafx.h — Another source file that was automatically generated by my Microsoft Visual C++ 6.0 which does just about nothing but I include it here for completeness.testdll.txt — (This text)testdll.dll file it might have loaded so you can replace it.testdll.dll to your Multi-Edit folder (e.g. C:\Program Files\Multi-Edit) replacing any previous version of testdll.dlltestdll.dll file when you first call it.testmydll.s in Multi-Edit.String a will be changed to “EFGH” Integer i will be set to 8 (i = i + BUFLEN + 2) [BUFLEN being the second parameter passed in the call to set_all()].
See file testdll.cpp for the code.
Note how the second parameter, BUFLEN, is passed by value, and the third parameter i is passed by reference (pointer). I did this just to demonstrate the two ways.