Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 1677
Number of posts: 4766

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Edit Report
path in Quickbasic Posted by hepa on 16 Jun 2000 at 4:44 PM
How can I get the path in Quickbasic?<br>
<br>
For example, a program that opens file "text.txt" is located on "c:\temp". Also the file "text.txt" is located on that directory. If I run the program from "c:\" with command c:\temp\program.exe , the program tries to open c:\text.txt .<br>
<br>
So, what do I need to do to tell the program that the file is located on the same directory that the program itself?


Edit Report
Re: path in Quickbasic Posted by Lord_VyroIngo on 16 Jun 2000 at 8:07 PM
chdir path$<br>
<br>
I have to put this here so the message post will be longer. I guess he got tired of people just putting blank messages up on the server... ok, that should do it. =) if you have any other questions, just post, and I'll try to help you, but I won't do your homework. (be crafty in your representation, and I just might) <br>
<br>
enjoy.


Edit Report
Why not just do this? Posted by Nekrophidius on 20 Jun 2000 at 9:13 AM
From the command line:<br>
<br>
CD TEMP<br>
<br>
then run your program.<br>
<br>
When you specify a path for executing a program, even if it's a relative path, the OS will not change directories but will run the program from where it is.<br>
<br>
Of course, one other way of doing this is to specify a path in the file itself:<br>
<br>
OPEN "C:\TEMP\TEXT.TXT" FOR BINARY ACCESS READ AS FileHandle<br>
<br>
which will work just fine no matter what directory you run the program from.<br>
<br>
-nek


URL:http://lss.zext.net/




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.