Thanks Peter,
D'oh. I had looked up each command that I used in the
MapBasic Reference, yet I missed the Update statement. You prompted me to
take another look and it states:
"By default, the Update statement will affect all rows in the specified table. However, if the statement includes a Where Rowidclause, only one particular row will be updated."
I should learn to read more
carefully.
_________________________
Don
From: Peter Horsbøll Møller [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 14, 2006 3:55 PM
To: Hughes, Colleen / Don Mitchell; [email protected]
Subject: RE: [MI-L] Altering Point Object SymbolDon,The problem is that you update statement updates the entire table instead of just the record you have fetched.This should fix the problem:miApp.do "Dim nRowID As Integer"
...Do while miApp.Eval("EOT(selection)") = "F"miApp.do "bfpobj = selection.obj nRowidID = selection.ROWID Alter Object bfpobj Info 2, bfpsymbol Update selection Set obj = bfpobj Where ROWID = nRowID Fetch Next From selection"
LoopPeter Horsbøll Møller
GIS Developer, MTM
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"For enden af regnbuen..." - hvordan kommer man dertil og er det overhovedet muligt?
Læs mere om årets MapInfo konference på www.cowi.dk/mapinfokonference
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hughes, Colleen / Don Mitchell
Sent: Thursday, September 14, 2006 9:36 PM
To: [email protected]
Subject: [MI-L] Altering Point Object SymbolHi All,Me again. I've found a way to do the looping in MapInfo without MapBasic, calling the MapBasic commands from VB and doing the rest in VB.However, I have a new problem. When I execute the code to change the symbol of a selection set, It changes the symbol style fine. But it also changes the location of the points to the same location as the first object in the table. It's as if the Alter Object statement has a Geography clause along with the Info clause I'm using. I've included the code below. I have the MapBasic Reference Guide which has a description of the MapBasic.def which is where I get the value for the OBJECT_INFO_SYMBOL code.Any ideas what I'm missing.----------------Code-------------'this creates the object for the MapInfo Application already runningDim miAppSet miApp = GetObject( , "MapInfo.Application")Dim miStrmiStr = "select * from OverDue where Due_Tested = ""NO BFP"" "
'miApp.do passes the commands and strings to MapInfomiApp.do miStrmiApp.do "Dim bfpobj As Object"
miApp.do "Dim bfpsymbol As Symbol"'this makes the symbol to pass to the Alter Object statement.miApp.do "bfpsymbol = MakeSymbol(34,0,6)"
miApp.do "Fetch First From selection"'MapInfo returns F if it hasn't reached the end of the selection table, so this Do While loop continues until there are no more records in the selection.
Do while miApp.Eval("EOT(selection)") = "F"miApp.do "bfpobj = selection.obj Alter Object bfpobj Info 2, bfpsymbol Update selection Set obj = bfpobj Fetch Next From selection"
LoopAny help is appreciated._________________________Don MitchellGIS Technician (IMS)City of St.Thomas
_______________________________________________ MapInfo-L mailing list [email protected] http://www.directionsmag.com/mailman/listinfo/mapinfo-l
