home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / FINDFIE2.TXT < prev    next >
Text File  |  1994-06-03  |  1KB  |  38 lines

  1. ==========
  2. psion/opl #1225, from psioncorp, 1153 chars, May 31 10:15 94
  3. Comment to 1223. Comments. 
  4. ----------
  5. FINDFIELD in fact has two bugs:
  6.  
  7. 1. The flags% argument is documented incorrectly in that the nibbles of the lo-
  8. byte are in the opposite order. ie. the case dependent/independent value 0 or -
  9. must be multiplied by 16 (hex $00 or $10), while the direction value 0,1,2 or -
  10. should be used directly. The allowed values are therefore 0,1,2,3,16,17,18,19 -
  11.  
  12. (hex $00,$01,$02,$03,$10,$11,$12 and $13).
  13.  
  14. 2. FINDFIELD actually does FIND unless the byte at address peekw($1c )+7 
  15. happens to be zero! Therefore a temporary fix is to use:
  16. pokeb(peekw($1c)+7),0
  17. immediately before calling FINDFIELD.
  18.  
  19. NB pokeb peekw($1c)+7,0 must be called *immediately* before *every* 
  20. call to FINDFIELD.This is because that address is a "scratch register" used by-
  21.  
  22. the OPL runtime for many things.
  23.  
  24. This also means, in fact, that you must not use procedures or functions of any-
  25.  
  26. kind for arguments to FINDFIELD because they could change that address. eg. 
  27. pokeb ... :FINDFIELD(a$,s%:,GET,2) will fail. Always use constants, parameters-
  28. variables (array elements too), fields or arithmetical expressions based on 
  29. these for FINDFIELD arguments.
  30.  
  31. Dave (psioncorp)
  32.  
  33.  
  34.