Hi all!
I made a batch file to use the ipconfig (windows app) to make a .txt file and I'm trying to read this file in DBP...
the file :
Windows 2000 IP Configuration
Host Name . . . . . . . . . . . . : proteus1935
Primary DNS Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Broadcast
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : SiS 900 PCI Fast Ethernet Adapter
Physical Address. . . . . . . . . : 00-50-EB-05-40-C9
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.0.22
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 192.168.0.1
192.168.1.1
I've also made a little function that clears the spaces in a string:
function killsps(st$)
temp$ = "" : final$ = "" : sl = 0
sl = len(st$)
for t = 0 to sl-1
st$ = right$(st$,sl-t)
temp$ = left$(st$,1)
if temp$ <> " " then final$ = final$ + temp$
next t
endfunction final$
But when I read the strings from the file something weird happens :
open to read 1,"info.ip": rem opens the file created by my batch...
dim ips$(10): ip = 1 : rem creates an array to store all avaiable ips
do
temp_string$ = "" :
if file end(1) = 1 then exit
read string 1,temp_string$ : print temp_string$
temp_string$ = lower$(killsps(temp_string$)) : print temp_string$
print left$(temp_string$,3)
if "ipa" = left$(temp_string$,3) then ips$(ip)= RIGHT$(temp_string$,12): inc ip : print "GOT IP"
wait key
loop
close file 1
When getting the "left$(temp_string$,3)" out of a text line , the dotted (. . . . . . . .) lines only return 2 chars while non-dotted return the requested 3 chars from the left...
Any ideas?
thks
Currently coding: 3d-2d latitude/longitude
Recent coding: elliptical orbits
Proteus