Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 14th, 2003, 11:39 AM
K-TC K-TC is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: England
Posts: 12 K-TC User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to K-TC Send a message via AIM to K-TC Send a message via Yahoo to K-TC
Question Writing to files

Hello, DevShed.

Currently I am writing a program which reads a text file and sets it out in the form of an INI file. So that my PHP can read it (but thats another story). I use this kind of code to write to a file at the moment:

Dim lngFile as long
Open *filename* For Append As #lngFile
Write #lngFile, "Information here"
Close #lngFile

The output in the file is this:
"Information here"

My problem is that I don't want the speech marks in there. Is there anyway I can get rid of these speech marks?

Thank you.

[edited due to mistake]

Reply With Quote
  #2  
Old March 14th, 2003, 12:33 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,163 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 6 Days 1 h 34 m 20 sec
Reputation Power: 791
AFIAK the # sign is required in these statements.

Reply With Quote
  #3  
Old March 14th, 2003, 01:23 PM
K-TC K-TC is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: England
Posts: 12 K-TC User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to K-TC Send a message via AIM to K-TC Send a message via Yahoo to K-TC
I don't mind the # sign in the code.

Its the speech marks I worry about.

Or are the two related?

Reply With Quote
  #4  
Old March 14th, 2003, 01:36 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,163 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 6 Days 1 h 34 m 20 sec
Reputation Power: 791
speech marks? Please explain what you mean. Are you refering to quotes? If so then they are required if you are putting a constant in, but not a variable.
i.e.
Code:
dim fp as Long
dim filename as String
dim tmpVar as String

filename = "C:\test.ini"
tmpVar = "Some variable text"
fp = FreeFile

Open filename for Append as #fp
Print #fp, "Some constant text"
Print #fp, tmpVar
Close #fp

Reply With Quote
  #5  
Old March 14th, 2003, 03:26 PM
K-TC K-TC is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: England
Posts: 12 K-TC User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to K-TC Send a message via AIM to K-TC Send a message via Yahoo to K-TC
Thank you!

It was the Write that was the problem.

I just needed Print.

Last edited by K-TC : March 14th, 2003 at 03:38 PM.

Reply With Quote
  #6  
Old March 14th, 2003, 04:26 PM
hedge hedge is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2002
Posts: 693 hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 4 h 5 m 20 sec
Reputation Power: 25
do you know there is an api to write in ini format? If you're interested I can provide some code.

Reply With Quote
  #7  
Old March 14th, 2003, 04:48 PM
K-TC K-TC is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: England
Posts: 12 K-TC User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to K-TC Send a message via AIM to K-TC Send a message via Yahoo to K-TC
Thank you hedge, but I know about those Apis.

I just wanted an alternate way of doing it.

Its useful to know .

Thank you anyway.

(You people are great!)

Reply With Quote
  #8  
Old March 31st, 2003, 09:40 PM
Darryl Darryl is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Mississippi
Posts: 3 Darryl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try this:

put your information in a variable

info$ = "information"

then

Write #lngFile, info$

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Writing to files

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap