Project

General

Profile

Feature #10202

Enhance concat/replace within FWD

Added by Dennis-Alexandru Niță about 1 year ago. Updated about 1 year ago.

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

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#1 Updated by Dennis-Alexandru Niță about 1 year ago

The concatenation operator within 4GL (+) is implemented in FWD with:

1. TextOps.Concat Method
This method is used for compile-time known data types.

Current Implementation:

The method currently returns a character data type.
This implementation does not support concatenations involving a longchar, where the result should be promoted to longchar.

Proposed Changes:

The return type should be changed to Text. Since both longchar and character inherit from Text, this will accommodate both data types.
The result of TextOps.Concat should be wrapped within the expected parameter type. No wrapping would be necessary if the parameter is already a Text object.

2. DynamicOps.Plus Method
This method is used when the data types in a concatenation are not known at compile time.

Current Implementation:

The current strategy for character or longchar types is simple string appending.
It does implement the concatenation of a longchar with a character or vice-versa.

Proposed Changes:

Delegate the string concatenation logic to the improved TextOps.Concat method to ensure consistent behavior and proper type promotion.

3. Required 4GL Error Implementation
The following 4GL errors related to concatenation need to be implemented for full compatibility:

Error (12371): "Attempt to update data exceeding 32000. (12371)"
This error should occur when concatenating undoable variables if the resulting size exceeds 32KB.

Error (11678): "Replace/concat May Not Result In Data > 32000 Bytes. (11678)"
This error should be triggered when concatenating character variables if the result exceeds the 32KB limit. -> implemented in 9780a

Also, error 11678 is thrown when replace would be used.

Also available in: Atom PDF