|
-
Nov 25th, 2000, 08:07 PM
#1
Thread Starter
PowerPoster
I have some code that when you click on the filebox, it adds the filename to a path i.e. D:\Quake2\baseq2\maps\default.bsp. Is there a way to trim off the last 4 characters? (in bold).
Thanks
-
Nov 25th, 2000, 08:14 PM
#2
if u want to put it into a textbox it would be:
Code:
Text1.Text = Left(Text1.Text, Len(Text1.Text) - 4)
you can do with that what u need to do
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 25th, 2000, 08:16 PM
#3
Thread Starter
PowerPoster
-
Nov 25th, 2000, 08:27 PM
#4
The following method is more accurate.
Code:
sName = "MyFile.exe"
Print Left(sName, InStrRev(sName, ".") - 1)
It will allow for an extension of any length (e.g html or hc which are not the standard 3 length) whereas the above example does not.
-
Nov 25th, 2000, 08:31 PM
#5
Thread Starter
PowerPoster
Thanks megatron, but that method doesn't really apply to what I am doing because all the files have the same extension (.bsp). If it has a different extension, it won't show up in the file box since the pattern is *.bsp. Thanks though, I'll save that code for later, because I searched for it along time ago and couldn't find it.
[Edited by MidgetsBro on 11-25-2000 at 08:43 PM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|