Issues with mapBasic 10.5

36 views
Skip to first unread message

robert crossley

unread,
Jul 18, 2011, 11:30:15 PM7/18/11
to mapi...@googlegroups.com

Hi,

After wasting some hours on an issue with mapBasic/ Mapinfo Version 10.0
last night, now using MapBasic 10.5 is giving me grief.

It seems that compiling a program in 10.5 doesn’t like create table commands
that include the clause “using”:

This compiles:

Create Table "TMP_YearFarm_Combined" (ID Integer)
file gAgDatWorkingPath + "TMP_YearFarm_Combined.TAB" TYPE
NATIVE

But this doesn’t:

Create Table "TMP_YearFarm_Combined" Using T_FARM_SPATIAL
file gAgDatWorkingPath + "TMP_YearFarm_Combined.TAB" TYPE NATIVE

It does, however, compile in Version 7 and version 10.

Also, the format of the command did change for Access tables in that the
need for a keyword “Database” was removed when specifying a database name
beween Version 7 and 10.5. Why? Can live with this one though.

I have applied the latest patch to be 10.5.2

Regards
Rob.


-------------------------------------------
Robert Crossley
Managing Director
Agtrix P/L Australia

Far Southern Queensland Office:
Unit 6, 2 Bonanza Drive
Billinudgel NSW 2483
AUSTRALIA
Postal:
PO Box 63
New Brighton 2483

P: 61 (0) 2 6680 1309
M: 61 (0)419 718 642
E: rob...@agtrix.com
W: www.agtrix.com <http://www.agtrix.com/>
S: robertcrossley

28°30'14.81"S
153°31'41.79"E

Brisbane Office:
109 Milsom St
Cooparoo 4151
Queensland
P: 61 7 3843 3363


Bo Victor Thomsen

unread,
Jul 19, 2011, 4:02:37 AM7/19/11
to mapi...@googlegroups.com
Hi Robert -

The following example works for me:

=============
declare sub main

sub main ()
  Create Table "test" (a Char(10)) file "C:\TEMP\test.TAB" TYPE NATIVE Charset "WindowsLatin1"
  Create Map For test CoordSys Earth Projection 1, 0
  Create Table "test_using" Using test file "c:\temp\test_using.tab" ' Type Native -- doesn't work i 10.5
end sub
=============

The 10.5 compiler barfs when using the directive "Type Native" in the "Create Table ... Using.." command. And it was working in MapBasic ver 10.0.

Regards 
Bo Victor Thomsen


2011/7/19 robert crossley <rob...@agtrix.com>
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

Thomas Bacon

unread,
Jul 19, 2011, 4:19:39 AM7/19/11
to mapi...@googlegroups.com

Hi Guys,

 

When creating a table as TYPE NATIVE you don’t need to actually include the clause as this is the default type anyway. You should only need to include the optional type clause if you are creating a table with data format DBF, Access or ODBC.  Still, I don’t see why this should be causing a compilation error.

 

Regards,

 

Tom Bacon

Graduate GIS Engineer

Asset Management South

Tel: 01444 472380

www.mouchel.com

 




The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. Mouchel Limited, Registered in England at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX Registered No : 1686040

robert crossley

unread,
Jul 19, 2011, 4:49:16 AM7/19/11
to mapi...@googlegroups.com

Thanks Bo for confirming that.

 

Not sure what to do now though.  Do I write a function that creates a table based on the structure another table?  Maybe I can use the version 10 mapBasic compiler, and make sure the users use at least version 10.5 mapinfo, as Version 10 Mapinfo was crashing with code when trying to save a copy of a series of files last night, whereas Version 10.5 Mapinfo worked fine.

 

Perhaps there was logic in staying on Version 8.5 for so long……

 

R

 

From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Bo Victor Thomsen
Sent: Tuesday, 19 July 2011 6:03 PM
To: mapi...@googlegroups.com
Subject: Re: [MI-L] Issues with mapBasic 10.5

 

Hi Robert -

robert crossley

unread,
Jul 19, 2011, 4:51:29 AM7/19/11
to mapi...@googlegroups.com

Thanks Tom,

 

It also gives me the same error when I save it as an Ascess database error –Unrecognised Error Access.

 

But compiles fine on Version 10 and below.

 

R

Thomas Bacon

unread,
Jul 19, 2011, 5:07:07 AM7/19/11
to mapi...@googlegroups.com

Hmm.. Have you got MS Office installed? What version? There may be compatibility issues (especially if you are using a 64bit edition of MS Office).

 

Tom Bacon

Graduate GIS Engineer

Asset Management South

Tel: 01444 472380

www.mouchel.com

 

Warren Vick

unread,
Jul 19, 2011, 6:08:22 AM7/19/11
to mapi...@googlegroups.com

Hello Robert,

 

If you're copying the structure of one table to make a new one, one method that has always worked is to select with a where condition that is always false, and then save the resulting table to your new output. For example:

 

select * from OriginalTable where rowid = 0 into TO_SAVE noselect

commit table TO_SAVE as "NewTable"

 

That said, wasn't even aware of the "using <tablename>" option on the "create table" statement!

 

Regards,

Warren Vick

Europa Technologies Ltd.

http://www.europa.uk.com

robert crossley

unread,
Jul 19, 2011, 6:13:37 AM7/19/11
to mapi...@googlegroups.com

Thanks warren,

 

That may well work.  Damn quicker than writing a function to do it.

 

Rob.

robert crossley

unread,
Jul 19, 2011, 8:01:49 AM7/19/11
to mapi...@googlegroups.com

Warren,

 

Have replaced all my create table using table instances with the code as suggested.  And it compiles in version 10.5 now.

 

Sometimes the old workarounds have their day in the sun again, even if they didn’t know they were in the shadows.

 

Thanks.

Reply all
Reply to author
Forward
0 new messages