Article

ENTRY statement raises error 560 with empty LONGCHAR

Information

 
Article Number000089099
EnvironmentProduct: OpenEdge
Version: 11.x
OS: Windows
Question/Problem Description
ENTRY statement raises error 560 with empty LONGCHAR

The ENTRY statement will raise error 560 on an empty LONGCHAR, when referencing a list entry in the longchar.  This does not happen for a character variable.  For example the following code:
 
DEF VAR c  AS CHAR     INIT "".
DEF VAR lc AS LONGCHAR INIT "".

ENTRY(1, c)  = "".
ENTRY(1, lc) = "" NO-ERROR.

MESSAGE "CHAR Entries : " NUM-ENTRIES(c) SKIP(1)
    "LONGCHAR Entries : " NUM-ENTRIES(lc) SKIP
    "Error : " ERROR-STATUS:ERROR SKIP 
    ERROR-STATUS:GET-MESSAGE(1) VIEW-AS ALERT-BOX.

Displays:

User-added image

According to the documentation the default initial value for a LONGCHAR variable is the empty string, but this doesn't seem to be the same as the CHARACTER variable that also has the empty string as its default.  
Steps to Reproduce
Clarifying Information
Error MessageEntry <entry#> is outside the range of list <list-string>. (560)
Defect/Enhancement NumberDefect OCTA-4089 / PSC00365318
Cause
Resolution
Upgrade to OE 11.7.4
Workaround
Add a space in the longchar variable definition INITIAL value:
 
DEF VAR c  AS CHAR     INIT "".
DEF VAR lc AS LONGCHAR INIT " ".

ENTRY(1, c)  = "".
ENTRY(1, lc) = "" NO-ERROR.

MESSAGE "CHAR Entries : " NUM-ENTRIES(c) SKIP(1)
    "LONGCHAR Entries : " NUM-ENTRIES(lc) SKIP
    "Error : " ERROR-STATUS:ERROR SKIP 
    ERROR-STATUS:GET-MESSAGE(1) VIEW-AS ALERT-BOX.
User-added image 
Notes
References to Other Documentation:
OpenEdge Development: ABL Reference, Chapter 1: ABL Syntax Reference, "Data types"
Article 000093588 : ENTRY()  statement returns empty value when used with LONGCHAR
Attachment 
Last Modified Date12/28/2018 6:32 PM


Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025