Embedding Ruby in Kylix/Delphi

由 非洲饿鱼 于 星期日, 11/11/2007 - 02:50 发表

如不是 delphi6安装会有些小错误!uDateTime单元uses Windows 提到引用RubyWrapper处,再加上st就可以了,否者下面错误:

[DCC Error] uDateTime.pas(127): E2010 Incompatible types: 'Pvalue' and 'pvalueA'
[DCC Error] uDateTime.pas(171): E2010 Incompatible types: 'pvalueA' and 'Pointer'
[DCC Error] uConv.pas(47): F2063 Could not compile used unit 'uDateTime.pas'

看简单例子:

   if ruby.EvalExpression('1+1') <> 2 then
    raise Exception.create('Ruby can''t calculate!');

  ruby.Expression.Text := 'print "Regexp".gsub!(/e.+/, "uby")';
  ruby.Execute;
  if ruby.Output <> 'Ruby' then
    raise Exception.create('Ruby can''t write!');
同步内容
Drupal theme by Kiwi Themes.