Reading Variables 
Author Message
 Reading Variables

i need some help with reading information (string) in variables. in my case
the scenario will be that i have an ip address written into a variable. i
then want to be able to read that variable character by character until i
find the first full stop in the ip address, thus giving me the first segment
of the address. i am fairly new to VBScript, and can't quite find how to do
this. thanks.


Thu, 20 Nov 2003 00:54:32 GMT  
 Reading Variables
--
Hi

Use the inStr string function for simple matches
for more complex matches it is better to use a regular expression object

Thanks

Santhosh Maruthi
---------------------------------------------------------
Fortune Favours The Prepared Mind
---------------------------------------------------------

Quote:
> i need some help with reading information (string) in variables. in my
case
> the scenario will be that i have an ip address written into a variable. i
> then want to be able to read that variable character by character until i
> find the first full stop in the ip address, thus giving me the first
segment
> of the address. i am fairly new to vbscript, and can't quite find how to
do
> this. thanks.



Thu, 20 Nov 2003 19:57:02 GMT  
 Reading Variables
Hey Val,

Try this, it splits it up for ya:
dim ipaddress

ipaddress = "192.168.101.120"
newarray = split(ipaddress,".")

for i = 0 to ubound(newarray)
 wscript.Echo newarray(i)
next

J.Dobson.


Quote:
> i need some help with reading information (string) in variables. in my
case
> the scenario will be that i have an ip address written into a variable. i
> then want to be able to read that variable character by character until i
> find the first full stop in the ip address, thus giving me the first
segment
> of the address. i am fairly new to vbscript, and can't quite find how to
do
> this. thanks.



Mon, 24 Nov 2003 12:58:05 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Reading Variables from a text file

2. Reading variable length records

3. Read variables from text files?

4. binary read /variable conversion

5. Reading variables in from a file

6. Reading Variables

7. Reading variables from a file

8. Reading variables from another child form

9. Reading variables from other applications

10. Read variable data

11. Reading variables from a file

 

 
Powered by phpBB® Forum Software