Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mote then 8 characters PLEASE
#1
I am writing a file into a dos directory via qbasic and I need a file name longer then 8 characters. Any ideas?
Reply
#2
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
Reply
#3
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.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#4
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
Get my QB demonstrator here: http://dl.dropbox.com/u/8440706/Q-Basics.zip
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)