LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-25-2006, 08:05 PM   #1
Delano_Lucas
Newbie
 
Registered: Jul 2006
Location: In my house.
Distribution: Slax, Slackware, Puppy, Cygwin, Feather
Posts: 26

Rep: Reputation: 15
Post Need help with BASIC


I want to make a .txt reader in the BASIC Language. It is being built into another program. Here's the Reader Subprogram:

[text]
Filedialog "Pick a .txt to open.", "*.txt", file$
open file$ for input as #1
input #1, var$
print var$
wait

the problem is that it only wants to display the first line of a document....How can I edit this to allow it to view a document in it's entirety?

P.S. Please include the edited code with your post!

Thanks in advance!
 
Old 07-26-2006, 02:30 PM   #2
rednuht
Member
 
Registered: Aug 2005
Posts: 239
Blog Entries: 1

Rep: Reputation: 31
Code:
Filedialog "Pick a .txt to open.", "*.txt", file$
open file$ for input as #1
do while not eof(1) 
    input #1, var$
    print var$
    wait
loop
I would also suggest a
Code:
close #1
on the end
so all I did is add a loop that repeats the get/print a line you already had over and over until the end of file (eof)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help on basic C vivekr Programming 12 12-01-2005 07:20 AM
really basic os? gravy Linux - Newbie 7 02-26-2005 09:20 PM
basic Ryan450 Linux - General 5 08-20-2004 11:59 PM
Need basic help dark_light Linux - General 3 04-25-2002 01:23 AM
I'm a BASIC chap, looking for some info on BASIC programming CragStar Programming 2 01-21-2001 09:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration