home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SOURCE / FUNCTION / KEYS.PRG < prev    next >
Text File  |  1994-06-04  |  590b  |  27 lines

  1. static aKeys    := {}
  2. static aActions := {}
  3.  
  4. //----------------------------------------------------------------------------//
  5.  
  6. function SetKey( nKey, bAction )
  7.  
  8.    local nAt := AScan( aKeys, nKey )
  9.  
  10.    if PCount() == 2
  11.       if nAt == 0
  12.          AAdd( aKeys, nKey )
  13.          AAdd( aActions, bAction )
  14.       else
  15.          aKeys[ nAt ]    = nKey
  16.          aActions[ nAt ] = bAction
  17.       endif
  18.    else
  19.       if nAt != 0
  20.          return aActions[ nAt ]
  21.       endif
  22.    endif
  23.  
  24. return nil
  25.  
  26. //----------------------------------------------------------------------------//
  27.