delphiidedelphi-10.2-tokyotoolsapi

How to retrieve the value of Environment Variables using OpenTools API?


I added some new environment variables in the IDE setup:

Tools > Options > Environment Options > Environment Variables > User Overrides

Those are just some paths like: $(MYPROJ_ROOT)\Source.

How can I retrieve one of them using the OpenTools API?

The IDE that I'm using is Delphi 10.2 Tokyo.


Solution

  • The IOTAServices interface offers a function ExpandRootMacro just for this purpose.