home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / utilsu / wld / FDIAL.TXT < prev    next >
Text File  |  1992-05-04  |  2KB  |  43 lines

  1. Some comments on fdial.opl
  2. --------------------------
  3.  
  4. For more details, see the accompanying file WLD.DOC.
  5. Evidently, WLD.DOC is in a rather rough form, but you may still find
  6. some of its contents useful.  NB I do not personally believe all of
  7. the contents of WLD.DOC, but don't presently have the time to sort
  8. the untruth from the truth.
  9.  
  10. The main steps in fdial.opl are:
  11.     IOOPEN(h%,"WLD:",-1)
  12.     IOW(h%,11,#adno%,fr%())
  13.     while 1
  14.         IOW(h%,23,cdata%(),#0)
  15.         IOW(h%,13,fr%(),#0)
  16.     endwh
  17.  
  18. The IOW(... 11 ...) is a WR_FIND_COUNTRY to put the i/o channel to
  19. WLD: into "finding country mode", in which the effect of any
  20. subsequent WR_NEXT or WR_BACK is to nudge by country.  (The default
  21. is by city.)  Since the search string is null (this is the #adno%),
  22. the very first country in the database is found.
  23.  
  24. The IOW(... 23 ...) is a WR_GET_COUNTRY_DATA to get a WR_COUNTRY_DATA
  25. struct into cdata%().  There is no second parameter to this function
  26. so the final #0 is merely to prevent the translator whinging.
  27.  
  28. The IOW(... 13 ...) is a WR_NEXT, to nudge to the next country in the
  29. database.
  30.  
  31. The result of a WR_NEXT (or a WR_FIND_COUNTRY) is a WR_FIND_RES
  32. struct, which (see WLD.DOC) is 42 bytes long (ie 21 Opl integers). 
  33. The line of opl
  34.     adco%=addr(fr%()+21)
  35. positions the variable adco% to the beginning of where the country
  36. name part of this struct will be written.  The (rather laborious)
  37. routine GETZTS: is used to extract a C-style ZTS (zero terminated
  38. string).  (I would certainly re-write GETZTS: using OSs or CALLs if I
  39. wanted to improve the speed of fdial.)
  40.  
  41. The result of a WR_GET_COUNTRY_DATA is a WR_COUNTRY_DATA struct,
  42. which (see WLD.DOC) is 74 bytes long.
  43.