home *** CD-ROM | disk | FTP | other *** search
- /*********************
- *
- * tx_test.c - text test program.
- *
- * Purpose: This file contains tests of the text functions.
- *
- * Blackstar C Function Library
- * (c) Copyright 1985 Sterling Castle Software
- *
- *******/
-
- #include <stdio.h>
- #include <stdlib.h>
- #include "blackstr.h"
- #include "kb_head.h"
- #include "pr_head.h"
- #include "sc_head.h"
- #include "ut_head.h"
- #include "tx_head.h"
-
- char *tbuffer = "We acknowledge that we are not self-made, but God-made.\
- And we thank God for building into us the talents that made it \
- possible for us to create High C. Yet all defects are attributable \
- to our imperfect, fallen human nature. Praise God, from whom all \
- blessings flow.";
-
- struct MESG tmesg;
-
- void main() {
- char *ptr;
-
- /***************************************************************
- INITIALIZE THE SCREEN AND SAY HELLO
- ***************************************************************/
- sc_init(MO_CO80,BLUE,WHITE);
- sc_puts("Hello from tx_test.");
- sc_windo(5,4,25,10);
- sc_clr();
- sc_setcur(0,0);
-
- /***********************************************************************
- NOW PUT A LINE AT A TIME INTO THE WINDOW TO SEE WRAPPING,ETC.
- ***********************************************************************/
- tx_putl("High C was designed to facilitate serious professional");
- tx_putl("programming, and it is available on numerous processors.");
- tx_putl("High C supports the ANSI Standard");
- tx_putl("(ANSI document X3.159-1989) and several extensions");
- tx_putl("...strike key to continue");
- kb_getc();
-
- /***********************************************************************
- NOW USE THE TX_MESG FUNCTION AND ASSOCIATED STRUCTURE TO OUTPUT
- THE WHOLE BUFFER AT A TIME TO THE WINDOW
- ***********************************************************************/
- tmesg.col1=tmesg.row1=5;
- tmesg.col2=45;
- tmesg.row2=9;
- tmesg.text = tbuffer;
-
- /*******************************************
- SAVE AND RESTORE A MENU WINDO ON SCREEN
- *******************************************/
- ptr = sc_getwin(tmesg.col1-1,tmesg.row1-1,tmesg.col2+1,tmesg.row2+1);
- tx_mesg(&tmesg);
- sc_winfull();
- sc_setcur(0,22);
- tx_putl("Push key to restore text windo...");
- kb_getc();
- sc_putwin(ptr,tmesg.col1-1,tmesg.row1-1,tmesg.col2+1,tmesg.row2+1);
- free(ptr);
-
- sc_color(WHITE,BLUE);
- sc_setcur(0,22); sc_eeol();
- sc_puts("END OF TEST - Press any key to exit...");
- kb_getc();
- sc_color(WHITE,BLACK);
- sc_scroll(-1,0,0,79,23);
- }
-