Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Garbage characters in files created with VBScript

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,2742
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Garbage characters in files created with VBScript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Garbage characters in files created with VBScript - 4/19/2005 2:41:02 PM   
  asserm

 

Posts: 2
Score: 0
Joined: 4/19/2005
From:
Status: offline
Hello,

I'm new to vbscript and asp. I'm trying to take information that a user provides in an html text field and write it to a file on the unix backend filesystem.

The file is created fine with the data, but sometimes I get garbage characters at the beginning of the text file.

Can someone please tell me what I may be doing wrong? Basically my code is as follows...

Initialize variables.
Construct a very long string (about 3k)
Get FileSystemObject
CreateTextFile for writing
Write the very long string to file
Close file

Any help greatly appreciated! Thanks!
 
 
Post #: 1
 
 Re: Garbage characters in files created with VBScript - 4/19/2005 3:09:10 PM   
  VBS

 

Posts: 110
Score: 0
Joined: 3/2/2005
From: Lebanon
Status: offline
Dear asserm,
Try spliting the very long string into several variables, (use Arrays as an example) and then put them into the file.
It might work.


Hope this helps.



Best Regards
Firas S Assaad

(in reply to asserm)
 
 
Post #: 2
 
 Re: Garbage characters in files created with VBScript - 4/25/2005 11:11:53 AM   
  asserm

 

Posts: 2
Score: 0
Joined: 4/19/2005
From:
Status: offline
Thanks!! That worked perfectly. Apparently vbscript does not properly handle writing a string that is longer than 1024 (1K) characters to a file in one shot. I had used a while loop and the mid function to write the string to the file 500 characters at a time.

That did the trick!

Thanks again.

(in reply to asserm)
 
 
Post #: 3
 
 Re: Garbage characters in files created with VBScript - 4/26/2005 1:05:03 AM   
  VBS

 

Posts: 110
Score: 0
Joined: 3/2/2005
From: Lebanon
Status: offline
Your most welcome
Any time

(in reply to asserm)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Garbage characters in files created with VBScript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts