Hello all,
Because of a workshop, I was offline for two days.
So, I have to apologise for giving this response a little bit late.
@David : Your solution is most helpful. It works very well. - Thank you very
much.
@Chistoph : replacing line 3 with js.getb("a",x) gives a "type mismatch"-error
on my machine ("Typen unverträglich")
@Richard : I cannot find the article "Using J in Excel". A search on the
wiki-page gives me no results.
The documentation I am working on is "J OLE Server for Excel", "J
OLE Automation Server" and the textfiles
from the examples/ole/excel-directory.
@Bill : replacing a=. with a=: makes no difference on my machine.
I was not aware of the Jserver-Methods DoR and GetB. They are not documented in
the J OLE Automation Server-documentation.
Is there any complete documentation on the J server methods ?
Once again, thanks to all of you.
Cheers,
Martin
P.S. : I cannot find a respond-button on the forum-pages. So I just set the
digestmode to off and hope to follow the treestructure of the thread next time.
But have the feeling that this will once again start a new thread. Sorry
for that.
>> 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
Cheers
Martin
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm