Results 1 to 7 of 7

Thread: Moron in distress!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    31
    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.

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196
    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...

  3. #3
    Guest
    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

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    31
    Thank you! That did the trick.

    P.S. - There's a service pack 4

  5. #5
    Guest
    I know there is a SP4, but I have a 56k modem, and am just going to wait till VB7 comes out .

  6. #6
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    Won't that add a space to the front and end of the string?

    Just being pedantic , 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

    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  7. #7
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    oh,

    on second read I spotted the TRIM statement :-)

    why not just use "" instead of " " ????

    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width