Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing a txt file

Status
Not open for further replies.

kruxty

Programmer
Joined
Jul 17, 2001
Messages
197
Location
PT
I'm writing into a txt file by append mode!
The problem is that when i'm writing, the string is append in front of the string with ""(e.g. oldtext "newtext")
Why does this happen?
How can i write in the next line and without ""
 
Write Quotes strings, Print does not.

Wil Mead
wmead@optonline.net

 
And how can i write this text without " " ?
 
errrrr... darn! Sorry for my mistake!
What i want to say is: "How can i write the text in the next line?"
 
well, if you want to write a file like:
(start of the file:)
hello hello
good bye
(end of file)

so you must open the file for binary, and when you want to change line put chR$(13) + chr$(10)

eg:

open "helo.txt" for binary as #1
j$ = "Hello!" + chr$(13) + chr$(10) + "This is line nº2)!"
put #1,1,j$
' |
' V
'Location on the file to write
 
I'm writing into a txt file by append mode!
The problem is that when i'm writing, the string is append in front of the string with ""(e.g. oldtext "newtext")
Why does this happen?
How can i write in the next line and without ""
NOT!

I do not know WHAT you are doing, but the standard "Open ... for Append" ALWAYS places the new text at the end of the 'file'. Your code is obviously flawed, but since you haven't actually posted the code (just your imagining of it?), no one can tell you what or where the problem lies. I can say the much / most / all of the preceeding posts are simply off target.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Errrmm....
NO

do it like this

'open , write to and close a file using append mode
Dim fileNumber as Integer

fileNumber=FreeFile

open "c:\file.txt" for append as #fileNumber
print #fileNumber, "new Text"
close #1


tryp
 
I would like to print in Preprinted form by spooling the data into a text file and then printing in the preprinted form. How to take a print without wasting too many preprinted forms for aligning purposes.I would like to know how many centimetres a space occupy
 
Two suggestions.

1.[tab]Xerox some of the pre-printed forms. Use the xeroxes for the initial tests.

2.[tab]just use a ruler to measure the top, left, Height and width of the fields on the preprinted forms. Set your control postitions according to this. Be careful of the margin settings for the printer (esp. Top and left), as these will offset every control.

After that, it is more a matter of tedious detail.

A totally alternative is to trash the preprints and just 'reconstruct' the form in the program and be done.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top