Hi all,
I know this is probably extremely simple but so far I'm not getting anywhere
with it...
I'm trying to loop through a table and pick up what the foreground colour of
each polygon is then I want to update that row with a text value based on
the colour of the polygon. i.e. All red polygons in the table will have
"R.Burbank", all blue ones will be "Unplanted" etc. Seems simple...
I have the table open and prepared and this is the code I'm trying to run to
get the forecolour into cur_colour variable so I can compare it with the set
colours in each polygon.
Any suggestions gratefully received!!
Dim b_var As Brush
Dim cur_colour,i As Integer
i=1
Fetch First From mapname
Do While Not EOT(mapname)
b_var = ObjectInfo(mapname.obj,OBJ_INFO_BRUSH)
cur_colour = StyleAttr(b_var, BRUSH_FORECOLOR)
Do Case cur_colour
Case 12632256
Note "M Piper"
Update mapname
Set Variety = "M Piper"
Where Rowid = i
Case 11599871
Note "P.Dell"
Update mapname
Set Variety = "P.Dell"
Where Rowid = i
Case 16767152
Note "R.Burbank"
Update mapname
Set Variety = "R.Burbank"
Where Rowid = i
Case 10551200
Note "Shepody"
Update mapname
Set Variety = "Shepody"
Where Rowid = i
Case 16748688
Note "U. Russet"
Update mapname
Set Variety = "U. Russet"
Where Rowid = i
Case 255
Note "Unplanted"
Update mapname
Set Variety = "Unplanted"
Where Rowid = i
Case 16777104
Note "Y. Gold"
Update mapname
Set Variety = "Y. Gold"
Where Rowid = i
Case Else
Note "Unknown"
Update mapname
Set Variety = "unknown"
Where Rowid = i
End Case
i=i+1
Fetch Next From mapname
Loop
----------------------------------------------------------------------------
---------
Jim Wilson,
Hilton of Fern,
By Brechin,
Angus, Scotland. DD9 6SB
Phone +44 (0)1356 650307
Fax +44 (0)1356 650445
Mobile +44 (0)7702 741516
email [EMAIL PROTECTED]
web www.soilessentials.com
----------------------------------------------------------------------------
---------
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.0/63 - Release Date: 03/08/2005
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 17375