Results 1 to 7 of 7

Thread: command to open file

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I've been messing around with having a file open in my app when I dbl click on it. When I add the filename to the command line arguments in the the project properties, it worked fine, but when I compiled the app, an error came up saying 'Path not found', or something to that effect. So, being curious, I added value of Command to a listbox. When the app is not compiled, the value added to the list is the name of the file, but when I remove the command line arguments from the project properties, and compile it, when I dbl click on the file, the value added to the list is "the name of the file"(note that the quotation marks have been added), and I think that that is part of the problem, do you think it is, and if so, how do you think I should correct it?

  2. #2
    Hyperactive Member barrk's Avatar
    Join Date
    Sep 2000
    Location
    My own little world
    Posts
    274
    Not sure I understand your problem but...

    Is the client's directory set up like the one you are using to compile the code? It may find the path on your computer but the client path is different and will not be found.

  3. #3
    Guest
    Post your code. It will be easier for us to track down the error.

  4. #4

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Code:
    Private Sub Form_Load()
    If (Command <> "") Then
       getFile Command
    End Sub
    
    Private Sub getFile(fileName as String)
    Open fileName as #1
       Input #1, txtString
       Listview1.ListItems.Add , , txtString
    Close #1
    End Sub
    And the error says 'Bad file name or number'

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    Open fileName for Input as #1
    Should actually say bad filemode, open in a mode, in this case Input.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Sorry

    I did have it as :
    Code:
    Open fileName For Input As #1
    Forgot it when typing.

  7. #7

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Basically, the issue is that when I drag the file I want to open with my app over my app's icon, the value of Command is this:

    C:\windows\desktop\testdoc.jmd

    and when I double click on the file the value of Command is this:

    "C:\windows\desktop\testdoc.jmd"

    why is it doing this?

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