Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


New to VBscript, need HELP!

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> New to VBscript, need HELP!
  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 >>
 New to VBscript, need HELP! - 6/28/2006 8:27:49 PM   
  bodd

 

Posts: 1
Score: 0
Joined: 6/28/2006
Status: offline
Hi there!
I'm stuck with my script and need help. The script read a value from a textfile and increase it +1, but there is one problem. It's increase the value to 10 but then it goes back to 2 instead of 11. It seems to just read the first digit. I need it to increase "endless" (at least handle and increase 5 digit numbers) :-)
Does anyone have a clue how to solve this?

Thankful for any...

< Message edited by bodd -- 6/28/2006 8:49:02 PM >
 
 
Post #: 1
 
 RE: New to VBscript, need HELP! - 6/28/2006 11:06:34 PM   
  mbouchard


Posts: 1922
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Post what you have.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to bodd)
 
 
Post #: 2
 
 RE: New to VBscript, need HELP! - 6/28/2006 11:45:59 PM   
  sabfeer

 

Posts: 7
Score: 1
Joined: 6/11/2006
From: Uzbekistan
Status: offline
Code is sputid. but i am beginner. Working. Create text file (myfile.txt) and write any number there & Save & Close. Run script. Script was read number and greating it.

      

(in reply to bodd)
 
 
Post #: 3
 
 RE: New to VBscript, need HELP! - 6/29/2006 12:21:37 AM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
Hmmm...it is working just fine for me.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to sabfeer)
 
 
Post #: 4
 
 RE: New to VBscript, need HELP! - 6/29/2006 10:36:41 AM   
  dm_4ever


Posts: 2721
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Try the following:

Set fso=CreateObject("Scripting.FileSystemObject")
Set oFile=fso.OpenTextFile("myfile.txt", 1)

fLine = oFile.ReadLine
fline = CInt(fline) 'this line is not in your original

Set oFile=Nothing
Set oFile=fso.OpenTextFile("myfile.txt", 2)

Do While fLine < 13
fLine=fLine+1
Loop

oFile.WriteLine fLine
oFile.Close

(in reply to sabfeer)
 
 
Post #: 5
 
 
 
  

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 >> New to VBscript, need HELP! 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