Open files in program
BlitzPlus Forums/BlitzPlus Programming/Open files in program
| ||
Hmmm. I have no idea how to do this: Make it that when you double click on the icon for your file type (which works exclusively to your program), that it then opens your program (done that bit so far) and then reads that file, and sets up the file accordingly, rather than opening a new file in the program. Anyone? |
| ||
Use CommandLine(). The file you double-clicked on will be the first parameter. |
| ||
Thanks! It works when i put the filename as the command line, but doesnt when i open a file: It states 'Invalid Stream Handle' I'll give it a good look over to see what i've done wrong (probably variables mixed/localised or something hastily stupid like that...) Edit: hmm. couldnt find the problem. Alright, Heres my code (sampled): Like i have said, it works within Blitz, but once compiled, fails to work......Help |
| ||
Problem solved. Insert this line before you try to open the file:mapfilename=Trim(Replace(mapfilename, Chr$(34), " ")) Readfile doesn't like the quotes -- it was as if you were calling Readfile(""file"") and it didn't like that. |
| ||
Thanks again!! Ill be using that piece of code in everything i read! |