writing quotes to files

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Guest
writing quotes to files

Post by Guest » Mon Mar 22, 2004 5:27 pm

Hi,

Ik want to write quotes ("") to files because i want to create a HTML page generator. How can I do this?
Thnx in advance!

Regards,
Matthijs

User avatar
scorpion
Newbie
Posts:8
Joined:Sun Mar 21, 2004 11:26 pm
Contact:

Re: writing quotes to files

Post by scorpion » Mon Mar 22, 2004 8:21 pm

you can do that with te chr$ function
it returns te ASCII char with that number.
when you type this the var. quot$ contains "
qout$ = chr$(32)
....;D.....

Artie
Jr. Member
Posts:23
Joined:Fri Feb 06, 2004 12:48 am
Location:Florida
Contact:

Re: writing quotes to files

Post by Artie » Tue Mar 23, 2004 4:01 pm

CHR$(32) = space
CHR$(34) = "

:)

User avatar
scorpion
Newbie
Posts:8
Joined:Sun Mar 21, 2004 11:26 pm
Contact:

Re: writing quotes to files

Post by scorpion » Tue Mar 23, 2004 6:49 pm

thanx 4 correcting :)
....;D.....

John_Schofield
Full Member
Posts:36
Joined:Tue Mar 18, 2003 3:04 am
Location:Lancashire, UK
Contact:

Re: writing quotes to files

Post by John_Schofield » Wed Mar 24, 2004 2:26 am

At the risk of duplicating what's been stated abovve, here's a short chunk of code to illustrate, from my own program which does what you want to do:

PRINT #4, "<link rel="; CHR$(34); "stylesheet"; CHR$(34); " title="; CHR$(34); "Stylesheet"; CHR$(34); " href="; CHR$(34); "../home.css"; CHR$(34); ">"

PRINT #4, "</HEAD>"

PRINT #4, "<body background="; CHR$(34); "back.gif"; CHR$(34); ">"

PRINT #4, "<a name="; CHR$(34); "top"; CHR$(34); "</a>"

Guest

Re: writing quotes to files

Post by Guest » Wed Mar 24, 2004 12:54 pm

Hey guys,

Thnx a lot, I have built a nice foto gallery creator for myself!

Greetz,
Matthijs

Ralph
QBasic God
Posts:134
Joined:Sat Nov 06, 2004 2:27 am
Location:Katy, Texas

Re: writing quotes to files

Post by Ralph » Mon Nov 08, 2004 11:43 pm

John_Schofield wrote:At the risk of duplicating what's been stated abovve, here's a short chunk of code to illustrate, from my own program which does what you want to do:

PRINT #4, "<link rel="; CHR$(34); "stylesheet"; CHR$(34); " title="; CHR$(34); "Stylesheet"; CHR$(34); " href="; CHR$(34); "../home.css"; CHR$(34); ">"

PRINT #4, "</HEAD>"

PRINT #4, "<body background="; CHR$(34); "back.gif"; CHR$(34); ">"

PRINT #4, "<a name="; CHR$(34); "top"; CHR$(34); "></a>"
Am I wrong, or do I see a lot of html code, not the double quotation marks (") that I would expect???

ARalph
Ralph. Running QuickBASIC Version 4.5, Windows XP Home Edition, Version 2002, Service Pack 2, and HP LaserJet 4L printer.

John_Schofield
Full Member
Posts:36
Joined:Tue Mar 18, 2003 3:04 am
Location:Lancashire, UK
Contact:

er yes....

Post by John_Schofield » Fri Dec 24, 2004 12:11 am

well yes, there's html code - that's because the example is taken from a part of a program where I write a page of plain text with embedded html codes where double quotes are needed - once a file is open (file number 4) the text is printed to it and the double quotes then show up. No need to be a smart arse Ralph.

Post Reply