Hello,
I'm not a programmer, but like to dabble in QuickBasic, and am currently stumped!
I'd like to write a string of data to a sequential (readable, ASCII)
file that contains quotes in it. Specifically, I am assembling an MS-DOS
batch statement from QB:
PRINT #1, "if "%1"=="bypass" goto end"
Of course, the second quote PRINT sees is interpreted as the end of the string.
Can I get around this?
Thanks a bunch,
Andy
How to WRITE or PRINT a string containing quotes to a file?
A solution (the only one?)
Sorry for the double-post, but I realize I can write a " to the file by using
CHR$(034). The line becomes :
PRINT #1, "if " + CHR$(034) + "%1" + CHR$(034) + "==" + CHR$(034) + "bypass" + CHR$(034) + " goto end"
Is this the only / best way?
Andy
CHR$(034). The line becomes :
PRINT #1, "if " + CHR$(034) + "%1" + CHR$(034) + "==" + CHR$(034) + "bypass" + CHR$(034) + " goto end"
Is this the only / best way?
Andy
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact: