R
richard
Below is a simple code I am using to generate a list of zip codes by
states.
I have the states arranged in the left column.
Zipcodes in the right column.
If you do programming with php or javascript you probably understand
most of it.
items in [ ] are called branch labels. They replace line numbers.
cls - clear screen
div - creates a division.
First, I create an array that contains all the states and each state
is numbered. This is all printed to the screen in leftcol.
link - creates an anchor tag. The structure basically says "create
this link giving it the id of #uniquename, using the text to be
underlined and sending it to this destination".
EventKey$ - traps which link was clicked on.
Similar to onclick.
A second array contains the zip codes and city names.
That gets printed in rightcol.
If you click on say "Alabama", that list is printed in rightcol.
If you then click on "Kentucky", Alabama's list is erased and replaced
with Kentucky.
ek$ = ""
[start]
cls
div leftcol
for i = 1 to 50
st$ = "#st" + right$("0" + str$(i), 2)
text$ = st$(i)
link #st$, text$,[Display]
print
next i
end div
div rightcol
div newstate
v=val(ek$)
print azip$(v,1)
for n=3 to 70
if azip$(v,n)>"" then
lk$="#"+azip$(v,2)+"01"
text$=azip$(v,n)
link #lk$, text$, [display]
print
end if
next n
end div
end div
wait
[Display]
ek$=EventKey$
ek$=right$(ek$,2)
goto [start]
states.
I have the states arranged in the left column.
Zipcodes in the right column.
If you do programming with php or javascript you probably understand
most of it.
items in [ ] are called branch labels. They replace line numbers.
cls - clear screen
div - creates a division.
First, I create an array that contains all the states and each state
is numbered. This is all printed to the screen in leftcol.
link - creates an anchor tag. The structure basically says "create
this link giving it the id of #uniquename, using the text to be
underlined and sending it to this destination".
EventKey$ - traps which link was clicked on.
Similar to onclick.
A second array contains the zip codes and city names.
That gets printed in rightcol.
If you click on say "Alabama", that list is printed in rightcol.
If you then click on "Kentucky", Alabama's list is erased and replaced
with Kentucky.
ek$ = ""
[start]
cls
div leftcol
for i = 1 to 50
st$ = "#st" + right$("0" + str$(i), 2)
text$ = st$(i)
link #st$, text$,[Display]
next i
end div
div rightcol
div newstate
v=val(ek$)
print azip$(v,1)
for n=3 to 70
if azip$(v,n)>"" then
lk$="#"+azip$(v,2)+"01"
text$=azip$(v,n)
link #lk$, text$, [display]
end if
next n
end div
end div
wait
[Display]
ek$=EventKey$
ek$=right$(ek$,2)
goto [start]