Bug #7175
substitute: incorrect handling of unknown longchar values
Status:
Closed
Priority:
Normal
Assignee:
Vladimir Tsichevski
Target version:
-
Start date:
Due date:
% Done:
100%
billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
History
#2 Updated by Vladimir Tsichevski over 3 years ago
An unknown lonchar value passed as an formatting parameter for substitute is formatted as null instead of expected ?:
DEFINE VARIABLE v AS LONGCHAR NO-UNDO.
v = ?.
MESSAGE SUBSTITUTE("Longchar '&1'", v).
Note: before OE 11.7 the formatted value in OE was empty string instead of ? :-(
Note: this bug was first mentioned in #7143-33.
#3 Updated by Vladimir Tsichevski over 3 years ago
- Status changed from New to WIP
- % Done changed from 0 to 90
This patch fixes this issue:
=== modified file 'src/com/goldencode/p2j/util/TextOps.java'
--- src/com/goldencode/p2j/util/TextOps.java 2023-01-18 13:51:25 +0000
+++ src/com/goldencode/p2j/util/TextOps.java 2023-03-06 22:04:10 +0000
@@ -6825,9 +6825,9 @@
// this is required because P4GL uses yes/no instead of true/false
sb.append(new logical(((Boolean) obj)));
}
- else if (obj instanceof character)
+ else if (obj instanceof Text)
{
- character ch = (character) obj;
+ Text ch = (Text) obj;
sb.append(ch.isUnknown() ? "?" : ch.getValue());
}
else if (obj instanceof object)
#4 Updated by Vladimir Tsichevski over 3 years ago
- Status changed from WIP to Review
- % Done changed from 90 to 100
Committed as 3827a rev. 14502.