OK, so you got my confidence up... well just a little. The way I look at it, this is what needs to be done:
1. With readline() parse for all the headings. That part's not too tough.
code:

IF OPEN(1, "C:\kix\rasphone.pbk") = 0
$cl = ReadLine(1)
WHILE @ERROR = 0
if SUBSTR($cl, 1, 1) = "["
? "$cl =" $cl ;put your code here
ENDIF
$cl = ReadLine(1)

LOOP
ENDIF
$ = CLOSE(1)
get $



2. You've got to put these headings into variables. Since there are likely to be more than one heading, I'm thinking a two dimensional array is needed. The first dimension for the header name and the second for the instance (loop count). This is where my limit is reached. I don't know how to do the two dimensional array.

3. Once you're there, you query each header section for 'PhoneNumber' with ReadProfileString().

code:

$header = "NameOfHeader" ;put your code here
$dev = ReadProfileString("C:\kix\rasphone.pbk", $header, "PhoneNumber")
If @ERROR = 0
? "PhoneNumber = " + $dev " ;put your code here

Endif
get $



4. Now do a SUBSTR() function to test for the number. Hey, wait a minute, I'm lazy. It'd be the same as my first example, only different.

5. G O T ... T O ... F I G H T ... T H E ... U R G E ... T O ... P R O G R A M ...

The rest I leave to you or someone else.

This is a slight departure from my first outline because I realized there may be more than one heading with the same base number. On my PC, there were several. One from the office, one from home, one from out-of-town, etc., all with a different dialing prefix.

Actually, I maybe over-simplified it just a bit. The very first thing you need to do is locate the rasphone.pbk file. Depending on OS and design, they could be per user or 'All Users'. On my Win2k, it resides in C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\. But then again, what you intend to do with the results is probaably no cake walk either.

[ 24 August 2001: Message edited by: LLigetfa ]

[ 24 August 2001: Message edited by: LLigetfa ]

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.