| 发表于:2007-03-29 21:18:163楼 得分:0 |
option explicit private sub form_load() dim thiscode as long dim thiscity as string getcity thiscode, thiscity 'thiscity 为所求的城市 end sub private sub getcity(thiscode as long, thiscode as string) dim code() as long dim city() as string dim citybyte() as byte dim citybyte() as byte open "code.dat " for binary as #1 redim citybyte(n) 'code 的数量 -1 get #1, , citybyte close #1 open "city.dat " for binary as #1 redim citybyte(n) ' city 的数量 -1 get #1, , citybyte close #1 code = split(citybyte, " ¦ ") city = split(citybyte, " ¦ ") dim i as long for i = lbound(citybyte) to ubound(citybyte) if city(i) = thiscode then thiscode = city(i) exit for end if next end sub | | |
|