home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / utilsu / wld / FDIAL.OPL next >
Text File  |  1992-03-17  |  999b  |  63 lines

  1. PROC fdial:
  2.     LOCAL h%
  3.     LOCAL fr%(21),adco%
  4.     LOCAL astate%
  5.     LOCAL nul$(4),adno%
  6.     LOCAL country$(22),cbeg$(1)
  7.     LOCAL cdata%(37),addial%
  8.     LOCAL cdial$(18)
  9.     LOCAL line%
  10.     IOOPEN(h%,"WLD:",-1)
  11.     nul$=""
  12.     adno%=addr(nul$)+1
  13.     IOW(h%,11,#adno%,fr%())
  14.     adco%=addr(fr%())+21
  15.     astate%=0
  16.     addial%=addr(cdata%())+56
  17.     line%=0
  18.     while 1
  19.         getzts:(addr(country$),adco%)
  20.         cbeg$=upper$(left$(country$,1))
  21.         if astate%=0
  22.             if cbeg$<>"A"
  23.                 astate%=1
  24.             endif
  25.         else
  26.             if cbeg$="A"
  27.                 break
  28.             endif
  29.         endif
  30.         if line%=8
  31.             print "Press any key to continue"
  32.             get
  33.             line%=0
  34.         endif
  35.         line%=line%+1
  36.         IOW(h%,23,cdata%(),#0)
  37.         getzts:(addr(cdial$),addial%)
  38.         print country$,"(";cdial$;")"
  39.         IOW(h%,13,fr%(),#0)
  40.     endwh
  41.     print "End of database"
  42.     get
  43. ENDP
  44.  
  45. PROC getzts:(out%,in%)
  46.     LOCAL o%,i%,b%,l%
  47.     o%=out%+1
  48.     i%=in%
  49.     l%=0
  50.     while 1
  51.         b%=PEEKB(i%)
  52.         if b%
  53.             POKEB o%,b%
  54.             l%=l%+1
  55.             o%=o%+1
  56.             i%=i%+1
  57.         else
  58.             POKEB out%,l%
  59.             return
  60.         endif
  61.     endwh
  62. endp
  63.