File tree Expand file tree Collapse file tree 3 files changed +71
-7
lines changed Expand file tree Collapse file tree 3 files changed +71
-7
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ class DisplayFile {
273273 switch ( value [ i ] ) {
274274 case `+` :
275275 case `-` :
276- if ( ! inString ) {
276+ if ( ! inString && value [ i + 1 ] !== newLineMark ) {
277277 innerValue += value [ i ] ;
278278 }
279279 break ;
@@ -377,15 +377,41 @@ class RecordInfo {
377377 this . isWindow = true ;
378378 let points = keyword . value . split ( ' ' ) ;
379379
380+
381+ if ( points . length >= 3 && points [ 0 ] . toUpperCase ( ) === `*DFT` ) {
382+ // WINDOW (*DFT Y X)
383+ this . windowSize = {
384+ y : 2 ,
385+ x : 2 ,
386+ width : Number ( points [ 2 ] ) ,
387+ height : Number ( points [ 1 ] )
388+ } ;
389+ } else {
390+ if ( points . length === 1 ) {
391+ // WINDOW (REF)
392+ this . windowReference = points [ 0 ] ;
393+
394+ } else if ( points . length >= 4 ) {
395+ // WINDOW (*DFT SY SX Y X)
396+ this . windowSize = {
397+ y : Number ( points [ 0 ] ) || 2 ,
398+ x : Number ( points [ 1 ] ) || 2 ,
399+ width : Number ( points [ 3 ] ) ,
400+ height : Number ( points [ 2 ] )
401+ } ;
402+ }
403+ }
404+
405+ switch ( points [ 0 ] ) {
406+ case `*DFT` :
407+ break ;
408+
409+ }
410+
380411 switch ( points . length ) {
381412 case 4 :
382413 //WINDOW (STARTY STARTX SIZEY SIZEX)
383- this . windowSize = {
384- y : Number ( points [ 0 ] ) || 2 ,
385- x : Number ( points [ 1 ] ) || 2 ,
386- width : Number ( points [ 3 ] ) ,
387- height : Number ( points [ 2 ] )
388- } ;
414+
389415 break ;
390416 case 1 :
391417 //WINDOW (REF)
Original file line number Diff line number Diff line change 1+ exports . lines = [
2+ ` A R HELP` ,
3+ ` A*%%TS SD 20080304 144943 PGML REL-V5R4M0 5722-WDS` ,
4+ ` A KEEP` ,
5+ ` A OVERLAY` ,
6+ ` A WINDOW(10 2 10 70 *NORSTCSR)` ,
7+ ` A WDWBORDER((*DSPATR RI) (*CHAR ':.::-` ,
8+ ` A ::.:'))` ,
9+ ` A WDWTITLE((*TEXT 'Print accounts by -` ,
10+ ` A store number for status type - Help-` ,
11+ ` A ') (*COLOR WHT))` ,
12+ ` A 1 26'Print accounts - Help'` ,
13+ ` A COLOR(WHT)` ,
14+ ` A 3 3'This report print all accounts of -` ,
15+ ` A selected status for a store or all'` ,
16+ ` A 4 2'stores. An account will print for-` ,
17+ ` A a store only if that store has'` ,
18+ ` A 5 2'taken a check from that account. -` ,
19+ ` A You can only select one status type'` ,
20+ ` A 6 2'for each report request.'` ,
21+ ` A 9 2'Press Enter to return'` ,
22+ ]
Original file line number Diff line number Diff line change 11const assert = require ( "assert" ) ;
22const { DisplayFile } = require ( "../src/dspf" ) ;
3+
34const depts = require ( "./file/depts" ) ;
45const replloadfm = require ( "./file/replloadfm" ) ;
6+ const issue1149 = require ( `./file/issue1149` ) ;
57
68exports . simple = ( ) => {
79 const file = new DisplayFile ( ) ;
@@ -135,4 +137,18 @@ exports.window = () => {
135137 assert . deepStrictEqual ( confirmWindowFormat . windowSize , {
136138 height : 6 , width : 54 , x : 6 , y : 6
137139 } ) ;
140+ }
141+
142+ exports . issue1149 = ( ) => {
143+ const file = new DisplayFile ( ) ;
144+ file . parse ( issue1149 . lines ) ;
145+
146+ const windowFormat = file . formats [ 1 ] ;
147+ assert . strictEqual ( windowFormat . name , `HELP` ) ;
148+ assert . deepStrictEqual ( windowFormat . windowSize , {
149+ height : 10 , width : 70 , x : 2 , y : 10
150+ } ) ;
151+
152+ const windowTitle = windowFormat . keywords . find ( keyword => keyword . name === `WDWTITLE` ) ;
153+ assert . strictEqual ( windowTitle . value , `*TEXT 'Print accounts by store number for status type - Help' *COLOR WHT` ) ;
138154}
You can’t perform that action at this time.
0 commit comments