05-10-2023, 04:03 PM
(05-10-2023, 03:16 PM)thesolarcode Wrote: Thanks for all the ideas.
I wanted to do something like this:
SUB ApiOne
logging "start"
...
logging "end"
END SUB
But without adding the sub names into all the code.
Thinking about some simple preprocessor that could inject the sub names automatically.
For example if we have:
logging "$SUBNAME$: start"
it would be replaced with:
logging "ApiOne: start"
Soooo, how hard is it to implement a simple preprocessor?
How about you make a template to copy/paste into a new sub and after you have a name copy/paste that into the template.
You could also write some code to read your bas files and insert stuff right after Sub/Function definition and just before End Sub/Function but then you have to direct all Exit Subs... to the end so maybe a line label in template?
Wait would a line label in a sub need a unique name from the entire program of just in the sub? Don't know... sounds like a fun little experiment... stay tuned.
b = b + ...