Project

General

Profile

Bug #5775

Runtime should handle default formats and setFormat should only be included when needed

Added by Roger Borrello over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

History

#2 Updated by Roger Borrello over 2 years ago

When dealing with the truncating of list-item-pairs in a combo-box to x(8), it was discovered that the frame definition for a character widget includes setFormat("x(8)") (but not for the combo-box) even though the 4GL does not include the format declaration.

It should be handled by runtime when the format is left as a default, and setFormat should only be included if it is included in the 4GL.

Testcase: uast/list-item.p

#3 Updated by Roger Borrello over 2 years ago

Testcase:

/*
 * This testcase can show how we are including a default format in one case, but not others.
 * The theory is we shouldn't include a setFormat statement in any case that the default is
 * expected in the 4GL. Rather, it should be included when it diverges from the default.
 */

/* Include this is you desire output to a file */
/*output to ./list-item.txt.*/

/*
 * The below will create a frame definition containing setFormat("x(8)") 
 */ 
def var ch0 as char.
form ch0 with frame f0. 
message "ch0 label/format: " ch0:label ch0:format.

/* 
 * The below will not include the setFormat in the frame definition. However, it illustrates
 * that the default format of a combo-box is x(8) since the list-items will be trucated
 */
def var ch1 as char /*format "x(8)"*/ .
form ch1 view-as combo-box 
/*                                                                                                             111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222223 */
/*                   1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999000000000011111111112222222222333333333344444444445555555555666666666677777777778888888888999999999900 */
/*list-items "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",*/ 
list-items "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456", 
           "abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdef" 
with frame f1 side-labels.
message "ch1 label/format: " ch1:label ch1:format.
enable ch1 with frame f1.
wait-for go of frame f1.
assign ch1.
/*message ch1 ch1:screen-value.*/

/* 
 * The below will not include the setFormat in the frame definition. However, it illustrates
 * that the default format of a combo-box is ignored if list-item-pairs are used
 */
def var ch2 as char /*format "x(8)"*/ .
form ch2 view-as combo-box 
/* 69 characters max, otherwise an error that it is too wide for the frame 
/*                        1111111111222222222233333333334444444444555555555566666666667 */
list-item-pairs "1234567890123456789012345678901234567890123456789012345678901234567890", "1", 
                "abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrst", "2" 
list-item-pairs "123456789012345678901234567890123456789012345678901234567890123456789", "1", 
                "abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrs", "2" 
*/
list-item-pairs "12345678901234567890123456789012345", "1", 
                "abcdefghijklmnopqrstuvwxyabcdefghij", "2" 
with frame f2 side-labels.
message "ch2 label/format: " ch2:label ch2:format.
enable ch2 with frame f2.
wait-for go of frame f2.
assign ch2.
/*message ch2 ch2:screen-value.*/

message "Done.".

Also available in: Atom PDF