home *** CD-ROM | disk | FTP | other *** search
- /*-------------------------------------------------------------------------
- Turbo ScrEdit Skeleton v.1.0
-
- for Turbo C 1.5, 2.0
-
- Refer to SKELETON.DOC for a complete discussion on the contents and usage
- of this file.
- -------------------------------------------------------------------------*/
-
-
- /*--**Version**-*/
-
-
- /*--**Buffers**-*/
-
-
- /*--**User Variables**-*/
-
- int Demo_Screen_Pointer;
- int Demo_Current_Screen;
- int Demo_Load_Screen;
- int Demo_Mode;
-
- /*--** Example of loading and displaying screens**-*/
-
- void Load_Screen()
- {
- S_Num = -1;
-
- while (S_Num == -1)
- {
- Demo_Screen_Pointer++;
- switch (Demo_Screen_Pointer)
- {
-
- /*--**Screens**-*/
-
- }
- if (S_Num == -1) Demo_Screen_Pointer = 0;
- }
- }
-
-
-
-
- void Skeleton_Init()
- {
- /*--**ScreenFileName**-*/
-
- /*--**InitRoutines**-*/
-
-
- /*--**System Switches**-*/
-
- S_Msg[0] = 0;
- S_Sound = 1;
- S_Freq = 300;
- S_Dur = 100;
- S_ShowStatus = 1;
- S_Cursor = S_NORMAL;
- S_Point = -1;
-
- /*--** 1st Example Code **-*/
-
- Demo_Current_Screen = -1;
- Demo_Mode = 1;
-
- Load_Screen();
- }
-
- void Process_Current_Screen()
- {
- /*--** Demo mode 2 **-*/
-
- if (Demo_Mode == 2)
- {
- if (s_indx->A.s_compiledind[S_Num] < 3)
- S_ReadKey();
- else
- do
- {
- if (S_Point > s_indx->A.s_count[S_Num]) S_Point = -1;
- while ((S_Point==-1)||(s_field->C.s_type[S_Point]>9))
- if (++S_Point >= s_indx->A.s_count[S_Num]) S_Point = -1;
- if (S_Msg[0]!=0)
- {
- itoa(S_Point,S_NewStr,10);
- strcpy(S_Msg,"Field <");
- strcat(S_Msg,S_NewStr);
- strcat(S_Msg,">");
- }
- S_ReadField();
- if ((S_Enter)||(S_Tab))
- S_Point++;
- }
- while ((!S_Alt)&&(!S_Ctrl) && (!S_Fkey) && (!S_Enter));
- }
-
-
-
- /*--** Demo mode 0 or 1 **-*/
-
- if (Demo_Mode != 2)
- S_ReadScreen();
-
-
- /*--** Example code for demonstration mode **-*/
-
- if ((S_F1) &&
- (Demo_Mode>0))
- {
- strcpy(S_Msg,"Press any key to load the next screen");
- S_ReadKey();
- Load_Screen();
- }
- /*--**Special Key Testing**-*/
-
- if (!S_Ins)
- {
- strcpy(S_Msg,"< >");
- if (S_Ch > 31)
- S_Msg[1]=S_Ch;
-
- if (S_RightShift) strcat(S_Msg,"<Right Shift>");
- if (S_LeftShift) strcat(S_Msg,"<Left Shift>");
- if (S_Ctrl) strcat(S_Msg,"<Control key>");
- if (S_Alt) strcat(S_Msg,"<Alt key>");
- if (S_ScrollLock) strcat(S_Msg,"<Scroll Lock>");
- if (S_NumLock) strcat(S_Msg,"<Num Lock>");
- if (S_Caps) strcat(S_Msg,"<Caps>");
- if (S_InsertMode) strcat(S_Msg,"<Insert Mode>");
- if (S_F1) strcat(S_Msg,"<F1>");
- if (S_F2) strcat(S_Msg,"<F2>");
- if (S_F3) strcat(S_Msg,"<F3>");
- if (S_F4) strcat(S_Msg,"<F4>");
- if (S_F5) strcat(S_Msg,"<F5>");
- if (S_F6) strcat(S_Msg,"<F6>");
- if (S_F7) strcat(S_Msg,"<F7>");
- if (S_F8) strcat(S_Msg,"<F8>");
- if (S_F9) strcat(S_Msg,"<F9>");
- if (S_F10) strcat(S_Msg,"<F10>");
- if (S_F11) strcat(S_Msg,"<F11>");
- if (S_F12) strcat(S_Msg,"<F12>");
- if (S_Home) strcat(S_Msg,"<Home>");
- if (S_End) strcat(S_Msg,"<End>");
- if (S_PgUp) strcat(S_Msg,"<PgUp>");
- if (S_PgDn) strcat(S_Msg,"<PgDn>");
- if (S_Left) strcat(S_Msg,"<Left>");
- if (S_Right) strcat(S_Msg,"<Right>");
- if (S_Up) strcat(S_Msg,"<Up>");
- if (S_Down) strcat(S_Msg,"<Down>");
- if (S_Del) strcat(S_Msg,"<Delete>");
- if (S_Tab) strcat(S_Msg,"<Tab>");
- if (S_BkSp) strcat(S_Msg,"<Back Space>");
- if (S_Esc) strcat(S_Msg,"<Escape>");
- if (S_Enter) strcat(S_Msg,"<Enter>");
- }
- }
-
-
- main()
- {
- Skeleton_Init();
- while (!S_Esc)
- {
- Process_Current_Screen();
- }
- /*--** Closing The screen file **--*/
- S_CloseScreenFile();
- }