Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : OOPMENU.ZIP
Filename : ALT2ALPH.PRG

 
Output of file : ALT2ALPH.PRG contained in archive : OOPMENU.ZIP
/*
Alt2Alpha.prg

Copyright (c) Anton van Straaten 1991, 1992

Converts Clipper keyboard code for alpha alt key to its ASCII alpha
equivalent, eg. ALT-A to A. Note that the static cannot be initialized
inline because the compiler doesn't like the chr() argument being greater
than 255.

Since the actual values generated by CHR() are less than 255, we compare
the incoming value against K_ALT_Q, which is the smallest alpha alt key
value. This prevents an ordinary character from being found in the table.
*/

#include "inkey.ch"

FUNCTION alt2alpha(nKey)
STATIC altKeys
LOCAL nPos

IF altKeys == NIL
altKeys := CHR(K_ALT_A) + CHR(K_ALT_B) + CHR(K_ALT_C) + CHR(K_ALT_D) + ;
CHR(K_ALT_E) + CHR(K_ALT_F) + CHR(K_ALT_G) + CHR(K_ALT_H) + ;
CHR(K_ALT_I) + CHR(K_ALT_J) + CHR(K_ALT_K) + CHR(K_ALT_L) + ;
CHR(K_ALT_M) + CHR(K_ALT_N) + CHR(K_ALT_O) + CHR(K_ALT_P) + ;
CHR(K_ALT_Q) + CHR(K_ALT_R) + CHR(K_ALT_S) + CHR(K_ALT_T) + ;
CHR(K_ALT_U) + CHR(K_ALT_V) + CHR(K_ALT_W) + CHR(K_ALT_X) + ;
CHR(K_ALT_Y) + CHR(K_ALT_Z)
ENDIF

nPos := IF( nKey >= K_ALT_Q, AT( CHR( nKey ), altKeys ), 0 )

RETURN IF( nPos == 0, "", CHR( ASC( "A" ) + nPos - 1) )


// eof alt2alpha.prg


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : OOPMENU.ZIP
Filename : ALT2ALPH.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/