Seek difference VO/X# with spaces

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1818
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Seek difference VO/X# with spaces

Post by ic2 »

This is just to inform about a seek difference VO/X#; we actually think it works good in X# an not in VO, but you may need to be aware.

We did have some code where the seek string was adjusted by adding spaces to the end of the string until the length of the field. Yes, we know it's not necessary (e.g. if you search ABC and there is also ABC2, it will still find ABC, also without the space) but it was done like that way back, probably originally with a seek value of another field in which case you do need to add these spaces to the 1st field.

Now the actual field length differed from what it should be, let's say C30 instead of C40 we expected.

In VO a seek like this works: cSeach:="ABCDE"+SPACE(35)
In X# it does not work because the fields is actually ABCDE and 25 spaces.

The X# behavior sounds correct to me but if anyone is having code like this you need to be aware of this difference.

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

Seek difference VO/X# with spaces

Post by Chris »

Hi Dick,

Is this for when using ADS, or plain dbfs? I had noticed something similar myself recently when I was working on a project using ADS, that ADS behaves differently than VO in this area.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1818
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Seek difference VO/X# with spaces

Post by ic2 »

Hello Chris,

Kees noticed it on the web program, which uses DBFCDX.

Probably both X# and ADS work as you would expect and VO actually does not in this respect.

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

Seek difference VO/X# with spaces

Post by Chris »

Hi Dick,

Are you using the same settings regarding soft seek etc? Do you have a sample you can send to reproduce this difference?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1818
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Seek difference VO/X# with spaces

Post by ic2 »

Hello Chris,

Yes, it was exactly the same code, we are converting it from VO. But I think we should leave it like that. Basically I can imagine that searching with more characters + trailing spaces than the field is long which works in VO and not in X# was wrong in VO and works correctly in X#..

Dick
Post Reply