开发者

Getting started working with RemObjects Pascal Script in delphi

开发者 https://www.devze.com 2023-01-03 22:58 出处:网络
I have just started working with RemObjects Pascal Script. and have been trying to follow the remobjects tutorial.

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

http://devcente开发者_开发百科r.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..

Getting started working with RemObjects Pascal Script in delphi

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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号