Posts: 273
Threads: 51
Joined: May 2002
Is there a command you can use with qb to load a program after qb opens? Sorta like /run, but without actually running the program? I'm pretty sure you can't, so a yes/no answer will do. Thanks
Posts: 2,765
Threads: 138
Joined: Nov 2002
ya. all you do is put the file name
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 273
Threads: 51
Joined: May 2002
Posts: 3,522
Threads: 189
Joined: Dec 2003
Thats pretty obvious.. didn't you know that r@dioman?
hides* I didn't know... lol..... *feels stupid*
Posts: 2,765
Threads: 138
Joined: Nov 2002
lol, i didn't know until i looked it up in the help file =P
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 273
Threads: 51
Joined: May 2002
sometimes we forget the most basic things. I've never needed to open a file using that method until now.
Posts: 3,616
Threads: 287
Joined: Jan 2003
In Windows, just drag the .bas file over qb.exe (or it's shortcut). That basically tells Windows to use the filename of the file you dragged as the commandline.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 358
Threads: 15
Joined: May 2003
Quote:In Windows, just drag the .bas file over qb.exe (or it's shortcut). That basically tells Windows to use the filename of the file you dragged as the commandline.
To elaborate...compile the following code:
Code:
DEFLNG Z 'make z a long int...for speed
c$ = COMMAND$ 'Look, ma...c$ contains the path to the "dropped" file
DIM a AS STRING * 1 'a "one character" string
z = 1 'the byte position in the file
OPEN c$ FOR BINARY AS #1 'doesn't need to be bin if you know your file contains text/carrage returns...
DO
GET #1, z, a 'get a byte of the file
PRINT a; 'print said byte
z = z + 1 'increment the file pointer
LOOP WHILE NOT EOF(1) 'until the end of file is detected
PRINT 'make a new line
INPUT "Enter to contiune", x 'pause for input before closing window...
END 'uh...if this needs explaining, you're in trouble!!!
Then..."drop" a file onto the exe...it will open the file, and print it's contents, one byte at a time. This is a convenient way to "open and use" a file, but it only works if you compile your program...to run from the QB IDE, you need to make provisions to provide a valid path...
Joe (oops...I'm really mango)