TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: STEVE IGREJAS
from: DAVID WILLIAMS
date: 1998-05-14 16:02:00
subject: Saving Lines

->    Now I want to save 3 lines "PRINT "HI"", "PRINT NAME$", and "PRINT
-> "DUH"" in order.  Now how would I only load line "PRINT "DUH"" if
-> it's the 3rd line in the file?
Ummm.... I'm not quite sure what you want to do. Do you just want to put
the strings HI, NAME$ (whatever that may be), and DUH onto the disk? Or
do you want to include the word PRINT before each one? And, if the
latter, do you just want to "laod" than back as strings that some BASIC
program will use, or do you maybe want to "load" them in the same sense
as one loads a program, so that they become *executable* instructions?
The first possibilty is trivial. The second is trickier, because you'd
apparently want to put double quotation marks within the strings in the
file. So you couldn't just say, for example:
PRINT #1, "PRINT "HI""
to write the string to the file. This wouldn't work because the
quotation marks would be interpreted as string delimiters, producing an
error. What you'd have to do is use the ASCII value of a quotation mark,
which is 34. So you could write:
Q$ = CHR$(34)
PRINT #1, "PRINT "; Q$; "HI"; Q$
The third possibilty, that you may want to *interpret and execute*
whatever BASIC instruction(s) you have put into a disk file, is
altogether the most difficult. I won't try to explain how to do it right
now, since it may not be what you want to do, and I don't want to waste
all that effort! If this is what you want to do, ask!
                            dow
--- PCBoard (R) v15.3 (OS/2) 5
---------------
* Origin: FidoNet: CAP/CANADA Support BBS : 416 287-0234 (1:250/710)

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™.