(Okay okay, here you go so everybody can read it! =)
Just to add to the list of suggestions, here's a little snippet of code from
an MBX I wrote to shade a variably sized list of polygons with individual
colors:
Table name is "neighbors", but could be any table that was formed from a
prior selection
fetch first from neighbors 'creates a text string of all sector
'name values in order to
thematically
'shade the layer
cstring = """" + neighbors.Sector_name + ""","
for i = 1 to tableinfo(neighbors, TAB_INFO_NROWS)-2
fetch next from neighbors
cstring = cstring + """" + Neighbors.Sector_name + ""","
next
fetch next from neighbors
cstring = cstring + """" + Neighbors.Sector_name + """"
Run Command "Shade window " +win_id+ " selection with Sector_Name values " +
cstring 'shades the layer
Hopefully this sheds a little light. I posted a question to the list about
how to do this and didn't get exactly the answer I was looking for, but it
was enough to point me exactly where I wanted to go.
good luck,
Ben
> -----Original Message-----
> From: Antoine Gilbert [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, September 30, 1999 11:46 AM
> To: Susan Yu; [EMAIL PROTECTED]
> Subject: Re: MI MapBasic Shade statement
>
> use the RUN COMMAND instruction..
>
> exemple:
>
> dim tmp as String
> tmp = "Shade .. With ... bla bla bla "
> tmp = tmp + "Values "
> for i=0 to x
> tmp = tmp + """" + nameIndividualValue(i) + """" + " Brush(" +
> param1(i)
> + "," + param2(i) + "," + param3(i) + "), "
> Next
> Run Command tmp
>
> PS : """" is an insertion of the caracter -> " <- into the string...
>
> for the string stories, i'm not not sure to understand all you asked..
> ___________________________________
>
> || // Antoine Gilbert
> || // [EMAIL PROTECTED]
> || // #ICQ 9737371
> || \\
> || \\ Le Groupe KOREM Inc.
> || \\ http://www.korem.com
> ___________________________________
>
> ----- Original Message -----
> From: Susan Yu <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, September 30, 1999 10:31 AM
> Subject: MI MapBasic Shade statement
>
>
> >Hello everyone,
> >
> >I was wondering if anyone can help me with a Map Basic problem I am
> having.
> >I'm trying to automate a thematic map using the "Region, individual
> values,
> >black and white" template. This map is suppose to result from values
> >extracted from a selection performed prior.
> >
> >The selection results with a list of names - and regions should be shaded
> >according to which name it falls in. I have managed to just get the
> names
> >and the regions it falls under. Not the shading part.
> >
> >Then I have to use the "Shade" statement to create the thematic map:
> >
> >Shade 3 With some_column
> > Values
> > "xxxxxxxxx" Brush ...
> > "yyyyyyyyyy" Brush ...
> > "zzzzzzzzzz" Brush ...
> > etc....
> >
> >My problem is that the list of names can be 3 or 23! How do I code in
> Map
> >Basic to dynamically list the names and assign a different brush style
> under
> >the Shade statement?
> >
> >Another attempt: I put the names in an array variable. I tried to list
> the
> >values by putting them all in one variable 'name_list', where names(n)
> is
> >the array variable containing the names:
> >
> >counter = 2
> >name_list = Chr$(34) + names(1) + Chr$(34)
> >do while counter <= newsize
> > name_list = name_list + "," + Chr$(34) + names(counter) + Chr$(34)
> > counter = counter + 1
> >loop
> >
> >The problem with above is that 'name_list' is seen as just one long
> string
> >rather than a list of strings, despite that I have put in double
> quotation
> >marks (Chr$(34)).
> >
> >I also tried putting under 'values' a variable list with: names(1),
> >names(2), names(3), ... to a certain number
> >but if the selection results in a list of names smaller than the listed
> >number of variables, then it doesn't work. It seem to fail when there is
> no
> >value for the rest of the listed variables.
> >
> >Or is there a way to call an existing MapInfo function and pre-assign all
> >the values to automatically create the thematic map?
> >
> >The answer seem like it can be right under my nose but I can't see it.
> Any
> >help would be appreciated.
> >
> >Thanks,
> >Susan
> >
> >
> >----------------------------------------------------------------------
> >To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
> >"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
> >
>
> ----------------------------------------------------------------------
> To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
> "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]