Thanks to the quick response, especially to Doug Pease for the following code:

'**This will place the new layer at the bottom of the list
Include "C:\Program Files\MapInfo\MapBasic\SAMPLES\MAPBASIC\INC\MapBasic.Def"
Declare Sub Main
 Dim sOrder, cmdstr as string
 Dim i, iLoop, newlayrpos as smallint
 Dim FW As String
Sub Main
  FW = FrontWindow()
  If WindowInfo(FW,WIN_INFO_TYPE) <> WIN_MAPPER Then
          Note "Make a mapper window the front window first, please."
    Exit Sub
  End if
   Set map redraw off
   iLoop = mapperinfo(FW,MAPPER_INFO_LAYERS)  '** COUNT NUMBER OF OPEN LAYERS
   newlayrpos = iLoop + 2
   Open Table "MY_TABLE"
   Add Map Layer MY_TABLE
'** Now move MY_TABLE layer to the bottom of the layer heap 
        For i = 1 to newlayrpos - 2
          sOrder = sOrder & str$(i + 1) & ","
        next
        sOrder = sOrder & "1"
          cmdstr = "Set Map Window " & Str$(FW) & " Order " & sOrder
          Run command cmdstr
        set map redraw on
End Sub


Justin White
GIS Analyst
Ipswich City Council
(07) 38106704



**********************************************************************
 This e-mail contains information that is intended for use only by the
 addressee.  If you have received this e-mail in error, you are advised
 that copying, distributing, disclosing or otherwise acting in reliance
 on this e-mail is expressly prohibited.  Please advise the original 
 sender by REPLY email that you have received this email in error.

 Thank you

**********************************************************************
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to