I am having trouble numbering map objects with a unique ID.
I found the post copy+pasted below on the old MapInfo-L archive, and
have already got that far, but what I'd like is to assign "2-digit"
integer numbers for each ID.
i.e. starting from 01, 02, 03, 04, 05, 06, 07, 08 ,09, 10........
At the moment I have written a MapBasic script to assign the ID
numbers. The ID column is defined as "Integer" and the results from
1-10 appear like below.
e.g. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 .......
So when the table is sorted the objects look like.....
1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23........
Please respond if you know a method to ensure all the ID's can be
assigned the same number of characters...
Thanks
David
Previous post below.....
-----------------------------------------------------------------------------------------------------------------------------------------------
From: on 06/29/2004 10:02 AM CET
Recipients: <mapi...@lists.directionsmag.com>
Subject: RE: MI-L numbering the objects
Abhas
I presume you mean numbering the records/rows of the table, rather than
the objects (i.e. map features). So you can update the ID column with
an
incremental variable, something like:
Dim lnID, lnRowID as INTEGER
lnID = 1
Fetch First From MyTable
Do while not EOT( MyTable)
lnRowID = RowID
Update MyTable set IDColName = lnID where RowID = lnRowID
lnID = lnID + 1
Fetch Next From MyTable
Loop
HTH
Terry McDonnell
-----Original Message-----
From: abhas [mailto:ab...@iis.u-tokyo.ac.jp]
Sent: 29 June 2004 05:16
To: Mapinfo-L
Subject: MI-L numbering the objects
Dear All,
I want to add a column to an existing table, The new column should
contain
ID number, which is to be in a sequence as per the objects in the
table.
I mean the ID's can be such as......for first object in the table ID=1,
for
second object in the table ID=2... and so on.
One way is to go to the table and add the numbers manually. But the
objects
are in a large number to be added manually.
I will be thankful if I get a simply approach to it.
looking forward for a kind reply.
with regards,
abhas
----- Original Message -----
From: "Apers Mathieu" <Mathie...@nzpost.co.nz>
To: "Mapinfo-L" <mapi...@lists.directionsmag.com>
Sent: Tuesday, June 29, 2004 5:58 AM
Subject: RE: MI-L Multiple labels for a single object
Thanks to everyone who replied.
it looks like the simplest way will be for me to duplicate the table
and
disaggregate it, which i will do
Cheers all
Mathieu Apers
-----Original Message-----
From: Uffe Kousgaard [mailto:uf...@routeware.dk]
Sent: Tuesday, 29 June 2004 1:20 AM
To: Mapinfo-L
Subject: Re: MI-L Multiple labels for a single object
From: "Jacques Paris" <jac...@paris-pc-gis.com>
> I think that you would need to build a special table just for
> labelling by exploding (disaggregating) all your regions while keeping
> real donuts as one region. (option "retain holes in regions" of the
> "objects | disaggregate" menu command" )
This function ("retain holes") was new in MapInfo 6.5. For earlier
versions you can grab a copy of our ToolBox, which will perform the
same
operation for MI 4.5 - 6.0.
Kind regards
Uffe Kousgaard
www.routeware.dk
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-...@lists.directionsmag.com
For additional commands, e-mail: mapinfo...@lists.directionsmag.com
Message number: 12379
This email with any attachments is confidential and may be subject to
legal
privilege.
If it is not intended for you please reply immediately, destroy it and
do
not copy, disclose or use it in any way.
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-...@lists.directionsmag.com
For additional commands, e-mail: mapinfo...@lists.directionsmag.com
Message number: 12383
__________________________________________________
Do You Yahoo!?
http://bb.yahoo.co.jp/
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-...@lists.directionsmag.com
For additional commands, e-mail: mapinfo...@lists.directionsmag.com
Message number: 12385
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-...@lists.directionsmag.com
For additional commands, e-mail: mapinfo...@lists.directionsmag.com
Message number: 12389
--------------------------------------------------------------------------------
[Previous Main Topic]
Thread information will be updated shortly.
[Next Main Topic]
------------------------------------------------------------------------------------------------------------------------------------------------------------
It looks like your field as not integer, but Char. Please check.
Regards
Uffe Kousgaard
If you are updating a character field and you want to pad the numbers
with 0's then you could use something like:
update <mytable> set <myfield> = right$("0000"& rowid,4)
This will give you a left padded Unique ID eg 0001,0002,0003 etc which
will sort correctly.
Adjust the number of 0's and width of the string to suit.
Regards
Martin
On Jan 24, 7:27 am, "everingdavid...@gmail.com"
<everingdavid...@gmail.com> wrote:
> Hi,
>
> I am having trouble numbering map objects with a unique ID.
> I found the post copy+pasted below on the old MapInfo-L archive, and
> have already got that far, but what I'd like is to assign "2-digit"
> integer numbers for each ID.
>
> i.e. starting from 01, 02, 03, 04, 05, 06, 07, 08 ,09, 10........
>
> At the moment I have written a MapBasic script to assign the ID
> numbers. The ID column is defined as "Integer" and the results from
> 1-10 appear like below.
>
> e.g. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 .......
>
> So when the table is sorted the objects look like.....
>
> 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23........
>
> Please respond if you know a method to ensure all the ID's can be
> assigned the same number of characters...
>
> Thanks
> David
>
> Previous post below.....
>
> -----------------------------------------------------------------------------------------------------------------------------------------------
> From: "Jacques Paris" <jacq...@paris-pc-gis.com>
>
> > I think that you would need to build a special table just for
> > labelling by exploding (disaggregating) all your regions while keeping
> > real donuts as one region. (option "retain holes in regions" of the
> > "objects | disaggregate" menu command" )
>
> This function ("retain holes") was new in MapInfo 6.5. For earlier
> versions you can grab a copy of our ToolBox, which will perform the
> same
> operation for MI 4.5 - 6.0.
>
> Kind regards
>
> Uffe Kousgaardwww.routeware.dk
>
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine |www.directionsmag.com|
> To unsubscribe, e-mail: mapinfo-l-unsubscr...@lists.directionsmag.com
> For additional commands, e-mail: mapinfo-l-h...@lists.directionsmag.com
> Message number: 12379
> This email with any attachments is confidential and may be subject to
> legal
> privilege.
> If it is not intended for you please reply immediately, destroy it and
> do
> not copy, disclose or use it in any way.
>
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine |www.directionsmag.com|
> To unsubscribe, e-mail: mapinfo-l-unsubscr...@lists.directionsmag.com
> For additional commands, e-mail: mapinfo-l-h...@lists.directionsmag.com
> Message number: 12383
>
> __________________________________________________
> Do You Yahoo!?http://bb.yahoo.co.jp/
>
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine |www.directionsmag.com|
> To unsubscribe, e-mail: mapinfo-l-unsubscr...@lists.directionsmag.com
> For additional commands, e-mail: mapinfo-l-h...@lists.directionsmag.com
> Message number: 12385
>
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine |www.directionsmag.com|
> To unsubscribe, e-mail: mapinfo-l-unsubscr...@lists.directionsmag.com
> For additional commands, e-mail: mapinfo-l-h...@lists.directionsmag.com
> Message number: 12389
>
> --------------------------------------------------------------------------------
> [Previous Main Topic]
> Thread information will be updated shortly.
> [Next Main Topic]
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------- Hide quoted text -- Show quoted text -
Or use format$() something like:
update SOMETABLE set SOMECOLUMN = format$(ROWID, "0000");
--
Richard Greenwood
richard....@gmail.com
www.greenwoodmap.com
Its so easy now I know how.
As usual that answer was there in front of me the whole time, but I
never saw it until you pointed it out.
Much appreciated.
On Jan 25, 11:28 pm, "Richard Greenwood" <richard.greenw...@gmail.com>
wrote:
> On 1/25/07, Martin R <martin.round...@gmail.com> wrote:
>
>
>
> > Hi David,
>
> > If you are updating a character field and you want to pad the numbers
> > with 0's then you could use something like:
>
> > update <mytable> set <myfield> = right$("0000"& rowid,4)
>
> > This will give you a left padded Unique ID eg 0001,0002,0003 etc which
> > will sort correctly.Or use format$() something like:
> update SOMETABLE set SOMECOLUMN = format$(ROWID, "0000");
>
> --
> Richard Greenwood
The numbers will be left padded with 0's so rather than being 1,2,3,4
etc they would be character values of 0001,0002,0003,0004 etc and
therefore will sort correctly so long as all the strings are the same
length
Cheers
Martin
On Jan 27, 5:37 am, "Terry McDonnell" <T...@martlet.uk.com> wrote:
> You sure that WILL sort correctly? Numeric fields stored in character
> format do not follow a numeric sequence fully. For example:
> 1, 12, ,13, 14, 15, 16, 17, 18, 19, 2, 20, 21, ...
>
> -----Original Message-----
> From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On
>
> Behalf Of everingdavid...@gmail.com
Oh, yes, I guess you're right. I wasn't really concentrating, it was
Friday, and I guess I missed the 0 padding :-)
Cheers
Terry
Upon executing a "close all interactive" statement in a program I've
written, I get a warning message from MI that says "You cannot quit
MapInfo now."
No tables are closed.
I've been writing MB code for a number of years, and have used "close
all" frequently. I've never encountered this, though.
Any thoughts most welcome.
Cheers,
Eric Johnson
Boulder, CO
I guess MapInfo just would like you to hang around a bit longer ;-)
You wuoldn't happen to have some other applications running, that would interfer with your Close All command ?
You could try closing down all the tool in the Tools menu and then try to Close All again.
Have you tried manually closing all ?
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail p...@cowi.dk
http://www.cowi.dk/gis
Hope this helps
Spencer
I can 'close all' from the MB window once the dialog is dismissed, but
can't use the MB window when there's an active dialog.
Spencer & Peter, thanks for the replies.
-- Eric
Try "close all" without "interactive", and see if you can close all the
tables then. You may have to write your own code to loop through all the
tables, look for unsaved edits, prompt the user whether to save the data or
not, and do the saves.
But "close all" is a big, momentous thing to do, and you may want to move
that outside the dialog, as part of the action that happens when the user
dismisses the dialog.
HTH
-- Eric Johnsonnum_tablestoclose = numtables()
do
nameoftabletoclose = tableinfo(1,tab_info_name)
close table nameoftabletoclose interactive
num_tablestoclose = numtables()
loop while num_tablestoclose > 0