Solved

write #1, <HTML> produces error

Posted on 2000-03-23
7
149 Views
Last Modified: 2010-05-02
This should be pretty easy, but I just can't seem to figure it out!

I am writing to a file, and the content is HTML.  However, when I try to write an HTML tag, I get an error unless I put it in quotes.  The problem?  The quotes get written to the file as well.

Here is an example

write #1, <HTML>

this produces an error (waiting for expression).  So I do this

write #1, "<HTML>"

this eliminates the error, but the quotes also get written to the file.

I tried using the \ escape character, but that didn't work either.  Any ideas?

Thanks
0
Comment
Question by:kprestage
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 25 total points
ID: 2649208
Try this instead:

print #1, "<HTML>"


Cheers!®©
0
 
LVL 3

Expert Comment

by:Gordonp
ID: 2649211
USing Write, places delimeters, around your entries to specify it as text.

Use Put rather than write, to avoid the quotations

ie  

Put #1, "<HTML>"

your file would read

<HTML>

Gordon


0
 
LVL 7

Expert Comment

by:Vbmaster
ID: 2649215
Instead of the Write statement you should use Print...

   Print #1, "<HTML>"
   (this one will write <HTML> to the file and add new line character)

or

   Print #1, "<HTML>";
   (this one will write <HTML> to the file, next Print statement will continue
   directly after the text)

More info can be found in your helpfile.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:Gordonp
ID: 2649216
actually that should be

Put #1,,"<HTML>

0
 
LVL 3

Expert Comment

by:Gordonp
ID: 2649231
Gordonp changed the proposed answer to a comment
0
 
LVL 9

Author Comment

by:kprestage
ID: 2649255
Thanks for everyone's input, they all worked, so I just had to pick the first one.  I Appreciate the help!
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2649288
Thanks for the points! Glad I could help!


Cheers!®©
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to Add / Edit Windows Menu 4 80
Prevent user closing word document opened with VB6 6 88
Macro Excel - Multiple If conditions 2 93
RUNRMTCMD from AS/400 13 126
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question