0

last couple of days i am doing work on thematic maps using mapbasic. I am getting error while set the legend code. it giving me unrecognized command or code kind of error ...

my code is

Create Designer Legend From Window nMID 
Portrait Default Frame Title "# Legend" Font ("Arial",0,10,0)
Default Frame Style "%" Font ("Arial",0,8,0)
Frame From Layer 2 Using column object label default Frame From Layer 3 Using column object label default Frame From Layer 1

it giving error for Create Designer legend..... does anybody knows this.....???

BTW...happy new year to all

1

Are the MapBasic and MapInfo versions compatible? if you have copied the code from a newer version of MapInfo Pro and used it in your MapBasic script, there might be some commands which the older version of MapBasic does not support.

Can you try this instead:

Create Cartographic Legend 
[ From Window map_window_id ]
[ Behind ]
[ Position ( x, y ) [ Units paper_units ] ] 
[ Width win_width [ Units paper_units ] ] 
[ Height win_height [ Units paper_units ] ] 
[ Window Title { legend_window_title } 
[ ScrollBars { On | Off } ]
[ Portrait | Landscape | Custom ]
[ Style Size { Small | Large }
[ Default Frame Title { def_frame_title } [ Font... ] } ]
[ Default Frame Subtitle { def_frame_subtitle } [ Font... ] } ]
[ Default Frame Style { def_frame_style } [ Font... ] } ]
[ Default Frame Border Pen [ [ pen_expr ]
Frame From Layer { map_layer_id | map_layer_name 
    [ Using
        [ Column { column | Object } [ FromMapCatalog { On | Off }]]
        [ Label { expression | Default } ]
    [ Position ( x, y ) [ Units paper_units ] ] 
    [ Title { frame_title [ Font... ] } 
    [ SubTitle { frame_subtitle [ Font... ] } ]
    [ Border Pen pen_expr ]
    [ Style [ Font...] [ Norefresh ] [ Text { style_name } 
        { Line Pen... | Region Pen... Brush...| Symbol Symbol... } |
            Collection [ Symbol ... ] 
    [ Line Pen... ] [ Region Pen... Brush ...] } ]
[ , ... ]
  • Thnks Morgan again.... – suyogpatwardhan Jan 6 '14 at 4:54
  • 1
    No worries, good to see some MapBasic questions on here.. – Morgan Ellingham Jan 6 '14 at 22:57
1

thnks..it works...another question is i dont wanted borders for legend window as well as map window. IN mapinfo Region Style do this operation. But when u unchecked all borders and set as none Mapbasic window doesn't show any kind of code over there. so what could be the solution for it? also same thing with page setup. i wanted to set up with A4 size and Landscape Mode.

0

If i insert that code into my mapbasic window it giving me unrecognized or syntax error.firstly i did all steps manually.while doing all steps i opened Mapbasic window in Mapinfo.then i got the code for all steps like . 1. open table 2. Open Table and built query to filter given task parameters 3. Set front window 4. Create thematic maps using Join 5. Create Legend 6.Create Layout from it.after completing this all steps i got Mapbasic code which i insert it into Mpabasic window by changing small small things.Now what i am not getting that is 1. Pagesetup code ( Portrait, Landscape etc) 2. How to erase border of existing map (Region Style). help me if possible.

  • What version MapBasic are you using? And what version MapInfo Pro are you using to both get the commands from the window and run your script? – Morgan Ellingham Jan 7 '14 at 22:02
  • Mapinfo 11.5 and Mapbasic 11..I think due to version i am getting issues... – suyogpatwardhan Jan 8 '14 at 3:46
  • 1
    Yeah maybe, I would get MapBasic 11.5. Its free and you can download it from here: pbinsight.com/support/product-downloads/item/…. I suspect there are commands you're copying from MapInfo 11.5 which MapBasic 11 doesn't know how to compile. these things can be very subtle and hard to troubleshoot. Also, PBS made significant changes to the legend windows in v11.5 ... so you have awkward timing! :) – Morgan Ellingham Jan 8 '14 at 4:09
  • hey thnks.....i wll try this – suyogpatwardhan Jan 8 '14 at 4:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.