Consultor Eletrônico



Kbase P45036: Why do ' ' and '' when compared, evaluate to being equal?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   03/02/2009
Status: Verified

GOAL:

Why do ' ' and '' when compared, evaluate to being equal?

FACT(s) (Environment):

All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x
OpenEdge Category: Language (4GL/ABL)

FIX:

When comparing two strings Progress always appends space characters to the shorter of the two strings before doing the comparison. In this scenario, the empty string is expanded to the same length as the string containing a single space character. Since the character used during the extending of the empty string is the space character the resulting strings are equal.