|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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] |
|
#2
|
||||
|
||||
|
AFIAK the # sign is required in these statements.
|
|
#3
|
|||
|
|||
|
I don't mind the # sign in the code.
Its the speech marks I worry about. Or are the two related? |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
do you know there is an api to write in ini format? If you're interested I can provide some code.
|
|
#7
|
|||
|
|||
|
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!) |
|
#8
|
|||
|
|||
|
try this:
put your information in a variable info$ = "information" then Write #lngFile, info$ |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Writing to files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|