Hi Jean
The way to do this is to use af function, take a look at the code below to
have an ideer
Peter
****************************************************************************************
include "Mapbasic.def"
Declare Sub main
Declare function NewStyle(byval o as object, byval k as smallint) as object
sub main
dim tab as string
note "run"
tab = "KURVER"
set table tab fastedit on '** this is just to sppe up the proces
update tab set obj = NewStyle(obj, KOTE) '** her I fetch the object,
change it and put it back
commit table tab
set table tab fastedit off
end sub
'** this function dos all the work
function NewStyle(byval o as object, byval k as smallint) as object
dim tmpObj as object,
color as integer,
NewPenStyle as Pen
tmpObj = o
color = RGB(201,100,75)
NewPenStyle = MakePen(13, 6, color)
If K mod 5 = 0 then ' ** here I test the attribute value
NewPenStyle = MakePen(13, 2, color)
end if
If K mod 25 = 0 then
NewPenStyle = MakePen(15, 2, color)
end if
'** her I change the style of the object variable
alter object tmpObj Info obj_info_pen, NewPenStyle
NewStyle = tmpObj
end function
|---------+--------------------------->
| | "Jean-Francois |
| | Couture" |
| | <[EMAIL PROTECTED]|
| | om> |
| | |
| | 31-10-2002 21:08|
| | |
|---------+--------------------------->
>---------------------------------------------------------------------------------------------------------------------------|
|
|
| Til: <[EMAIL PROTECTED]>
|
| cc:
|
| Vedr.: MI-L changing symbol styles in MapBasic
|
>---------------------------------------------------------------------------------------------------------------------------|
Hello all,
I need to change symbol attributes (symbol, colour and size) for several
tables permanently based on string value in a column from that table. I
could create thematic maps, but want to have that in the original table.
I need to do this for several tables.
I could use SQL queries and manually change each symbol types, but this
is would take a long time.
I know how to select in MapBasic, but not to change object
characteristics?
I use:
Select * from tablename where columnA = "5c" into sel
Update...
Thanks for helping me!!!
Jean-Francois Couture
SRK Consulting
Toronto Canada
J
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 3871