Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading a file when qb opens...
#1
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
Reply
#2
ya. all you do is put the file name

Code:
QB remline.bas
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#3
:roll: of course
Reply
#4
Thats pretty obvious.. didn't you know that r@dioman?

hides* I didn't know... lol..... *feels stupid*
Reply
#5
lol, i didn't know until i looked it up in the help file =P
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#6
sometimes we forget the most basic things. I've never needed to open a file using that method until now.
Reply
#7
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.
Reply
#8
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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)