On 4/14/2010 12:31, Bartsch, Martin wrote:
> Hello,
>
> I´m going to use the J OLE Server for Excel in one project.
> This seems to me a great solution where everyone wants to use excel and I
> want to develop the software in my language of choice J.
>
> So far I have one issue with getting strings out of J into Excel-VBA.
> The following example gives two different values for x ("?????") and a
> ("hello world").
>
> 1 Sub jserver_issue()
> 2 ec = js.do("a=.'hello world'")
> 3 ec = js.get("a", x)
> 4 MsgBox x
> 5 ec = js.do("wdinfo a")
> 6 End Sub
>
> Is this a normal / expected behaviour ?
> Has anyone found the same issue or am I doing something wrong ?
>
> Thanks for help,
>
> Martin
This works for me:
Sub Main()
Dim jObject As New JDLLServerLib.JDLLServer
Dim rObject As Variant
Status = jObject.DoR("a=.'hello world'", rObject)
Status = jObject.DoR("a", rObject)
MsgBox ("J Local Assignment:" & Str(Status) & " and result" & vbCrLf &
rObject)
Status = jObject.DoR("a=:'hello world'", rObject)
Status = jObject.DoR("a", rObject)
MsgBox ("J Global Assignment:" & Str(Status) & " and result" & vbCrLf
&
rObject)
Status = jObject.DoR(">(4 8 i.3!:0 <.2^33){'Got J64';'Got J32'",
rObject)
MsgBox ("J DoR ended with status" & Str(Status) & " and result" &
vbCrLf & rObject)
jObject.Quit
End Sub
--
David Mitchell
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm