开始在 delphi 中使用 RemObjects Pascal 脚本

发布于 2024-09-06 08:26:59 字数 999 浏览 6 评论 0原文

我刚刚开始使用 RemObjects Pascal Script。并一直在尝试遵循 remobjects 教程。

http://devcenter.remobjects.com/articles/?id={2FFC1EE9- F18D-4B11-9DE4-1BA0A79D0D04}

一切进展顺利,直到您

begin
  ShowNewMessage('Show This !');
end.

在声称不知道的地方运行的部分。 但我

procedure Tmainwindow.ceCompile(Sender: TPSScript);
begin
  Sender.AddMethod(Self, @Tmainwindow.ShowNewMessage,
                   'procedure ShowNewMessage(const Message: string);');
end;


procedure ShowNewMessage(const Message: string);


procedure Tmainwindow.ShowNewMessage(const Message: string);
begin
  //ShowMessage('ShowNewMessage invoked:'#13#10+Message);
end;

按照指示将其添加到编译事件中...它全部在 delphi 中编译,但是当我从可执行文件中运行代码时,它说它不存在。

其次,如果我添加任何插件来改进脚本的函数调用,我会得到这个..

alt text 请帮助我意识到我可能在这里做了一些愚蠢的事情,我是 rem 对象的新手。

I have just started working with RemObjects Pascal Script. and have been trying to follow the remobjects tutorial.

http://devcenter.remobjects.com/articles/?id={2FFC1EE9-F18D-4B11-9DE4-1BA0A79D0D04}

all was going fine up to the part you run

begin
  ShowNewMessage('Show This !');
end.

where it claimed it does not know of it.
but i have it here

procedure Tmainwindow.ceCompile(Sender: TPSScript);
begin
  Sender.AddMethod(Self, @Tmainwindow.ShowNewMessage,
                   'procedure ShowNewMessage(const Message: string);');
end;


procedure ShowNewMessage(const Message: string);


procedure Tmainwindow.ShowNewMessage(const Message: string);
begin
  //ShowMessage('ShowNewMessage invoked:'#13#10+Message);
end;

added on the compile event as instructed... it all compiles in delphi but when i run the code from within my executable it says it dont exist.

secondly if i add any plugins to improve the function calls of the script i get this..

alt text
please help i realise i may be doing something silly here im new to rem objects.

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

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

发布评论

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

评论(2

尝蛊 2024-09-13 08:26:59

好吧,我尝试构建该页面上所示的示例,并且它为我正确编译并运行。尝试使用页面顶部“以下代码将编译并...”下显示的示例。只需确保省略替换脚本文本的行即可。

至于插件,它无法注册您的事件类型,因为它们引用尚未注册的对象类。不幸的是,PS Plugin 系统没有任何自动解决依赖关系的方法,并且编译器的错误消息不会告诉您它找不到哪种类型。您将需要调试器来帮助您解决此问题。但许多基础知识,包括 TObject(是的,您必须显式导入它)都可以在 TPSImport_Classes 中找到。

Well, I tried building the example as shown on that page, and it compiled and ran correctly for me. Try using the example shown at the top of the page, under "The following code will compile and...". Just make sure to leave out the line that replaces the script text.

As for the plugins, it can't register your event types because they refer to object classes that haven't been registered yet. Unfortunately, the PS Plugin system doesn't have any way of automatically resolving dependencies, and the compiler's error message doesn't tell you which type it couldn't find. You'll need the debugger to help you resolve this. But a lot of the basics, including TObject (yes, you have to import it explicitly) are found in TPSImport_Classes.

相思故 2024-09-13 08:26:59

我有同样的问题。这与语法无关,只与脚本编译器包含的 Forms-Unit 模板有关。
抱歉,我没有解决该问题的方法,因为它甚至在删除 OnMenuDrawItem 和 OnMenuAdvancedDrawItem 事件(这两个事件都会产生问题)时发生。
我使用 BDS 2006,这可能是问题所在,因为与 D7 使用的源代码(这是 RO PS 实际制作的版本)相比,它使用高级 Forms 源代码。
因此,删除编译器的表单单元插件(其中还包括菜单单元)并重试,这应该“解决”您的问题。

i have the same Problem. That has nothing to do with the syntax, only with the inclusion of the Forms-Unit template for the script compiler.
Sry, i do not have a solution for that problem, because it even occurs when removing the OnMenuDrawItem and OnMenuAdvancedDrawItem events (which both make Problems).
I use BDS 2006, that might be the problem as it uses advanced Forms source code in comparison to what D7 used (which was the version RO PS was actually made for).
So, remove the Forms unit plugin for the compiler, which also includes the menus unit and try it again, that should "solve" your problem.

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