How to change VCL code?

后端 未结 4 1301
时光说笑
时光说笑 2021-01-13 10:38

I need (to make some quick and dirty tests) to modify the code of Variants and SysUtils.

What I need to do to \"compile\" the changes?

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-13 11:24

    Unless you do not change the interface part of the unit (that is, you only modify the implementation side), you can make your own version of the RTL units (only exception is System.pas and SysInit.pas, but this is not in your scope - see our blog site for some enhancements of those units).

    What you need is to put your own version of Variants.pas and SysUtils.pas in the search path of your project. They will be taken in account instead of the default RTL.

    But be aware that you may easily break anything.

    For testing purpose, this is OK, but if you want to use those modifications, you shall better use some automated regression tests, and know explicitly what you are doing.

    Please note that you can use the "debug" version of the RTL units (from the project options), then step with the debugger within the official source code. It may help finding issues without touching the source.

    If you change the interface part of the unit, you'll have to recompile all units which call the modified unit - for SysUtils and Variants, this is almost all RTL.

提交回复
热议问题