Qbasicnews.com

QBasic => QB Discussion & Programming Help => Topic started by: johnfin on November 14, 2008, 05:16:32 PM



Title: Mote then 8 characters PLEASE
Post by: johnfin on November 14, 2008, 05:16:32 PM
I am writing a file into a dos directory via qbasic and I need a file name longer then 8 characters. Any ideas?


Title: Re: Mote then 8 characters PLEASE
Post by: Dav on November 14, 2008, 06:48:30 PM
If it's already a LFN file then Qbasic can OPEN/PRINT/CLOSE it without destroying its LFN status. You have to OPEN it by its short filename however (whatever that is, like OPEN "THISIS~1.TXT").

Qbasic cannot create a LFN file without the aid of a LFN library, as far as I know. Maybe some knows of a slick way to SHELL something to handle that step.

EDIT: I have a LFN library somewhere - I'll try to locate it.

- Dav


Title: Re: Mote then 8 characters PLEASE
Post by: Ralph on November 15, 2008, 05:54:05 PM
Dav has shown me the way!  Just open Notepad, enter anything, say the letter "a", and save as the long name file you need, say, abcd1234567.txt.

Open QuickBASIC, open the file "abcd12~1.txt" for output, and write to it.  As Dav pointed out, the file will retain its long name.

Or, from within QB, from the immediate window, just enter SHELL "Notepad", create your small, long-name file, and close it, then exit Notepad.  Now, either open a program that will open the lon-name file, or wrtie the code to do so.

Brilliant, Dav! Thanks for the insight.


Title: Re: Mote then 8 characters PLEASE
Post by: Clippy on November 15, 2008, 09:27:14 PM
I don't see why anybody really needs long filenames. I have never had to resort to such things in QB. You just have to be more creative so that you don't write over another one.

So far JohnFin has not replied at ANY QB site that he posted to. Grrr.....

Ted