7272.patch
src/com/goldencode/p2j/ui/ErrorWriterBatch.java 2023-05-02 16:14:38 +0000 | ||
---|---|---|
16 | 16 |
** (redirected) console. |
17 | 17 |
** 008 SVL 20171024 Added displayError(errmsg, noMessageBox). |
18 | 18 |
** 009 GBB 20230313 ErrorManager.writeLog() called. Simplified windows condition blocks. |
19 |
** 010 GBB 20230502 Don't write to System.out batch output that is redirected to a strean. |
|
19 | 20 |
*/ |
20 | 21 |
/* |
21 | 22 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
132 | 133 |
// TODO: In Windows the native message box should be displayed here. |
133 | 134 |
} |
134 | 135 | |
135 |
// then log it to redirected console |
|
136 |
System.out.println(errmsg); |
|
136 |
if (client == null || !client.isRedirected()) |
|
137 |
{ |
|
138 |
// if not redirected to a stream, write it to the console |
|
139 |
System.out.println(errmsg); |
|
140 |
} |
|
137 | 141 |
} |
138 | 142 | |
139 | 143 |
/** |
... | ... | |
261 | 265 |
// TODO: In Windows the native message box should be displayed here. |
262 | 266 |
} |
263 | 267 | |
264 |
// then log it to redirected console |
|
265 |
System.out.println(output); |
|
268 |
if (client == null || !client.isRedirected()) |
|
269 |
{ |
|
270 |
// if not redirected to a stream, write it to the console |
|
271 |
System.out.println(output); |
|
272 |
} |
|
266 | 273 |
} |
267 | 274 | |
268 | 275 |
/** |
src/com/goldencode/p2j/ui/client/Window.java 2023-05-02 17:00:59 +0000 | ||
---|---|---|
2 | 2 |
** Module : Window.java |
3 | 3 |
** Abstract : Window widget implementation for CHUI |
4 | 4 |
** |
5 |
** Copyright (c) 2005-2021, Golden Code Development Corporation.
|
|
5 |
** Copyright (c) 2005-2023, Golden Code Development Corporation.
|
|
6 | 6 |
** |
7 | 7 |
** -#- -I- --Date-- --JPRM-- ----------------------------Description----------------------------- |
8 | 8 |
** 001 EVL 20050509 @21167 Creation based on CHARVA Window class. |
... | ... | |
278 | 278 |
** Missed the suppression of the pauseBeforeHide when keepMessages is on. |
279 | 279 |
** 142 CA 20201015 Replaced java.util.Stack with ArrayDeque (as synchronization is not required). |
280 | 280 |
** HC 20210603 Fixed tiny input not to clear the previously input value. |
281 |
** 143 GBB 20230502 Don't display a message on the terminal in chui when redirected to a stream. |
|
281 | 282 |
*/ |
282 | 283 |
/* |
283 | 284 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
1855 | 1856 |
boolean switched = tc.isRedirected(); |
1856 | 1857 |
int redir = -1; |
1857 | 1858 | |
1858 |
// in redirected mode we output to both the terminal and to the stream, but we output
|
|
1859 |
// in redirected mode we output only to the stream and we output
|
|
1859 | 1860 |
// the unmodified text, not the text that may have been truncated above |
1860 | 1861 |
if (switched) |
1861 | 1862 |
{ |
... | ... | |
1869 | 1870 |
try |
1870 | 1871 |
{ |
1871 | 1872 |
// Make sure to suppress output if it is redirected with KEEP-MESSAGES option |
1872 |
if (content[0] == null && !isKeepMessages) |
|
1873 |
if (content[0] == null && !isKeepMessages && (!tc.isChui() || !switched))
|
|
1873 | 1874 |
{ |
1874 | 1875 |
// 'clear' flag is no longer used |
1875 | 1876 |
content[0] = message; |
... | ... | |
1877 | 1878 |
return 0; |
1878 | 1879 |
} |
1879 | 1880 | |
1880 |
if (content[1] == null && !isKeepMessages) |
|
1881 |
if (content[1] == null && !isKeepMessages && (!tc.isChui() || !switched))
|
|
1881 | 1882 |
{ |
1882 | 1883 |
// 'clear' flag is no longer used |
1883 | 1884 |
content[1] = message; |
... | ... | |
1887 | 1888 | |
1888 | 1889 |
try |
1889 | 1890 |
{ |
1890 |
if (messageNeedPause && !isKeepMessages) |
|
1891 |
if (messageNeedPause && !isKeepMessages && (!tc.isChui() || !switched))
|
|
1891 | 1892 |
tc.pauseBeforeHide(); |
1892 | 1893 | |
1893 | 1894 |
return 0; |
1894 | 1895 |
} |
1895 | 1896 |
finally |
1896 | 1897 |
{ |
1897 |
if (!isKeepMessages) |
|
1898 |
if (!isKeepMessages && (!tc.isChui() || !switched))
|
|
1898 | 1899 |
{ |
1899 | 1900 |
// 'clear' flag is no longer used |
1900 | 1901 |
displayMessage(new String[] {message, null}, cs, -1); |
src/com/goldencode/p2j/util/ControlFlowOps.java 2023-05-02 16:28:53 +0000 | ||
---|---|---|
284 | 284 |
** HC 20230125 Added caching of resolved procedure internal entries. |
285 | 285 |
** 084 CA 20230215 Added unknown.UNKNOWN singleton (used by FWD runtime at this time). |
286 | 286 |
** 085 GBB 20230315 Redundant ErrorManager.buildErrorText removed before ErrorManager.displayError. |
287 |
** 086 GBB 20230502 Run missing external procedure to produce error always. |
|
287 | 288 |
*/ |
288 | 289 | |
289 | 290 |
/* |
... | ... | |
359 | 360 |
import com.goldencode.p2j.security.*; |
360 | 361 |
import com.goldencode.p2j.security.SecurityManager; |
361 | 362 |
import com.goldencode.p2j.ui.*; |
363 |
import com.goldencode.p2j.ui.chui.*; |
|
362 | 364 |
import com.goldencode.p2j.util.InvocationRequestPayload.InvokeType; |
363 | 365 | |
364 | 366 |
/** |
... | ... | |
8108 | 8110 |
private static void invokeFailure(String target) |
8109 | 8111 |
throws StopConditionException |
8110 | 8112 |
{ |
8113 |
int errCode = 293; |
|
8111 | 8114 |
String spec = "\"%s\" was not found"; |
8112 |
String err = String.format(spec, target); |
|
8113 |
err = ErrorManager.buildErrorText(293, err, true); |
|
8114 |
|
|
8115 |
String errMsg = String.format(spec, target); |
|
8116 |
String err = ErrorManager.buildErrorText(errCode, errMsg, true); |
|
8117 | ||
8118 |
// RUN external.p should never be a silent error |
|
8119 |
boolean isSilentOriginally = ErrorManager.isSilent(); |
|
8120 |
ErrorManager.setSilent(false); |
|
8121 |
ErrorManager.addError(errCode, errMsg, false, true); |
|
8115 | 8122 |
ErrorManager.displayError(err); |
8116 |
throw new StopConditionException(err, new NumberedException(err, 293)); |
|
8123 |
ErrorManager.setSilent(isSilentOriginally); |
|
8124 |
|
|
8125 |
throw new StopConditionException(err, new NumberedException(err, errCode)); |
|
8117 | 8126 |
} |
8118 | 8127 |
|
8119 | 8128 |
/** |