Dear Thomas, I know the meaning of "error 2042 "&" -2146826246" is "NA".
What confused me is if i execute the command " x<-c(TRUE,FALSE,NA)", the first returned value is "FALSE" but not "TRUE" in both VB6.0 and C#3.5 this is the test code Set r = CreateObject("StatConnectorSrv.StatConnector") r.init "R" r.Evaluate("x<-c(TRUE,FALSE,NA)") if i track r.Evaluate("x<-c(TRUE,FALSE,NA)") in "Watches " windows, i will see the error returned values(in the hyperlink below) http://www.ioz.ac.cn/temp/error.jpg -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Baier Sent: Thursday, October 09, 2008 1:02 AM To: R (D)COM and RExcel server related issues Subject: Re: [Rcom-l] A question or a bug about x<-c(TRUE,FALSE,NA) Qiao Hui-jie schrieb: > in R, I type in this command x<-c(TRUE,FALSE,NA) then it returns the > correct response "TRUE,FALSE,NA" > > When i use it in both VB6.0 and C#, the function Evaluate() will > return an array of object, and the values in it is > "false","false","error 2042(in vb) / -2146826246(in c#) ", the first value is wrong. > > But if i Evaluate("x<c(TRUE,FALSE)") without "NA", the return values > is right? > > how can i deal with this condition? error 2042 is NA. Speaking in COM terms, the VARIANT type is VT_ERROR, the value is 2042. This is what some apps, e.g., Excel, will send for NA values. Thomas _______________________________________________ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at _______________________________________________ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at