September 28, 2020, 02:39:49 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
   Home   Help Search Login Register  
Pages: [1]
Author Topic: Mote then 8 characters PLEASE  (Read 4485 times)
New Member

Posts: 4

« 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?
Ancient Guru
Posts: 709

« Reply #1 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
« Last Edit: November 15, 2008, 09:31:36 AM by Dav » Logged

Ancient Guru
Posts: 544

« Reply #2 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.

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Posts: 84

« Reply #3 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.....


Pages: [1]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!