Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


how to split tha varchar input from user

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> how to split tha varchar input from user
  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 >>
 how to split tha varchar input from user - 7/9/2008 9:14:55 PM   
  aloktiwari

 

Posts: 3
Score: 0
Joined: 7/9/2008
Status: offline
hi all i m alok tiwari

i m workin on VBSCRIPT

i have user input AS "20yrs                       2mnth"

how to get that 20   and   2 saperatelly  using VB script

i want to get 20 year  and 2 month   saperatelly   coz i have to add that witha another date

so any body can healp me doin this using Javascript or vbscript



thanking you
 
 
Post #: 1
 
 RE: how to split tha varchar input from user - 7/9/2008 10:00:30 PM   
  ehvbs

 

Posts: 2078
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi aloktiwari,

use a regular expression like this:

>> Dim oRE : Set oRE = New RegExp
>> oRE.Pattern = "\d+"
>> oRE.Global = True
>> Dim sTest : sTest = "20yrs      2mnth"
>> Dim oMTS : Set oMTS = oRE.Execute( sTest )
>> Dim oMT
>> For Each oMT in oMTS
>>     WScript.Echo oMT.Value
>> Next
>>
20
2
>>

Good luck!

ehvbs

(in reply to aloktiwari)
 
 
Post #: 2
 
 RE: how to split tha varchar input from user - 7/10/2008 1:39:44 AM   
  aloktiwari

 

Posts: 3
Score: 0
Joined: 7/9/2008
Status: offline
thanks a lot for the healp


wt is "WScript"

coz whene i m runnign this code it's saying "object required near WScript

can u explin me that

(in reply to ehvbs)
 
 
Post #: 3
 
 RE: how to split tha varchar input from user - 7/10/2008 5:34:39 AM   
  ehvbs

 

Posts: 2078
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi aloktiwari,

"WScript.Echo" is a way to output data for use in standalone VBS scripts; think of it as a kind
of Response.Write (not entirely sure about that - I don't do ASP). The important part of my
posting was/is the regular expression.

>> Dim oMT
>> For Each oMT in oMTS
>>     WScript.Echo oMT.Value
>> Next

==>

>> Dim oMT, nNumber
>> For Each oMT in oMTS
>>     nNumber = CLng( oMT.Value )
>> Next

Better luck!

ehvbs

(in reply to aloktiwari)
 
 
Post #: 4
 
 RE: how to split tha varchar input from user - 7/11/2008 10:36:48 PM   
  aloktiwari

 

Posts: 3
Score: 0
Joined: 7/9/2008
Status: offline
thamks 4 the healp


can u tell me how to write javascript code inside vbscript code

rply as early as possible

(in reply to ehvbs)
 
 
Post #: 5
 
 RE: how to split tha varchar input from user - 7/14/2008 1:18:48 AM   
  webber123456

 

Posts: 37
Score: 0
Joined: 9/20/2007
Status: offline
http://www.asp101.com/tips/index.asp?id=111

(in reply to aloktiwari)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> how to split tha varchar input from user 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