简体   繁体   English

Delphi 2009中的“Delphi Fundamentals”

[英]“Delphi Fundamentals” in Delphi 2009

Has anybody used/converted "Delphi Fundamentals" in Delphi 2009? 有没有人在Delphi 2009中使用/转换过“Delphi Fundamentals”? - http://fundementals.sourceforge.net/ - http://fundementals.sourceforge.net/

I'm using Dictionaries (cArrays.pas,cDictionaries.pas,cStrings.pas,cTypes.pas) in my project and now i have some troubles on upgrading code. 我在我的项目中使用字典(cArrays.pas,cDictionaries.pas,cStrings.pas,cTypes.pas),现在我在升级代码时遇到了一些麻烦。

I'll be highly obliged if anybody can convert the above mentioned units in Delphi 2009. I'm quite new to Delphi, started working with 2007 and 2009 has been released, I just cannot help myself... 如果有人能在Delphi 2009中转换上述单位,我将非常感激。我对Delphi很新,从2007年开始工作,2009年已经发布,我无法自拔......

Thank you 谢谢

I use cUtils, cDateTime and cStrings in a project. 我在项目中使用cUtils,cDateTime和cStrings。

After a 30 minute session of searching and replacing like a madman I got them to compile in Delphi 2009, with just a couple of warnings left to fix. 经过30分钟的搜索和替换,像疯子一样,我让他们在Delphi 2009中编译,只有几个警告要修复。

  • Char>>>>AnsiChar 字符>>>> ANSIChar类型
  • String>>>>AnsiString 字符串>>>> AnsiString类型
  • PChar>>>>PAnsiChar PChar类型>>>> PAnsiChar
  • PString>>>>PAnsiString pstring类型>>>> PAnsiString

It passes all of its selftests, and so far things seem to work fine. 它通过了所有的自我测试,到目前为止似乎工作正常。 I've shared it here: http://www.xs4all.nl/~niff/Fundamentals_UtilsD2009.zip 我在这里分享了它: http//www.xs4all.nl/~niff/Fundamentals_UtilsD2009.zip

Update I've added a ported cDataStructs.pas to the zipfile, which contains the dictionary classes. 更新我已经将一个移植的cDataStructs.pas添加到zipfile,其中包含字典类。 This one still has a lot of compiler warnings that you might want to fix, but the self-tests pass, so you could try and see if it works for you.. 这个仍然有许多编译器警告,你可能想要修复,但自检通过,所以你可以尝试看看它是否适合你..

There is no official version of Delphi Fundamentals for D2009 (and I think there never will be any). 没有Delphi Fundamentals for D2009的官方版本(我认为永远不会有)。

I think it would be the best option to rewrite the dictionary code using the Delphi-native TDictionary<TKey,TValue> class inside Generics.Collections.pas , or using the delphilhlplib ( Collections/DeHL.Collections.Dictionary.pas ). 我认为使用Generics.Collections.pas的Delphi-native TDictionary<TKey,TValue>类或使用delphilhlplibCollections / DeHL.Collections.Dictionary.pas )重写字典代码是最好的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM