Delphi 7 有没有办法实现代码折叠?

发布于 2024-07-07 05:34:49 字数 162 浏览 7 评论 0原文

我知道这是一个不太可能的事情 - 但是有什么办法可以将代码折叠到 Delphi 7 中吗?

我正在研究一些..“次优”..代码。 有时我真的需要折叠一些部分来完成一个愚蠢而漫长的过程。 目前我正在将代码粘贴到 Notepad++ 中,它可以工作,但如果将其放在 IDE 中就更好了。

I know this is a long shot - but is there any way at all to get code folding into Delphi 7?

I'm working on some .. "suboptimal" .. code. Sometimes I really need to fold bits away to grok a stupid-long procedure. Currently I'm pasting code into Notepad++, which works, but it would be nice to have it in the IDE.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

念三年u 2024-07-14 05:34:49

在此 FAQ(针对 GExperts)上查找“方法折叠”,您会发现即使这样团队为 Delphi 添加了许多增强功能,但他们认为 Delphi 7 不可能出现这种情况。我已经寻找了解决方案,但还没有看到它们。

Look for "method folding" on this FAQ (for GExperts) and you'll see that even this team, which has added many enhancements to Delphi, doesn't think this is in the cards for Delphi 7. I've looked for solutions and haven't seen them.

友谊不毕业 2024-07-14 05:34:49

我不知道有什么方法可以在 Delphi 7 中进行代码折叠,但是有一些 Delphi 插件可以使查看代码变得更好

Castalia for Delphi
http://www.twodesks.com/castalia/

和免费的 cnPack
http://www.cnpack.org/index.php?lang=en

I don't know any way to do the code folding in Delphi 7, but there are some Delphi plug-ins that will make viewing code much better

Castalia for Delphi
http://www.twodesks.com/castalia/

and the free one cnPack
http://www.cnpack.org/index.php?lang=en

夜深人未静 2024-07-14 05:34:49

不完全相同,但您可以将“折叠”代码放入单独的文件中,然后使用 {$I filename.inc} 编译器指令包含该文件。 自从我使用 Delphi 7 以来已经有一段时间了,但我相信如果您将光标放在文件名上并按住 Control 键并单击文件名,文件名将在 ide 中打开。

Not exactly the same, but you could put your "folded" code into a separate file, then include the file using the {$I filename.inc} compiler directive. Its been awhile since I used Delphi 7 but I believe if you put the cursor on the filename and hold control and click the filename will open in the ide.

他是夢罘是命 2024-07-14 05:34:49

{$i filename.inc} 是正确的方法。 我有类似的次优代码,并且在主窗体外部放置了 8.000 行“死”数据库更新代码(将其减少到 12.000 行次优代码)。 包含文件有助于隔离功能,因此简化了将其放入类的最终任务。

{$i filename.inc} is the right way. I had similar suboptimal code and had 8.000 lines of "dead" database-udating code placed outside the main form (bringing it down to 12.000 lines of suboptimal code). An include file helps isolating functionality and therefore eases the final task of making it into a class.

非要怀念 2024-07-14 05:34:49

正如已经提到的,您可以使用包含文件。 但就我个人而言,我不喜欢将部分代码删除到另一个文件的想法,尤其是过程的一部分(如果我以正确的方式解释你的问题)。 我更喜欢使用书签来快速浏览过程,跳过不相关的部分,并使用 Ctrl+Shift+Up/Down 组合键在方法的实现和定义之间切换。

As already mentioned, you could use the include file. But personally I don't like the idea of removing parts of code to another file, especially parts of a procedure (if I interpret your question the right way). I would prefer using bookmarks to rapidly navigate through the procedure, skipping the irrelevant parts, and the Ctrl+Shift+Up/Down key combinations to alternate between implementation and definition of methods.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文