![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
How do you get a file name argument when a file is chosen from within a file manager?
I can make it so I tap on a file and my program launches, but I want it to load the file I tapped on as well, which I can't work out how to code. I figure its probably an argument option or something, but I can't work it out. What do I have to do? |
|
|||
|
Afraid I don't really understand the help on it, I assume the program will be launched with the file name as an argument but I can't see how I capture that to use. Might fiddle with the code shown in help, but I could do with some more pointers...
(Also I apologise, but I seem to have posted this in 'Code Samples and Tips', rather then the more suitable 'questions/help needed' forum. Can someone move it? I've no idea why I put it here.... *feels silly*) |
|
|||
|
Ah, thanks agraham, the help file, your last comment and some trial and error seem to have got it all working now. Suddenly it all seems quite obvious.
![]() my code for anyone else with the problem is: Code:
(In app start) If ArrayLen(Args()) = 1 Then 'Will catch if a single argument is given. (Like a file name) file = args(0) If SubString(file,StrLength(file) - 3, 3) <> "jgf" Then 'Checks the file extension to see if its the right type. Msgbox(File & " is not a valid file","Error") Return End If opendialog1.File = file LoadFile EDIT: First version only worked when given an argument to check. . New code checks if the argument is there...Last edited by Hennell : 03-11-2008 at 09:58 AM. Reason: code bug :) + add comment. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CSV file generates strange start in file | sunnyboyj | Questions & Help Needed | 9 | 12-21-2007 08:38 PM |
| b4ppc crashes on opening serialport (cfserialclass.dll) | sloopa | Questions & Help Needed | 1 | 06-12-2007 08:26 AM |