1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2007 - INRIA - Allan CORNET
4  * Copyright (C) 2008 - INRIA - Bruno JOFRET
5  *
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  */
16 /*--------------------------------------------------------------------------*/
17 #ifdef _MSC_VER
18 #include <conio.h>
19 #endif
20 #include <stdio.h>
21 #include "more.h"
22 #include "configvariable_interface.h"
23 #include "localization.h"
24 #include "sciprint.h"
25 #include "GetCharWithoutOutput.h"
26 #include "ConsolePrintf.h"
27 /*--------------------------------------------------------------------------*/
28 #define MSG_MORE _("[Continue display? n (no) to stop, any other key to continue]")
29 /*--------------------------------------------------------------------------*/
linesmore(void)30 int linesmore(void)
31 {
32     int retval = 0;
33     if (getScilabMode() != SCILAB_STD)
34     {
35         int ch = 0;
36         /* Scilab has not his own window */
37         sciprint(MSG_MORE);
38 
39 #if _MSC_VER
40         ch = _getch();
41         if ( (ch != ' ') && (ch != 13) && (ch != 'y') )
42         {
43             retval = 1;
44         }
45 #else
46         ch = getchar();
47         if ( (ch != ' ') && (ch != '\n') && (ch != 'y') )
48         {
49             retval = 1;
50         }
51 #endif
52 
53         sciprint("\n");
54     }
55     else
56     {
57         /* scilab has his own window */
58         int ch = 0;
59         ConsolePrintf(MSG_MORE);
60         ch = GetCharWithoutOutput();
61         if ( ch == 110 )
62         {
63             retval = 1;
64         }
65     }
66     return retval;
67 }
68 /*--------------------------------------------------------------------------*/
69