Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I get info about SUB inside SUB?
#10
(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.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: Can I get info about SUB inside SUB? - by bplus - 05-10-2023, 04:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  More info about Random Access files PhilOfPerth 28 962 02-25-2026, 01:50 PM
Last Post: ahenry3068
  Exiting sub while inside a loop PhilOfPerth 5 525 12-05-2025, 09:40 AM
Last Post: PhilOfPerth
  Making the content list of files inside a Zip ? euklides 13 2,407 02-08-2024, 03:52 PM
Last Post: euklides
  0.71 Info on compilation error krovit 7 1,762 06-11-2022, 04:28 PM
Last Post: DSMan195276

Forum Jump:


Users browsing this thread: 1 Guest(s)