home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR8
/
FRUGALED.ZIP
/
DEMO.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-13
|
5KB
|
145 lines
//------------//
// DEMO.C //
//------------//
// Demonstration Program for [FE] FrugalEdit v1.0 (c) 1993.
// Using SMALL memory model library
#include "fe.h"
void Ferror( int fe_error );
char InputString[4096];
int StringLength = 4096;
int main()
{
int i;
int fe_error = 0; // Fedit() 's return
char filename[40] = "DEMO"; // default: daily journal 12-31-93
char helpfilename[40] = "FE.DOC";
int left = 0; // 0 = use whole screen
int top = 1; // if left > 0, use specified coordinates
int right = 80; // which includes one status line at the bottom
int bottom = 25; // and borders, if any.
int c1 = FeC1; // Editing Window Foreground Color
int c2 = FeC2; // Background
int c3 = FeC3; // Status Line Foreground Color
int c4 = FeC4; // Background
int c5 = FeC5; // Border Foreground Color
int c6 = FeC6; // Background
int c7 = FeC7; // Block/Help Foreground Color
int c8 = FeC8; // Background
// start with default color settings
int border = 1; // 0=none, 1=horizontal, 2=vertical, 3=both
int border_str = 1; // 1=single line┌─┐, 2=double╔═╗, 3=block▄▄▄
int save_scr = 0; // 0=no, 1=yes
int tab_size = 4;
int line_no = 1;
int col_no = 1;
int no_shell = 1; // do not allow shelling out to DOS
int view = 0;
int sensitive = 0; // default 0 = no; 1 = yes;
int wrap = 1;
int print = 0; // use default printer initialization
int no_new_file = 1; // edit given existing file only
int no_other = 1; // do not allow opening multiple files
int no_helpline = 0; // do not show help message on status line
int silence = 0; // do not buz (ring bell) on error
int backup = 1; // do not leave back up when saving
unsigned text_buf_size = StringLength;
strcpy (InputString, "\
Thank you for testing [FE] FrugalEdit v1.0 (c) 1993 S.C.Park, Esq.\n\
\n\
[FE] is an easy to use full function text editor\n\
mainly designed to be used as a built-in editor\n\
in other programs by casual programers.\n\
\n\
It is another tool for the casual programers much\n\
like the window/memu module or file management module.\n\
\n\
It is highly configurable and most of all extremely easy\n\
to use either as the editor or as the text viewer.\n\
\n\
To see documentation, press Ctrl-H.\n\
After experimenting, press Ctrl-Z or F7 to exit.\n\
\n\
Type in something below, please.\n");
fe_error = Fedit(filename, helpfilename,
border, border_str, save_scr,
left, top, right, bottom,
c1, c2, c3, c4, c5, c6, c7, c8,
tab_size, 100, col_no, no_shell,
view, sensitive, wrap, print,
no_new_file, no_other, no_helpline, silence, backup,
InputString, text_buf_size);
if (fe_error) Ferror( fe_error );
fe_error = Fedit("", helpfilename,//"" = no file save when string input
3, 2, save_scr,
5, top, right-5, bottom-3,
c1, c2, c3, c4, c5, c6, c7, c8,
tab_size, line_no, col_no, no_shell,
view, sensitive, wrap, print,
no_new_file, no_other, no_helpline, silence, backup,
InputString, text_buf_size);
if (fe_error) Ferror( fe_error );
strcpy( InputString, "Just Press F7, Please. " );
for (i=2; (i<51 && !fe_error); i++)
fe_error = Fedit("DEMO", helpfilename,
3, 3, save_scr,
5+i, 5+i, right-10, bottom-5,
c1+i, c2, c3+i, c4, c5+i, c6, c7, c8,
tab_size, line_no, 23, no_shell,
1, sensitive, wrap, print,
no_new_file, no_other, no_helpline, silence, backup,
InputString, text_buf_size);
if (fe_error) {
strcpy( InputString, FeErr[fe_error] );
strcat( InputString, "\n\Press EXIT (F7) key." );
fe_error = Fedit("ERROR", helpfilename,
3, 2, 1,
10, 15, 40, 20,
c2+128, c1, c4, c3, c6, c5, c8, c7,
tab_size, 2, 21, no_shell,
1, sensitive, wrap, print,
no_new_file, no_other, no_helpline, silence, backup,
InputString, text_buf_size);
}
fe_error = Fedit("FE.DOC", helpfilename,
0, 2, 1,
left, top, right, bottom,
c1, c2, c3, c4, c5, c6, c7, c8,
tab_size, line_no, col_no, no_shell,
1, sensitive, wrap, print,
1, 1, no_helpline, silence, backup,
"", 0);
if (fe_error) Ferror( fe_error );
gotoxy( 1, 25 );
puts( "\n[FE] FrugalEdit v1.0 (c) 1993 S.C.Park, Esq. [shareware]" );
puts( "Demonstration finished." );
return fe_error;
}
void Ferror( int fe_error )
{
puts( FeErr[fe_error] );
puts( "Press any key." );
getch();
exit( fe_error );
}