MathGroup Archive 2003

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

Search the Archive

Non-string output in for loop

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43733] Non-string output in for loop
  • From: theoryboy at my-deja.com (Peter Saffrey)
  • Date: Thu, 2 Oct 2003 02:51:41 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

This is installment number 3 in my struggles with mathlink.

I am writing an application that interacts with Mathematica (through
mathlink) via a series of packages written by me. What I want is the
output from a derived interpolating function so I can convert it into
a data structure I can use for my own purposes. I have managed to make
Mathematica dump the values from the interpoloating function table one
by one, but unfortunately because I use the Mathematica Print function
they are all sent back to me as strings. This is workable, but not
very elegant or efficient since I'd have to do some ugly string
processing to get at the numbers, rather than just using
MLGetInteger().

Is there any way I can get Mathematica to output the values not as
strings? Essentially I need the following piece of code:

For[i=1,i<=10,i++,Print[i]]

to give me 1-10 but as "output" (as if you'd typed 1(enter)2(enter)...
in a notebook), not as strings (print[1](enter)print[2](enter))etc.

Peter


  • Prev by Date: Re: negative pattern matching anyone?
  • Next by Date: Re: negative pattern matching anyone?
  • Previous by thread: Re: FileBrowse command
  • Next by thread: Re: Non-string output in for loop