Timothy,

In Visual Basic you can use the brute force method to search the string from
right to left looking for the first back slash. Everything to the right of
that will be the file name. This can easily be done with the len(), right(),
and mid() functions.

strFilePath = "c:\data\mytable.tab"

' step through the string from right to left to find the backslash
For i = len(strFilePath) to 1 Step -1
  If mid(strFilePath, i, 1) = "\" then
    strFileName = right(strFilePath, len(strFilePath) - i)
    Exit For
  End If
Next i

James F. Koennicke
GIS Programmer
Vista Information Technologies, Inc.

-----Original Message-----
From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
On Behalf Of Timothy Chinchen Cen-IT
Sent:   Wednesday, October 20, 1999 11:14 AM
To:     'Mapinfo List'
Subject:        MI Quick VB/MB string formatting question

Not necessarily an MI question but in VB and/or MB does anyone know how I
can remove the Path info and extension on a string e.g.

From
C:\data\MyTable.Tab
to
MyTable

Many Thanks

Tim Chinchen (GIS Systems Developer)
I.T. Services Bournemouth Borough Council
Mailto:[EMAIL PROTECTED]




**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.bournemouth.gov.uk
**********************************************************************


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

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