The problem with the code below was that you changed all the objects in the table to 
be the same as the first. You need to loop thru the records in the table and then 
update each individually.

Like this:

Include "Mapbasic.def"
Dim VarObj as Object, Change as Pen, nRowID As Integer

Open Table "C:\1250\Buildings.TAB" Interactive
Map From Buildings

change = MakePen(1,2,0)
select * from Buildings into selection

Fetch First From SELECTION
Do Until EOT(SELECTION)
        VarObj = SELECTION.obj
        nRowID = SELECTION.ROWID
        Alter Object VarObj
                Info OBJ_INFO_PEN, change
        update buildings set obj = VarObj
                Where ROWID = nRowID
        Fetch Next From SELECTION
Loop

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


-----Original Message-----
From: Daniel York [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 10, 2004 3:30 PM
To: [EMAIL PROTECTED]
Subject: MI-L change line styles



Dear All

I have written the following code in an attempts to update all lines within a table. 
This has not worked Can anybody help me.


Include "Mapbasic.def"
Dim VarObj as Object, Change as Pen


Open Table "C:\1250\Buildings.TAB" Interactive
Map From Buildings

change = MakePen(1,2,0)
select * from Buildings into selection

VarObj = selection.obj
Alter Object VarObj
Info OBJ_INFO_PEN, change
update buildings set obj = VarObj


Thanks

************************************************************************************************
Please do not print this e-mail if you can help it - and help protect the environment.
************************************************************************************************
This Message may contain confidential information and is protected by copyright. If 
you receive it in error please notify us and delete it without making use of or 
copying it. The addressee and other employees within the Council may read and copy any 
e-mail reply to this message and other e-mails you send to us. Whilst we use virus 
checking procedures we accept no liability for viruses and recipients 
must rely on their own virus checking procedures.
************************************************************************************************
The Council's web site address is www.southtyneside.info 

South Tyneside Business Week
7-13th July 2004, Bents Park, South Shields www.southtyneside.info/businessweek

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, 
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 12127



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 12146

Reply via email to