Display lines from text file

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
bigjoe11a
Coder
Posts: 17
Joined: Sun Jun 10, 2007 10:43 am
Contact:

Display lines from text file

Post by bigjoe11a »

What I want to do is. Is read from a file and only display the first 20 lines. then give an option to quit, or read more.

open the file

Line input #1, line$ ' A way to loop threw until the 1st 20 lines area read in
print line$

input "Read More or Quit" if More then read the next 20 lines or quit and return to the main menu

Any one have any ideas on this.

And is there a Quick Basic Manual on line that I can download. I been looking and can't seem to find any thing


Joe
User avatar
Brandon
Coder
Posts: 47
Joined: Sat Nov 19, 2005 9:24 pm
Location: NY
Contact:

Post by Brandon »

Code: Select all

open "TEXTFILE.txt" for input as #1

10 
for x%= 1 to 20 
Line input #1, line$ ' A way to loop threw until the 1st 20 lines area read in
print line$
next x% 

input "Read more or Quit"; responce$
if responce$="Go On" then
cls
goto 10 'starts over and gets the next 20
else
close #1
system
end if
I know this may be kind of crappy but I don't care!(Wow I used a line number!)
bigjoe11a
Coder
Posts: 17
Joined: Sun Jun 10, 2007 10:43 am
Contact:

From what I fount out

Post by bigjoe11a »

Its called an input buffer, NOT a file Buffer
Ralph
Veteran
Posts: 148
Joined: Fri Feb 09, 2007 3:10 pm
Location: Katy, Texas

Post by Ralph »

I don't know where one might find a QuickBASIC manual, but, a good place to learn is with tutorials. For starters, go to the top of this site and click on the link,
Return to Pete's QBasic Site
Then, search in the left-hand sidebar for Tutorials.

If you need more tutorials, let us know.
Ralph, with QuickBASIC 4.5, operating under Windows XP, wiht anHP LaserJet 4L Printer. Bilingual in English/Spanish
Erik
Veteran
Posts: 72
Joined: Wed Jun 20, 2007 12:31 pm
Location: LI, NY
Contact:

Post by Erik »

idk about online, but I know at my town's Library there's still a bunch of Qbasic/QuickBasic programming books...
bigjoe11a
Coder
Posts: 17
Joined: Sun Jun 10, 2007 10:43 am
Contact:

Just not what I was looking for

Post by bigjoe11a »

Ralph wrote:I don't know where one might find a QuickBASIC manual, but, a good place to learn is with tutorials. For starters, go to the top of this site and click on the link,
Return to Pete's QBasic Site
Then, search in the left-hand sidebar for Tutorials.

If you need more tutorials, let us know.
Most of the tutorials are ok. Just not what I'm looking for. What I need is a index for all the commands used with samples.
bigjoe11a
Coder
Posts: 17
Joined: Sun Jun 10, 2007 10:43 am
Contact:

No Money

Post by bigjoe11a »

Erik wrote:idk about online, but I know at my town's Library there's still a bunch of Qbasic/QuickBasic programming books...
this is a better idea if I had the money. Just to go out and buy one would be even better. It's just to go or do any thing out side my own home would cost money.
Erik
Veteran
Posts: 72
Joined: Wed Jun 20, 2007 12:31 pm
Location: LI, NY
Contact:

Re: No Money

Post by Erik »

bigjoe11a wrote:
Erik wrote:idk about online, but I know at my town's Library there's still a bunch of Qbasic/QuickBasic programming books...
this is a better idea if I had the money. Just to go out and $$$ one would be even better. It's just to go or do any thing out side my own home would cost money.
? You're library charges you to take books out? :?:
bigjoe11a
Coder
Posts: 17
Joined: Sun Jun 10, 2007 10:43 am
Contact:

Re: No Money

Post by bigjoe11a »

Erik wrote:
bigjoe11a wrote:
Erik wrote:idk about online, but I know at my town's Library there's still a bunch of Qbasic/QuickBasic programming books...
this is a better idea if I had the money. Just to go out and $$$ one would be even better. It's just to go or do any thing out side my own home would cost money.
? You're library charges you to take books out? :?:
Like I said, No Money any way. and the library won't have books for the programming I do. Using the Easy Door Library. I can't beleave that no one else has had this same problem and a fix for it.
sid6.7
Veteran
Posts: 318
Joined: Tue Jun 21, 2005 8:51 am
Location: west USA
Contact:

Re: No Money

Post by sid6.7 »

bigjoe11a wrote:
Erik wrote:
bigjoe11a wrote: this is a better idea if I had the money. Just to go out and $$$ one would be even better. It's just to go or do any thing out side my own home would cost money.
? You're library charges you to take books out? :?:
Like I said, No Money any way. and the library won't have books for the programming I do. Using the Easy Door Library. I can't beleave that no one else has had this same problem and a fix for it.
okay i just emailed the author of easy door and he says
he still supports it....although its freeware now

he would be the one to ask all your easy door questions too...

here:
http://www.vbsoft.org/ezdoor.php
bigjoe11a
Coder
Posts: 17
Joined: Sun Jun 10, 2007 10:43 am
Contact:

Re: No Money

Post by bigjoe11a »

sid6.7 wrote:
bigjoe11a wrote:
Erik wrote: ? You're library charges you to take books out? :?:
Like I said, No Money any way. and the library won't have books for the programming I do. Using the Easy Door Library. I can't beleave that no one else has had this same problem and a fix for it.
okay i just emailed the author of easy door and he says
he still supports it....although its freeware now

he would be the one to ask all your easy door questions too...

here:
http://www.vbsoft.org/ezdoor.php
Bryan never said any thing to me about it being free, and I wish he would give me the help I need. He doesn't all ways reply back
Post Reply