String with Len 0

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Horst
Posts: 337
Joined: Tue Oct 13, 2015 3:27 pm

String with Len 0

Post by Horst »

Hello

aMessgeraet [nCnt][02] is empty and sLen = 0
cUsername is not empty


IF aMessgeraet [nCnt][02] = cUsername -> false
IF cUsername = aMessgeraet [nCnt][02] -> true

This shoud be a bug ?
i have xsharp (2.18.0.4)

Horst
User avatar
Chris
Posts: 4948
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: String with Len 0

Post by Chris »

Hi Horst,

It's not a bug in the sense that this is how VO works, too, with the partial equality operator when there's a usual involved.

If you want to test for absolute equality, you need to use the == operator. Or you can turn SetExact(TRUE).
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 337
Joined: Tue Oct 13, 2015 3:27 pm

Re: String with Len 0

Post by Horst »

Hi Chris

I know when i compare "Horst " = "Horst" or "Horst" = "Horst " then is the result different, but a empty string ? Thats weird for me.

Horst
User avatar
Chris
Posts: 4948
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: String with Len 0

Post by Chris »

Hi Horst,

Well, VO is extremely weird at times :)

I agree, it does not make much sense, but we had to implement it the same way as in VO, otherwise it would certainly break existing (ported to X#) code.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 4551
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: String with Len 0

Post by robert »

Horst,
Horst wrote: Fri Nov 01, 2024 10:56 am Hi Chris

I know when i compare "Horst " = "Horst" or "Horst" = "Horst " then is the result different, but a empty string ? Thats weird for me.

Horst
Actually, this was "inherited" from dBase (so from the 80s)

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply