Reading a file and converting the input to integers...

From: Mark A. Hennessy <>
Date: Tue 19 Oct 2004 12:23:20 PM GMT
Message-ID: <>
  Hi there,

    I am reading input from a file which consists of an N x N set of 
numbers.  I want to convert these number strings into integers which I 
use to represent the domains of variables I want to define for my 
problem. While I can easily convert a number string to an integer using 
number_string/2 I'm finding a problem with trying to convert the list of 
number strings I've created from the input file into a list of integers. 
I have tried to use a double foreach as follows

/Domains/ is defined as a list of number strings read in from a file: 

 foreach(D,NewDomainList) do

I thought this would allow me to build up a new list, /NewDomainList/ of 
integers that I could then use to define the domains of my variables. It 
does not work so I'm hoping someone who knows Eclipse better than I can 
help. I would prefer to continue to read the in file in the above format 
since this is the format the problem generator I'm using outputs.

Thanks in advance,
Received on Tue Oct 19 13:28:57 2004

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:31 PM GMT GMT