Thank you everyone for your help.  That's just what I needed.
 
Sal

Peter Horsb�ll M�ller <[EMAIL PROTECTED]> wrote:
Hi Sal,

Well you are almost there. As you mention tuou already now read the coordinates 
just also read the ID into a variable and then just extend your Insert 
statement to also take this ID:

Insert Into Roads (ID, obj) Values (CreateLine(nID, x1,y1,x2,y2))

where ID is the name of the ID column and nID is the variabel holding the ID 
read.

Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT

COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark

Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis


-----Original Message-----
From: Sallyann Smith [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 15, 2005 5:47 PM
To: [email protected]
Subject: MI-L Creating multiple line objects


I have a table that contains a list of points for the start and finish of road 
sections, with an ID for each section, and I need to create a separate map Line 
object for each section. I wrote a simple MapBasic program to scan through each 
line in the table, read the coordinates and then use
Insert Into Roads (obj) Values (CreateLine(x1,y1,x2,y2))
to create each object in turn.
This works fine, but I also need to read the ID from each line in the original 
table to attach to the object, and I haven't found out how to do it. Could some 
kind person give me some advice please? Also, am I doing this the right way by 
reading line by line, or is there a smarter way? Thanks for any help,

Sal 

Reply via email to