This is something I did when I first started using MapBasic as a development
language. It's pretty bad but it will give you an idea of how you can shade
based on values in a column.

Sub ShadeByStatus
Dim Norm_fillstyle As Brush
Dim InCons_fillstyle As Brush
Dim Video_fillstyle As Brush
Dim HSD_fillstyle As Brush
Dim Tele_fillstyle As Brush
Dim tab1 As String
Dim poly_ob As Object
Dim cntr As Integer
OnError Goto Err_han



Norm_fillstyle = MakeBrush(1, 0, -1)
InCons_fillstyle = MakeBrush(17, 65535, -1)
Video_fillstyle = MakeBrush(17, 65280, -1)
HSD_fillstyle = MakeBrush(17, 16711935, -1)
Tele_fillstyle = MakeBrush(17, 8388608, -1)
tab1 = TableInfo(0, TAB_INFO_NAME)
Select * From tab1
 Into temp1
        Fetch First From temp1
        cntr = 0
                Do While NOT EOT(temp1)
                cntr = cntr + 1
                poly_ob = temp1.obj
                        If temp1.Status = "In Construction" Then
                                Alter Object poly_ob
                                Info OBJ_INFO_BRUSH, InCons_fillstyle
                                
                        ElseIf temp1.Status = "Video" Then
                                Alter Object poly_ob
                                Info OBJ_INFO_BRUSH, Video_fillstyle
                                 
                        ElseIf temp1.Status = "HSD" Then
                                Alter Object poly_ob
                                Info OBJ_INFO_BRUSH, HSD_fillstyle
                                
                        ElseIf temp1.Status = "Telephony" Then
                                Alter Object poly_ob
                                Info OBJ_INFO_BRUSH, Tele_fillstyle
                        ElseIf temp1.Status = "" AND temp1.NODE_ID_NEW <> ""
Then
                                Alter Object poly_ob
                                Info OBJ_INFO_BRUSH, Norm_fillstyle
                        Else
                        End If
                        Update Selection
                        Set obj = poly_ob
                                Where RowId = cntr
                        Fetch Next From temp1
                Loop
                Commit Table tab1
                
Exit Sub                
Err_han:
Note "There is a record in the table with no Object Data."
End Sub

-----Original Message-----
From: Paolo Zanin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 5:15 AM
To: MapInfo-L
Subject: MI-L apply color value


ciao a tutti!

I'm doing a simple temathism in mapbasic with a command like this:
shade mytable with col1 values apply color 12,45,67

the "problem" is that the codes for value temathism can be different, it
depends from value in col1 of MYtable

i try to create in some way a variable fot using after apply color comand
but with no success..

can someone help me?

thanks a lot

ciao, Paolo


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

Reply via email to