TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: KEVIN SHEETZ
from: CRAIG A MCKAY
date: 1997-04-15 21:51:00
subject: File handling in BASIC

Y'ello Kevin!
What do you want to do?  If it's just manipulating text files, that's a 
doddle.
If you want to use a structured, random-access file, again, BASIC allows you 
to
do this quite easily, although I would be the first to admit the syntax is
cumbersome.
Say, for example you wanted to do something like convert one file to all 
pper
case, and save it to another file.  (Forgive twee and contrived example)
OPEN "file1" FOR INPUT AS 1
OPEN "file2" FOR OUTPUT AS 2
WHILE NOT EOF(1)
    LINE INPUT #1, l$
    PRINT #2, UCASE$(l$)
WEND
CLOSE
END
I think BASIC is a fantastic, versatile wee language and because things can 
e
rustled up really quickly, you can a working solution in nae time at a'.  I 
use
MS-QuickBASIC 4 all the time.
Stream handling in C++ is Ok too, though...  I could give you an example
similar to the one above if you like.  If I'm being condescending and saying
stuff that's insulting or far less complex than what you were trying to do, I
really am sorry.  I get accused of over-simplifying things.  I just like to 
try
to explain myself correctly.  :)
Seeya!
                            Fido = 2:259/33
  --Craigzilla++        Internet = McMoose@sol.co.uk
                             WWW = http://www.taynet.co.uk/users/mcmoose/
--- GEcho 1.00
---------------
* Origin: The Kilted Bun, Letham Angus -- hame o' the McMoose (2:259/33)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.