Post by rich357 on Mar 24, 2009 2:02:25 GMT -5
Finally got it done. Published it for local use and it works just fine.
A tad slow maybe but works.
For the required text file go here:
1littleworld.net/zip3.txt
So tomorrow I'll put it up online and you can see how it works.
A tad slow maybe but works.
For the required text file go here:
1littleworld.net/zip3.txt
So tomorrow I'll put it up online and you can see how it works.
dim zip$(60,70)
dim state$(60)
dim astack$(200)
dim bstack$(200)
global doit
cssclass "a","{color:#000;}"
cssclass "a:hover","{color:#00f;}"
cssid #ahold,"{width:3in; height:auto; overflow:auto; background:#FFFF7d; color:#000;
padding:10px; font-size:14pt; float:left;}"
cssid #bhold,"{width:2.7in; height:2in; overflow:auto; background:#8BFFC8; color:#000;
padding:10px; font-size:14pt;}"
cssid #chold,"{width:6.5in; height:6in; overflow:auto; float:left; margin-left:1em;; background:#9EFF96; color:#000;}"
cssid #blist,"{padding:15px;}"
[loadfile]
open "public\zip3.txt" for input as #1
a=1
b=0
while eof(#1)=0
line input #1,x$
if x$="END" then
a=a+1
b=0
goto [skip]
end if
b=b+1
zip$(a,b)=x$
state$(a)=zip$(a,1)
[skip]
wend
close #1
[start]
call doStates
wait
[level2]
cls
ek$=EventKey$
ek$=right$(ek$,2)
doit=val(ek$)
div ahold
for n=1 to 50
st$=state$(n)
ky$="st0"+str$(n)
link #one,st$,[level2]
#one setkey(ky$)
print
if n=doit then call doZip
next n
end div
wait
[level3]
cls
div ahold
for n=1 to 50
st$=state$(n)
ky$="st0"+str$(n)
link #one,st$,[level2]
#one setkey(ky$)
print
if n=doit then call doZip
next n
end div
div chold
fin$=EventKey$
open "public\zip3\";fin$;".txt" for input as #2
html "<table border=1>"
html "<tr><td>Company</td><td>City</td><td>Zip Code</td><td>US DOT</td><td>Units</td><td>Drivers</td><td></tr>"
while eof(#2)=0
line input #2,x$
html "<tr>"
w$=word$(x$,1," | ")
html "<td>";w$;"</td>"
w$=word$(x$,2," | ")
html "<td>";w$;"</td>"
w$=word$(x$,3," | ")
html "<td>";w$;"</td>"
w$=word$(x$,4," | ")
html "<td>";w$;"</td>"
w$=word$(x$,5," | ")
html "<td>";w$;"</td>"
w$=word$(x$,6," | ")
html "<td>";w$;"</td>"
html"</tr>"
wend
html "</table>"
close #2
end div
wait
[subroutines]
sub doStates
div ahold
for n=1 to 50
st$=state$(n)
ky$="st0"+str$(n)
link #one,st$,[level2]
#one setkey(ky$)
print
next n
end div
end sub
sub doZip
print
div bhold
for n=3 to 70
if zip$(doit,n)="" then exit for
link #zap, zip$(doit,n),[level3]
ky$="zip"+left$(zip$(doit,n),3)
#zap setkey(ky$)
print
next n
end div
print
end sub