Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.basic.misc > #231
| From | Todd Vargo <tlvargo@sbcglobal.netz> |
|---|---|
| Newsgroups | comp.lang.basic.misc |
| Subject | Re: Opening a .DAT file |
| Date | 2012-03-12 16:12 -0500 |
| Organization | albasani.net |
| Message-ID | <jjlorh$rla$1@news.albasani.net> (permalink) |
| References | <46O6r.4324$v14.3046@viwinnwfe02.internal.bigpond.com> <jjidpl$m5v$1@news.albasani.net> <Wnq7r.4518$%E2.3170@viwinnwfe01.internal.bigpond.com> |
On 3/12/2012 12:29 PM, DonH wrote: > "Todd Vargo"<tlvargo@sbcglobal.netz> wrote in message > news:jjidpl$m5v$1@news.albasani.net... >> On 3/10/2012 2:39 PM, DonH wrote: >>> Is this possible, to view contents on-screen? >>> QBasic enables data to be stored in a Sequential file, and you can use >>> .TXT or .DAT as the storage unit. But only .DAT is possible for storage >>> as >>> a Random Access file. >>> Any .TXT file can be opened on-screen. >>> Indeed, data can be loaded into a normal WordPad text file, and saved >>> as >>> "Text Document - MS-DOS Format", and then transfer to Basic file folder, >>> for >>> renaming as .BAS. >>> The data can then be copied into Basic programs, using QBasic's own >>> clipboard, and Edit/Cut, Paste. (Selected text, highlighted). >>> Of course, this may only apply to limited amounts of data, otherwise >>> storage on hard disk (c: drive) might be necessary. >>> The reverse of TXT-to-BAS is possible, ie a .BAS file can be >>> renamed/saved as .TXT (Useful if you want to incorporate into WORD >>> documents). Such text can be supplemented by a ScreenPrint of the >>> program >>> results, then use Paint to reverse colours... >> >> That is kind of a long way to go just "to view contents on-screen". Since >> you can use Edit or Wordpad to view files of any extension, I have to ask, >> what are you trying to accomplish here? > > # Thanks for the tip, and I've now opened a DAT file using WordPad. > As for the rest of my experimenting with TXT files and BAS, I find you > can edit (add, delete, replace, entries) in a (Sequential) TXT file, > on-screen, and such amendments are accepted by the related BAS program. > However, you can't fool QBasic by trying to substitute a whole TXT file in a > program - it must have been created by that program, using filenumber, etc. > Fair enough. > The whole business of data storage by Basic has probably been superseded > by WORKS spreadsheets or databases. > So, why bother with BASIC at all? > Maybe, as (1) it forces us to think logically, and (2) is basis of most > other programming systems. > A computer is entirely logical, even to the extent of "garbage in, > garbage out". > It can't generate an entirely random number - needs a seed, and an > algorithm. As far as reading an entire text file into memory goes, that is covered in the topic "QBasic Environment Limits" in the help menu. But you ask, "Why bother with BASIC at all"? Well, for doing useful things that go beyond viewing a files contents. Other than that, it does not appear you are trying to accomplish anything. GIGO Todd Vargo (Post questions to group only. Remove "z" to email personal messages)
Back to comp.lang.basic.misc | Previous | Next — Previous in thread | Next in thread | Find similar
Opening a .DAT file "DonH" <donlhumphries@bigpond.com> - 2012-03-11 06:39 +1100
Re: Opening a .DAT file "Auric__" <not.my.real@email.address> - 2012-03-11 01:04 +0000
Re: Opening a .DAT file "DonH" <donlhumphries@bigpond.com> - 2012-03-13 04:14 +1100
Re: Opening a .DAT file H-Man <Spam@bites.fs> - 2012-03-12 12:25 -0600
Re: Opening a .DAT file ralph <nt_consulting64@yahoo.net> - 2012-03-12 13:28 -0500
Re: Opening a .DAT file Todd Vargo <tlvargo@sbcglobal.netz> - 2012-03-11 09:45 -0500
Re: Opening a .DAT file "DonH" <donlhumphries@bigpond.com> - 2012-03-13 04:29 +1100
Re: Opening a .DAT file Todd Vargo <tlvargo@sbcglobal.netz> - 2012-03-12 16:12 -0500
Re: Opening a .DAT file "DonH" <donlhumphries@bigpond.com> - 2012-03-14 05:47 +1100
Re: Opening a .DAT file Todd Vargo <tlvargo@sbcglobal.netz> - 2012-03-13 17:18 -0500
Re: Opening a .DAT file H-Man <Spam@bites.fs> - 2012-03-13 15:38 -0600
Re: Opening a .DAT file "R.Wieser" <address@not.available> - 2012-03-15 22:48 +0100
csiph-web