Hello,

> I am writing a program in which users specify their own output table
> names. This allows users to create table names with spaces. I want to use
> the Add Map ... Layer statement to add this table to an existing open map
> window - which is where the problem lies. I can't use the same variable
> in the Layer clause as the Open table statement because the Layer clause
> does not recognise spaces in table names. MI converts spaces to
> underscores so the open table name has essentially changed. What's the
> best way to deal with this so that instead of:
> 
> ...Layer input one... the result would be
> 
> ...Layer input_one?

You have to write the function in MapBasic, which will get the string parameter - the
name of the table entered by the user - and return the correct MapInfo table name.
You will have to check every character of the user's table name, and if it is outside
the 'A'-'Z', 'a'-'z' and '0'-'9' ranges - replace it with '_'. Also, after this, check 
the first
character - if it is not in range 'A'-'Z' or 'a'-'z' - add '_' before the string.

Dmitry

Dmitry Bogdanov
GIS Department Manager
Kiev Software Factory Ltd.
room 46 9/12 Baumana St, Kiev, Ukraine 252190
Tel: (380 44) 442-6077; (380 44) 443-7925
Fax: (380 44) 443-7925
Internet: http://www.ksf.kiev.ua

----------------------------------------------------------------------
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