Re: [R] R (2.2.0), R-DCOM and Delphi

2005-11-07 Thread Jose Claudio Faria
Dear Dieter,

First, thank you for your work!
Below the error message I got when trying to compile your RDCom.dpr

[Warning] STATCONNECTORCLNTLib_TLB.pas(319): Unsafe type 'EventDispIDs: Pointer'
[Warning] STATCONNECTORCLNTLib_TLB.pas(320): Unsafe type 'LicenseKey: Pointer'
[Warning] STATCONNECTORCLNTLib_TLB.pas(324): Unsafe code '@ operator'
[Warning] STATCONNECTORCLNTLib_TLB.pas(367): Unsafe type 'EventDispIDs: Pointer'
[Warning] STATCONNECTORCLNTLib_TLB.pas(368): Unsafe type 'LicenseKey: Pointer'
[Warning] STATCONNECTORCLNTLib_TLB.pas(372): Unsafe code '@ operator'
[Warning] STATCONNECTORCLNTLib_TLB.pas(374): Unsafe code '@ operator'
[Warning] STATCONNECTORSRVLib_TLB.pas(376): Unsafe type 'LicenseKey: Pointer'
[Warning] STATCONNECTORSRVLib_TLB.pas(379): Unsafe code '@ operator'
[Warning] RCom.pas(93): Unsafe code 'String index to var param'
[Error] RCom.pas(119): Undeclared identifier: 'VarType'
[Error] RCom.pas(124): Undeclared identifier: 'VarArrayDimCount'
[Error] RCom.pas(127): Undeclared identifier: 'VarArrayHighBound'
[Error] RCom.pas(140): Undeclared identifier: 'VarType'
[Error] RCom.pas(145): Undeclared identifier: 'VarArrayDimCount'
[Error] RCom.pas(148): Undeclared identifier: 'VarArrayHighBound'
[Error] RCom.pas(161): Undeclared identifier: 'VarType'
[Error] RCom.pas(166): Undeclared identifier: 'VarArrayDimCount'
[Error] RCom.pas(169): Undeclared identifier: 'VarArrayHighBound'
[Error] RCom.pas(181): Undeclared identifier: 'VarArrayCreate'
[Error] RCom.pas(196): Undeclared identifier: 'VarArrayCreate'
[Error] RCom.pas(211): Undeclared identifier: 'VarArrayCreate'
[Error] RCom.pas(226): Undeclared identifier: 'VarArrayCreate'
[Error] RCom.pas(253): Undeclared identifier: 'VarType'
[Error] RCom.pas(258): Undeclared identifier: 'VarArrayDimCount'
[Error] RCom.pas(261): Undeclared identifier: 'VarArrayHighBound'
[Fatal Error] RDComMain.pas(14): Could not compile used unit 'RCom.pas'

I'm using Delphi 7 under WinXP pro/SP2.
Could you give me a tip?

Regards,
-- 
Jose Claudio Faria
Brasil/Bahia/UESC/DCET
Estatistica Experimental/Prof. Adjunto
mails:
  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
tel: 73-3634.2779

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R (2.2.0), R-DCOM and Delphi

2005-11-07 Thread Dieter Menne
Jose Claudio Faria joseclaudio.faria at terra.com.br writes:

 
 Dear Dieter,
 
 Below the error message I got when trying to compile your RDCom.dpr
 
...
 [Warning] RCom.pas(93): Unsafe code 'String index to var param'
 [Error] RCom.pas(119): Undeclared identifier: 'VarType'
 [Error] RCom.pas(124): Undeclared identifier: 'VarArrayDimCount'
..
 I'm using Delphi 7 under WinXP pro/SP2.

Looks like a missing file in uses. I compiled it under Delphi 5, and it looks 
like the variants are no longer included in my uses.

Try to find out via help file where VarType is declared, add it to uses. And 
please tell me about the result when you got it compiled, I will add your 
finding to the archive.

Dieter

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R (2.2.0), R-DCOM and Delphi

2005-11-07 Thread Earl F. Glynn
Dieter Menne [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 Jose Claudio Faria joseclaudio.faria at terra.com.br writes:

 Looks like a missing file in uses. I compiled it under Delphi 5, and it
looks
 like the variants are no longer included in my uses.

 Try to find out via help file where VarType is declared, add it to uses.
And
 please tell me about the result when you got it compiled, I will add your
 finding to the archive.

Here's what worked for me:

(1) Install the new (D)COM server (the old one gives the error Method '~'
of object '~' failed with R 2.2.0):

 For anybody who wants to try the R(D)COM server alone, I recommend
 http://sunsite.univie.ac.at/rcom/download/RSrv200beta.exe
 It is reasonably stable and will work with R 2.2.0.


(2) In C:\Program Files\R\(D)COM Server\samples\Simple run the simple.exe to
verify the server is working.


(3) Download and unzip:  http://www.menne-biomed.de/download/RDComDelphi.zip

Like Jose Claudio Faria described, a number of warnings and errors will be
seen in Delphi 7 in compiling the unmodified RDCom.dpr project.

To fix the compilation errors, add the Variants unit to the uses:

uses
  Windows, Messages, SysUtils,Classes, Dialogs,
STATCONNECTORSRVLib_TLB,Forms, Variants;

I don't remember why Borland made this change.

You can make the Warnings go away by selecting Project | Options | Compiler
Messages and unchecking the boxes for

- Unsafe type
- Unsafe code

These warning were introduced with Borland made changes to support .NET.
The code should be quite fine for Win32.

Note:  The Delphi source code could be modified to use {$IFDEF} directives
to take care of the differences by compiler version.  See the Compiler
Versions section of this page:
http://www.efg2.com/Lab/Library/Delphi/Miscellany/index.html.
Unfortunately, Borland has not been very helpful in promoting the use of a
common Versions.INC file or any other mechanism to take care of such
compiler version problems in a uniform way.  The file Versions.INC must be
updated with every new release by Borland.


(4) Run the RDCom.exe program. Select the Run and Plot buttons and see a
wonderful demo of Delphi and R working together.  (Now I can get busy and
use this in other Delphi applications with R as a backend.)


Thanks for the work on R-DCOM and this great example!

efg
Scientific Programmer
Stowers Institute for Medical Research

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R (2.2.0), R-DCOM and Delphi

2005-11-06 Thread Dieter Menne
In response to a few private e-mails, here a summary of using Delphi, R-DCOM
and R 2.2.0

1) As Earl Glynn noted
( http://finzi.psych.upenn.edu/R/Rhelp02a/archive/50705.html ),

there were a few paths specific to my installation in

http://www.menne-biomed.de/download/RDComDelphi.zip

leading to path errors on compilation. Hopefully, this has been corrected in
the new zip file.

2) Always check if the test samples (e.g. simple.exe) coming with R(D)COM
work before trying with Delphi. Parameters passing fails with R 2.2.0 and
old R(D)COM, but graphs still work.

For R 2.2.0, please read

http://mailman.csd.univie.ac.at/pipermail/rcom-l/2005-October/000764.html

and download the new versions.

After installing the new versions, my Delphi talks again with R.

Dieter

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html