home *** CD-ROM | disk | FTP | other *** search
- /* File: initism2.c
- /* Copyright (c) 1994 by John Gambini
- */
-
- #include "ism.h"
- #include "compudex.h"
- #include "screen.h"
-
- void InitISAM()
- {
- int wMaint, rc, w = 1, x, y, a, fhdl;
- int top = 4, left = 5, width = 47, depth = 13;
- char buff[80];
-
- Screen( &wMaint, GET_CURSOR_ABS, &y, &x, &a );
-
- Screen( &wMaint, SET_CURSOR_TYPE, INVISIBLE );
-
- Screen( &wMaint, CREATE_WINDOW, top, left, width, depth, 0x74, 0 );
-
- Screen( &wMaint, PUT_STRING, 0, 9," Create Name And Address File ", 0x74 );
-
- Screen( &wMaint, PUT_STRING, w, 2,"Creating Name and Address File.......", 0x70 );
-
- Screen( &wMaint, OPEN_WINDOW, 1 );
-
- fhdl = ISMCreate( MAILLST, sizeof( MAIL_REC ) );
-
- if( fhdl == ERROR )
- {
- w+=2;
- Screen( &wMaint, PUT_STRING, w, 2, "ERROR: Could not create ISAM file \"maillst\".", 0x70 );
- w++;
- Screen( &wMaint, PUT_STRING, w, 2, "This may be because it already exists.", 0x70 );
- }
- else
- {
- w+=2;
- Screen( &wMaint, PUT_STRING, w, 2, "ISAM File Creation succesful.", 0x70 );
- rc = ISMClose( fhdl );
- if( rc == ERROR )
- {
- w+=2;
- Screen( &wMaint, PUT_STRING, w, 2, "A system error has occurred while attempting", 0x70 );
- w+=2;
- Screen( &wMaint, PUT_STRING, w, 2, "to close the ISAM file.", 0x07 );
- sprintf( buff, "System Error = %d", ismerr.syserr );
- w+=2;
- Screen( &wMaint, PUT_STRING, w, 2, buff, 0x70 );
- }
- }
-
- w+=2;
- Screen( &wMaint, PUT_STRING, w, 2, "Press Any Key To Continue", 0x70 );
-
- Screen( &wMaint, REFRESH_WINDOW_ABS, top, left, width, depth );
-
- Screen( &wMaint, SET_CURSOR, w, 29 );
- Screen( &wMaint, SET_CURSOR_TYPE, NORMAL );
-
- getch();
-
- Screen( &wMaint, CLOSE_WINDOW );
-
- Screen( &wMaint, DESTROY_WINDOW );
-
- Screen( &wMaint, SET_CURSOR_ABS, y, x, a );
- }