有没有类似“移动对应忽略首字母”之类的东西?
我正在寻找一种类似于 MOVE-CORRESPONDING IGNORING INITIALS 的语言构造或功能模块。简而言之,我想要的功能与 MOVE-CORRESPONDING source TO dest 完全相同,但忽略 source
中初始的所有字段。
有这样的事吗?
I am looking for a language construct or a function module which would be MOVE-CORRESPONDING IGNORING INITIALS
like. Simply put I want something that works exactly like MOVE-CORRESPONDING source TO dest
but ignoring all the fields which are initial in the source
.
Is there someting like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经准备了我自己的一段代码,我想分享一下。它并不完美,不适用于复杂的结构。然而,除了在平面结构上工作之外,我现在不需要任何其他东西。
...和一个小宏,以便更像一种语言结构来使用它。
I have prepared my own piece of code that I want to share. It is not perfect, it will not work with complex structures. However I do not need anything more right now than to work on flat structures.
...and a small macro in order to use it more less like a language construct.
不存在任意结构的语言构造。对于字符字段,您可以使用 OVERLAY ...WITH,但如果您尝试对结构执行此操作,则会导致非常混乱的代码以及可变长度内容的许多不可预见的麻烦。最好的选择是使用 RTTI (运行时类型识别) 来执行此操作,但在检查初始值时要小心。
There is no language construct for arbitrary structures. For character fields, you can use OVERLAY ... WITH, but if you try to do this with structures, it leads to really messy code and lots of unforseen trouble with variable-length content. The best bet would be to use RTTI (Runtime Type Identification) to do this, but be careful when checking for initial values.