/************************************************************************ * "Epsilon", "EEL" and "Lugaru" are trademarks of Lugaru Software, Ltd. * * * * Copyright (C) 1985, 1990 Lugaru Software Ltd. All rights reserved. * * * * Limited permission is hereby granted to reproduce and modify this * * copyrighted material provided that the resulting code is used only in * * conjunction with Lugaru products and that this notice is retained in * * any such reproduction or modification. * ************************************************************************* * The previous copyright and trademark notice applies to some of the * * code herein. All other changes, enhancements and extension routines * * * * Copyright (C) 1989, 1990 by Jonas H. Hedberg. All rights reserved. * * * * These changes may be redistributed free allowed for any purpose * * providing both the Lugaru and my copyrights remain intact. * * I assume no liability for the use or inability to use * * this software. Neither do I take responsibility for any damage * * cased by this software extension. * * This extension may NOT be redistributed for profit. * ************************************************************************* * File.......: ASCIITBL.E * * Ver........: 1.00 * * Date.......: 1991-10-08 * * îpsilon ver: 5.01 * * By.........: Jonas Hedberg * * Title..: Software Engineer * * Company: TEAMSTER AB * * Address: P.O. Box 8321 * * S-402 79 G™TEBORG * * Country: SWEDEN * * Tel....: Int +46-31-22 22 65 (GMT + 1h) * * Fax....: Int +46-31-22 75 46 * * Description: Pops up a movable ASCII table on the screen. * * Use PageUp and PageDown to see more in the table. * * Cursor keys to move the table around on the screen. * * X och ABORT to exit from the table. * * Algorithm..: * * Comments...: Thanks to Wayne Dow for the original idea. * * Change log * * Date | Ver | Change * * ----------+-------+-------------------------------------------------- * * 07/15/92 | 1.01 | Set color of table to COLOROF(highlight) color. * * | | Gary LaRocco CIS 70521,1773 * * | | * * | | * ************************************************************************/ #include "eel.h" #include "lowlevel.h" int _current_ascii_table = 1; int _table_x_pos; int _table_y_pos; char (ascii_code[32])[] = { "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS ", "HT ", "LF ", "VT ", "FF ", "CR ", "SO ", "SI ", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM ", "SUB", "ESC", "FS ", "GS ", "RS ", "US " }; when_loading() { sayput("ASCII TABLE-module Ver 1.00 (C) 1991 by Jonas Hedberg. Loading..."); delay(300, COND_KEY); } show_ascii_table() { int table_color, loop; char row[20]; table_color = COLOROF(highlight); refresh(); term_write(_table_x_pos, _table_y_pos+00, "ÉÍÍÍÑÍÍÍÑÍÍÍÍÑÍÍÍÍ»", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+01, "ºHex³Dec³Char³Codeº", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+02, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+03, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+04, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+05, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+06, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+07, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+08, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+09, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+10, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+11, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+12, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+13, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+14, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+15, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+16, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+17, "º º", 19, table_color, 0); term_write(_table_x_pos, _table_y_pos+18, "ÈÍÍÍÏÍÍÍÏÍÍÍÍÏÍÍÍͼ", 19, table_color, 0); for (loop = (_current_ascii_table-1)*16; loop != _current_ascii_table*16; loop++) { if (loop <= 31) { sprintf(row, " %2x³%3d³ %c ³%s", loop, loop, loop, ascii_code[loop]); } else { sprintf(row, " %2x³%3d³ %c ³ ", loop, loop, loop); } term_write(_table_x_pos+1, loop-(_current_ascii_table-1)*16+2+_table_y_pos, row, 16, table_color, 0); } } command ascii_table() on cx_tab[CTRL('a')] { _table_x_pos = screen_cols-19; _table_y_pos = 0; say("Cursor keys = Move table, PgUp, PgDn, X = Exit ASCII table"); while ((!user_abort) && (key != 'x')) { show_ascii_table(); wait_for_key(); if (key == KEYPGUP) { _current_ascii_table--; if (_current_ascii_table <= 0) _current_ascii_table = 16; } if (key == KEYPGDN) { _current_ascii_table++; if (_current_ascii_table >= 17) _current_ascii_table = 1; } if (key == KEYUP) { if (_table_y_pos > 0) _table_y_pos--; } if (key == KEYDOWN) { if (_table_y_pos < screen_lines-19-2) _table_y_pos++; } if (key == KEYLEFT) { if (_table_x_pos > 0) _table_x_pos--; } if (key == KEYRIGHT) { if (_table_x_pos < screen_cols - 19) _table_x_pos++; } } say(""); } /* End Of File */