home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a013 / 1.ddi / SOURCE.EXE / F_AEDMSG.PRG < prev    next >
Encoding:
Text File  |  1991-01-25  |  2.5 KB  |  87 lines

  1. *****************************************************************
  2. FUNCTION AEDMSG (msg_id, new_color)
  3. *****************************************************************
  4.  
  5. * Display a message in the AEDBAR menu window
  6.  
  7. * Copyright(c) 1991 - James Occhiogrosso
  8.  
  9. # define UPARROW CHR(24)
  10. # define DNARROW CHR(25)
  11. # define RARROW  CHR(26)
  12. # define LARROW  CHR(27)
  13.  
  14. LOCAL old_color, message
  15.  
  16. * Check that AEDBAR is in use before displaying message
  17.  
  18. IF TYPE("aedbar") != 'L'
  19.     RETURN(.F.)
  20. ELSEIF .NOT. aedbar
  21.     RETURN(.F.)
  22. ENDIF
  23.  
  24. * If color string passed, use it. Otherwise, default
  25. * to window color.
  26.  
  27. old_color = IF(new_color = NIL, SETCOLOR(colwindow),  ;
  28.                                 SETCOLOR(new_color)   )
  29.  
  30. IF TYPE('aed_row') != 'N'
  31.     * AEDBAR row variable undefined. Default to bottom row
  32.     aed_row = MAXROW()
  33. ENDIF
  34.  
  35. * If prefixed by 'mw_', it is a message identifier. Set it to 
  36. * lower case for processing. Otherwise, display passed string
  37. * without changes.
  38.  
  39. IF LOWER(SUBSTR(msg_id,1,3)) = 'mw_'
  40.     msg_id = LOWER(msg_id)
  41. ENDIF
  42.  
  43. * Determine choice and save in message variable
  44.  
  45. IF msg_id = 'mw_bof'
  46.      message =  ' ════════ Start of file ═══════ '
  47. ELSEIF msg_id = 'mw_dupkey'
  48.      message =  ' Duplicate key - reenter? Y/N '
  49. ELSEIF msg_id = 'mw_entval'
  50.      message =  ' Enter value (or blank to exit) '
  51. ELSEIF msg_id = 'mw_eof'
  52.      message =  ' ═════════ End of file ════════ '
  53. ELSEIF msg_id =     'mw_init'
  54.      message =  ' ' + LARROW + ' ' + RARROW + ' to select, ' ;
  55.                 + ' ' + UPARROW + ' ' + DNARROW + ' to browse '
  56. ELSEIF msg_id = 'mw_memo'
  57.      message =  ' Ctrl-Enter to Save, F2 for keys'
  58. ELSEIF msg_id = 'mw_nosave'
  59.      message =  ' Insufficient data - aborted '
  60. ELSEIF msg_id = 'mw_pgdn'
  61.      message =  ' PgDn=Save,  Esc=Quit,  F1=Help '
  62. ELSEIF msg_id = 'mw_recadd'
  63.      message =  ' Adding record '
  64. ELSEIF msg_id = 'mw_recrepl'
  65.      message =  ' Replacing record '
  66. ELSEIF msg_id = 'mw_reqd'
  67.      message =  ' Data is required. Please redo.'
  68. ELSEIF msg_id = 'mw_view'
  69.      message =  ' ' + UPARROW + ' ' + DNARROW + ;
  70.                 ' to browse, or Esc to exit '
  71. ELSEIF .NOT. EMPTY(msg_id)
  72.      * If message is undefined, display first 32 characters
  73.      message =  SUBSTR(msg_id, 1, 32)
  74. ELSE
  75.      * Otherwise, clear window
  76.      message = SPACE(32)
  77. ENDIF
  78.  
  79. * Display message and return.
  80.  
  81. @ aed_row, 48 CLEAR TO aed_row, 79
  82. @ aed_row, 48 + (31-LEN(message))/2 SAY message
  83.  
  84. SETCOLOR(old_color)
  85. RETURN .T.
  86. *
  87.