-
Here's a simple question! My application uses the Command statement. It returns a filename like "C:\Windows\file.txt". I just want C:\Windows\file.txt without the expressions. I don't get it... I knew how to do this a week ago... maybe time for some sleep? Thanks.
-
what do you mean by without the expressions? do you mean without the quotes.
because i use apps that use Command and the strings never have the quotes embedded in them...
-
Code:
Dim FF As Integer
Dim FName As String
If Command$ <> "" Then
FName = Replace(Command$, Chr$(34), " ")
FName = Trim$(FName)
FF = FreeFile
Open FName For Input As FF
txtText = Input(LOF(FF), FF)
Close FF
End If
-
Thank you! That did the trick.
P.S. - There's a service pack 4
-
I know there is a SP4, but I have a 56k modem, and am just going to wait till VB7 comes out :D.
-
Won't that add a space to the front and end of the string?
Just being pedantic :D, funkyd77, you get the quotes when you drop a file (icon) on your app rather than pass it parameters, probably other situations too (extentions maybe, I forget).
Not much of use in SP4, if I knew what I know now I wouldn't have bothered with the 50meg download.
bugs fixed a plenty apparently but I haven't noticed anything
-
oh,
on second read I spotted the TRIM statement :-)
why not just use "" instead of " " ????