Embedding Ruby in Kylix/Delphi
如不是 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.