Feature #1435
TEXT group option of ENABLE statement conversion/runtime malfunction
0%
History
#1 Updated by Eugenie Lyzenko about 12 years ago
- File enable13.jpg added
In short the TEXT option should connect several data fields into one combined with the ability to wrap the entered text to the new field when data input exceeds the length of the curent subfield. To recreate use the following example:
def var aCh as character.
def var bCh as character.
def var cCh as character.
def var dCh as character.
enable text( aCh bCh cCh dCh ) with frame f1.
This converted into:
character aCh = new character("");
character bCh = new character("");
character cCh = new character("");
character dCh = new character("");
...
FrameElement[] elementList0 = new FrameElement[]
{
new WidgetElement(f1Frame.widgetACh()),
new WidgetElement(f1Frame.widgetBCh()),
new WidgetElement(f1Frame.widgetCCh()),
new WidgetElement(f1Frame.widgetDCh())
};
f1Frame.enable(elementList0);
Here we see the 1 error: The TEXT group option is converted the same way as usual
enable field1 field2 ...
statement.
This is not correct. The proper conversion should be:
...
FrameElement[] elementList0 = new FrameElement[]
{
new WordWrapElement(aCh, f1Frame.widgetACh()),
new WordWrapElement(bCh, f1Frame.widgetBCh()),
new WordWrapElement(cCh, f1Frame.widgetCCh()),
new WordWrapElement(dCh, f1Frame.widgetDCh())
};
f1Frame.enable(elementList0);
...
Convert, compile and run application for enable text(). Type any data to the first field and see it is not wrapping to the next one when exceeding length. The image attached illustrates the issue.
The second note there is the runtime part of this issue. Because when we manually change the converted code to the suggested
...
FrameElement[] elementList0 = new FrameElement[]
{
new WordWrapElement(aCh, f1Frame.widgetACh()),
new WordWrapElement(bCh, f1Frame.widgetBCh()),
new WordWrapElement(cCh, f1Frame.widgetCCh()),
new WordWrapElement(dCh, f1Frame.widgetDCh())
};
f1Frame.enable(elementList0);
This does not work as expected too.
To see what is the expected work - change enable to update in 4GL sample, reconvert and run.
#2 Updated by Greg Shah about 12 years ago
- Tracker changed from Bug to Feature
- Subject changed from TEXT group option of ENABLE statement conversion/runtime mailfunction to TEXT group option of ENABLE statement conversion/runtime malfunction