Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 03-09-2004, 07:40 AM   #1 (permalink)
Good enough to f*ck your mother...
 
furious's Avatar
 
Location: Constant State Of Denial
[VBScript] Parsing a string for number

Ok its late here and im having a retard moment.

In Javascript there is the parseInt function which returns a number from a string.

eg: aString = "hi im 18 years old" using parseInt would give me 18

Is there a similar thing in VBScript of taking a integer/double etc from a string?

Thanks to anyone who took time to view this...
__________________

«Ex Pr0n Special Forces Sgt Looking for Mercenary Work in Liberation Army»

«Can provide references»
furious is offline  
Old 03-09-2004, 10:33 PM   #2 (permalink)
Upright
 
You can try using CInt("18") - I'm not 100% sure if it'll work/extract the nubmer from the string though.
mgcloud is offline  
Old 03-12-2004, 05:25 AM   #3 (permalink)
Psycho
 
There's no equivalent in vbscript. You could use the Split function to separate the sentence into words, then loop through the array and use the IsNumeric function on each word.
wondash is offline  
Old 03-14-2004, 06:55 PM   #4 (permalink)
Good enough to f*ck your mother...
 
furious's Avatar
 
Location: Constant State Of Denial
Nice one!

I knew i had done it somehow before.... and using the split then isNumeric method was the way i did it!@

I think this could very well be a definitive sign that partying does kill the brain cells.

Thanks wondash.
__________________

«Ex Pr0n Special Forces Sgt Looking for Mercenary Work in Liberation Army»

«Can provide references»
furious is offline  
Old 03-17-2004, 02:42 PM   #5 (permalink)
Everything's better with bacon
 
SaltPork's Avatar
 
Location: In your local grocer's freezer.
Quote:
Originally posted by mgcloud
You can try using CInt("18") - I'm not 100% sure if it'll work/extract the nubmer from the string though.
doesn't that only convert a string to an integer? I think that would fail.
__________________
It was like that when I got here....I swear.
SaltPork is offline  
 

Tags
number, parsing, string, vbscript


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 09:08 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54