home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / MNUPATCH.OPL < prev    next >
Text File  |  1993-03-22  |  1KB  |  48 lines

  1. This file will hopefully help OPL programmers to avoid a bug in the
  2. OPL 'MENU' routine, which allocates itself memory that doesn't get
  3. released properly. I don't know whether it clears itself when
  4. the program terminates, or whether the allocated memory stays
  5. around until the next soft reboot, but the patch is still worth
  6. using in your programs, there's no point in making trouble for
  7. yourself when you know the cure ...
  8.  
  9. proc main:
  10.  
  11.  global pt1&(7),pt2&(7),pt3&(8) rem patch arrays
  12.  
  13.  rem load up MENU patch
  14.  ptinit:
  15.  
  16. endp
  17.  
  18.  
  19. PROC PtInit:
  20.     REM menu patch machine code
  21.         REM (C) Psion UK PLC
  22.  
  23.     Pt1&(1) = &8BF88BFC
  24.     Pt1&(2) = &8B00121E
  25.     Pt1&(3) = &778B205F
  26.     Pt1&(4) = &E42AAC0C
  27.     Pt1&(5) = &A5ABC88B
  28.     Pt1&(6) = &75C084AC
  29.     Pt1&(7) = &CBF8E2FB
  30.     Pt2&(1) = &00B4F08B
  31.     Pt2&(2) = &FC808BCD
  32.     Pt2&(3) = &AD0D7330
  33.     Pt2&(4) = &C932D08B
  34.     Pt2&(5) = &CDD88BAD
  35.     Pt2&(6) = &F8754ACF
  36.     Pt2&(7) = &CB
  37. ENDP
  38.  
  39.  
  40. /// And, where you'd normally call MENU ... ///
  41.  
  42.  REM use menu patch around call to menu
  43.  USR(ADDR(PT1&(1)),ADDR(PT3&(1)),0,0,0)
  44.  k% = MENU
  45.  USR(ADDR(PT2&(1)),ADDR(PT3&(1)),0,0,0)
  46.  
  47. That's all folks!
  48.