TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: SAM ANDREWS
from: DAVID WILLIAMS
date: 1998-04-28 09:49:00
subject: write #1,`ahhhhhh`

-> Ok ill try that . But what is the write command good for? It like
-> print but it puts " around the message printed to the screen or a
-> file.
Quoting the (ancient) MS-BASIC manual that I have here:
"The difference between WRITE# and PRINT# is that WRITE# inserts commas
between the items as they are written to the file and delimits strings
with quotation marks. Therefore, it is not necessary for the user to put
explicit delimiters in the text. A carriage return/linefeed sequence is
inserted after the last item in the list is written to the file."
So, for example, if A$ is "apple", B$ is "orange" and C$ is "banana",
the command:
WRITE #1, A$; B$; C$
will cause the file to contain:
"apple","orange","banana"
If PRINT# had been used instead, the file would contain:
appleorangebanana
If a string contains a comma, for example:
X$ = "Testing, testing"
WRITE#1, X$ will put into the file:
"Testing, testing"
PRINT# will put:
Testing, testing
If the program that reads the file has the command:
INPUT #1, Q$
In the WRITE# case, Q$ will contain:
Testing, testing
The PRINT# case will make Q$ contain just:
Testing
The comma will have been interpreted as a delimiter.
Enough?
                            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™.