# PRINT the " symbol in QBasic



## flytape8490 (Oct 7, 2003)

I'm making a graphics demo in QBasic, and I'm having some troubles making it display some text I want.
So, I want to display this


> The "place-read" mode has been turned on.


To do this, one would assume just do this.

```
PRINT "The "place-read" mode has been turned on."
```
But that doesn't work, because then QB assumes that place-read is a arithmatic string 'cuz the "s surrounding it make it a variable/command string. So, how do I display "s without ostracising what they surround from normal text?

... and yes, I am proud that I only know QB and HTML scripting. I don't mind being oldschool.


----------



## Chicon (Jul 29, 2004)

Just try this :

```
[SIZE=3][B]
LET Q$ = CHR$(34)
LET T$ = "The " + Q$ + "place-read" + Q$ + " mode has been turned on."
PRINT T$[/B][/SIZE]
```
34 is the decimal value of the ASCII code of "


----------



## IMM (Feb 1, 2002)

Alternate way (if you aren't doing it too often)

PRINT "The ";CHR$(34);"place-read";CHR$(34);"mode has been turned on."


----------



## attilathepun (Sep 26, 2005)

Your original problem was caused by the qbasic interpreter assuming that the second " (the one at the beginning of 'place-read') signified the end of the string. In newer languages there's an escape character, usually \, that makes it ignore the following character, but in basic you have to call the ascii character instead of entering it directly.

BTW, qBASIC was my first language -- I started learning it when I was 12, and it hooked me on programming. That language first pulled me in, and I still enjoy it - although I can't say I use it for anything productive now.


----------

