| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Ascii Text Probs |
SC> Does anyone know how to load an ASCII text file into AMOS, so it
SC> can successfully be stored in memory say for instructions etc.
In psuedo-basic (Hmm, isn't that what Amos is?)
DIM a$(1000) ; Naturally, 1000 elements is subject
to variation!
ii=0
OPEN "I",#3,"MyFile"
WHILE NOT EOF(#3)
ii=ii+1
LINE INPUT #3,a$(ii)
WEND
CLOSE #3
That'll then load up your textfile into a$(). You'll also know how many
lines of text you have if you store your ii counter somewhere, too!
And since strings in BASIC can be up to 32k long, you might not even need
it in an array, one string might well be enough?
The key commands there are OPEN and LINE INPUT. LINE INPUT takes in a
single linefeed-terminated line, as opposed to INPUT. LINE INPUT basically
ignores all the commas, and inverted commas, etc.
Mea Culpa,
Peter Deane
--- Plutonic 2.15 #1
* Origin: Inquestor. Aust'n TrapDoor Support +61-43-96-1587 CM (3:711/476)SEEN-BY: 620/243 621/525 622/446 623/630 625/100 711/401 407 409 413 430 439 SEEN-BY: 711/461 476 808 809 934 712/515 713/888 714/906 800/1 @PATH: 711/476 439 430 808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
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™.