Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quotations

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is it possible to print something to the screen or to a file with the quotations? In using QBasic, the program assumes that I am making two seperate...things...anyway, what I want to do is take the user input (name of program) and make a line that looks like this.

Name "xxxxxxxx"

So I set up the code to look like this.

"Name ""; program$ ;"""

and it does this to my code

"Name "; "; program$ ;" ""

I'm pretty sure you can all tell I'm *very* new at this and I have tried desperately for 3 hours so far to figure it out on my own, but I need a brain to talk to. Not a search engine. PLEASE HELP!
 
So, you been hanging out with VB or VBScript programmers to learn the double quote trick? :)# Use CHR$(34), which is the " character.

"Name "; CHR$(34); program$ ; CHR$(34)
 
If you use it a lot and are doing a LOT of processing (i.e., your program actually takes time to run), you can shave some milliseconds off by storing the result in a variable, since doing [tt]CHR$(34)[/tt] actually results in a function call, even though it returns the same value every time. This can also make it easier to type:
[tt]
q$ = CHR$(34) 'q for quote

PRINT q$; &quot;In quotes&quot;; q$; &quot; <-- that text is in double-quotes (&quot;; q$; &quot;)&quot;
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top