Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


working with strings

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> working with strings
  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 >>
 working with strings - 12/23/2004 6:34:03 AM   
  reeseslover531

 

Posts: 5
Score: 0
Joined: 12/23/2004
From: USA
Status: offline
I have function that I made that reads a text document and then puts it in a variable.

The text file has different lines on it, and if I display the string in a msgbox it shows the different lines.

Is it possible to set each line to a different string?

_____________________________

www.rootsmart.com
 
 
Post #: 1
 
 Re: working with strings - 12/23/2004 6:52:29 AM   
  drbelden

 

Posts: 109
Score: 0
Joined: 12/21/2004
From: USA
Status: offline
It sounds like you are using .ReadAll to read the entire document into one variable. You could go through a process to break this variable down, but it sounds like you may be better served by reading the file line by line and putting these lines into a variable.

Use .ReadLine to grab a line at a time.

(in reply to reeseslover531)
 
 
Post #: 2
 
 Re: working with strings - 12/23/2004 7:20:44 AM   
  reeseslover531

 

Posts: 5
Score: 0
Joined: 12/23/2004
From: USA
Status: offline
no i am not using Read All

Here is my code


      

(in reply to reeseslover531)
 
 
Post #: 3
 
 Re: working with strings - 12/23/2004 8:37:29 AM   
  drbelden

 

Posts: 109
Score: 0
Joined: 12/21/2004
From: USA
Status: offline
What is making it separate lines? Chr(13)?

Run this script and see if it does what you want. It takes a string and breaks it apart at a specified character such as a CR.


      

I got this example from http://juicystudio.com/tutorial/vb/strings.asp and modified it for vbs.

(in reply to reeseslover531)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> working with strings 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