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