Solved

Writing to a file

Posted on 1998-12-11
5
145 Views
Last Modified: 2010-05-03
Is there a easy way to write to  a file (i.e. output.txt) without having every thing surrounded by quotes.  If i open the file as random then i'm stuck with records and data types...
I want to be able to take some text and put it in a file without quotation marks...  Is it possible...???
0
Comment
Question by:jtjcomp
[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
5 Comments
 
LVL 14

Accepted Solution

by:
waty earned 200 total points
ID: 1449535
  nFile = FreeFile
   Open sFile For Binary Access Write As #nFile

   Put #nFile, , "<DESTINATAIRE>" & NEW_LINE
   Put #nFile, , "<NOMD>" & gsUserNom & NEW_LINE
   Put #nFile, , "<PRENOMD>" & gsUserPrenom & NEW_LINE
   Put #nFile, , "<TITLE>" & gsUserTitle & NEW_LINE
   Put #nFile, , "<ETAGE>" & gsUserEtage & NEW_LINE
   Put #nFile, , "<BUREAU>" & gsUserBureau & NEW_LINE
   Put #nFile, , "<BATIMENT>" & gsUserBatiment & NEW_LINE
   Put #nFile, , "<FAX>" & gsUserFax & NEW_LINE
   Put #nFile, , "<PRINTGROUP>" & gsUserPrintGroup & NEW_LINE
   Put #nFile, , "</DESTINATAIRE>" & NEW_LINE

   Close #nFile
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1449536
Perhaps I may be able to help you on this one, but I'm not sure I understand your question - what is the significance of your remark "If you open the file as random then I'm stuck with records and data types..."

What exactly are you using this file for?

Regards,

Pino Carafa
0
 
LVL 4

Expert Comment

by:chabaud
ID: 1449537
Just open the file as text and use the print statement.

Open "output.txt" For Output As #1
print #1, "Hello world" & vbcrlf
close #1
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1449538
Yeah, standard sequential output uses quotes around the strings but the quotes themselves are *NOT* written to the file. If you have the text in a var *ONLY* the contents of the string is sent. No quotes.

M

0
 
LVL 1

Expert Comment

by:OeilNoir
ID: 1449539
if you want to increase the flexibility, if you either read or Write and don't want quotes and such, i think the best way would be with
"binary"

open "c:\file.ext" for binary as #1
put #1,, stringvariable
close #1


0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON Response and request in VB6 application 11 805
using Access 8 83
how to know if my Checkbox is True in VB6.0? 9 65
how to Classify of email (pdf attachments) 7 50
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

756 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