I'm kind of rusty on Delphi. Used in the early nineties but am C# programmer now. I'm current working on a Delphi project.
I have to transform a lot of .pas file for localization of strings. I've written a C# program to do the transformation. The idea is to parse all .pas files an everywhere there a Dutch text string replace it with call to our language routines. I now find the problem that there a lot of constants in many of the units that have to transform to variables. The current implementation does it like this but this doesn't compile:
before:
unit _TypesConstantsCommon;
interface
uses System.SysUtils;
const
cDEELPRJN_OMSCHRIJVING_OPSTELLEN_OFFERTE = 'Opstellen offerte';
after:
unit _TypesConstantsCommon;
interface
uses System.SysUtils;
var
cDEELPRJN_OMSCHRIJVING_OPSTELLEN_OFFERTE:string = TLanguagesManager.GetSingleton.GetText(c_TypesConstantsCommon1);
Is this at all possible? If not what should I generate to get this done?
question from:
https://stackoverflow.com/questions/65851262/can-you-initialize-variables-in-the-var-declation-section-using-a-function-in-de 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…