here is the problem that I am having. I have to log into a sun server and pull IP addresses for certain peices of equipment that are connetcted to that equipment. I then have to log into each peice of equipmetn to pull data from it. I would just create a static IP list but these IP's can and will be added to. Another issue is that each sun server is formatted a little differently so I did a capture for each sun server and am trying to recover the IP's from the capture file. I ahve the code to get to the appropriate line in the file and test it and when I get the first and last number number of the IP.
Here is the problem that I am having: I am using strgetc from the gets from the file and put that number into another variable then store it into an array so that I can do a group of logins at one time. When I am testing to see what is being stored in the first variable I notice that I am getting errorneous data apparently from memory in the variable at the same time that I am puting in the IP address numbers. I have tried renaming variables and I clear the variable right before I enter into the while func to use the strgetc and strputc. Any help would be appreciated.
Here is a snippet fo the code:
if fopen 0 file_name Read
statmsg "file %s is open", file_name
while not feof 0 fgets 0 File_Info
if strfind File_Info "EDGERTR"
if second >0 ;have to loop to second time it sees this toget the first IP
Imhere = 0
while Chr!=47
strgetc File_Info Pos Chr
if Chr==49 ;make sure have a 1
Tempstr = ""
while Chr != 47 ;character after last number is /
strputc Tempstr Imhere Chr
usermsg "RPM IP is %s", Tempstr
Pos++
Imhere++
strgetc File_Info Pos Chr
endwhile
endwhile
RPMIP[getnum] = Tempstr
usermsg "RPMIP array: %s", RPMIP[getnum]
endif
Pos++
endwhile
endif
if strcmp RPM_IP ""
else
getnum++
endif
second ++
endif
To go where no programmer has gone before.
Here is the problem that I am having: I am using strgetc from the gets from the file and put that number into another variable then store it into an array so that I can do a group of logins at one time. When I am testing to see what is being stored in the first variable I notice that I am getting errorneous data apparently from memory in the variable at the same time that I am puting in the IP address numbers. I have tried renaming variables and I clear the variable right before I enter into the while func to use the strgetc and strputc. Any help would be appreciated.
Here is a snippet fo the code:
if fopen 0 file_name Read
statmsg "file %s is open", file_name
while not feof 0 fgets 0 File_Info
if strfind File_Info "EDGERTR"
if second >0 ;have to loop to second time it sees this toget the first IP
Imhere = 0
while Chr!=47
strgetc File_Info Pos Chr
if Chr==49 ;make sure have a 1
Tempstr = ""
while Chr != 47 ;character after last number is /
strputc Tempstr Imhere Chr
usermsg "RPM IP is %s", Tempstr
Pos++
Imhere++
strgetc File_Info Pos Chr
endwhile
endwhile
RPMIP[getnum] = Tempstr
usermsg "RPMIP array: %s", RPMIP[getnum]
endif
Pos++
endwhile
endif
if strcmp RPM_IP ""
else
getnum++
endif
second ++
endif
To go where no programmer has gone before.