MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: J/Link


On 17 Jan 2001 00:54:08 -0500, Edd klemens <morlan14 at yahoo.com> wrote:

>Dear Friends
>i want to send the contents of an array variable in VB
>to Mathematica by using something like the following
>single line:
>link.evaluateToOutputForm("Plus[" & ArrayVariable &
>"," & 2 & "]", 0)
>but it did not work unless i send it piece by piece
>Best Regards
>Ed. klemens

Ed,

I'm not aware of a built-in way to convert a VB array to a string (the & operator doesn't
do it), and even if there was, it wouldn't be likely to produce a string in Mathematica
InputForm. You can either stringify your array yourself:

s = "{"
For Each i In ArrayVariable
   s = s & i & ", "
Next
s = Left(s, Len(s) - 2) & "}"

or, better, pass the input as an expression rather than as a string:

link.putFunction "Plus", 2
link.put ArrayVaraible
link.put 2

If you put the expression piecemeal like this (rather than making it into a string), you
cannot use evaluateToOutputForm, and you result will come back as an array not as a string
(but this is probably what you want anyway).


--Todd


  • Prev by Date: Re: Fonts in graphics
  • Next by Date: Re: 3D-Plots: Coloring edges (simple)
  • Previous by thread: Re: J/Link
  • Next by thread: Q: Factor with Polynominals?