xsharp.eu • Seek difference VO/X# with spaces
Page 1 of 1

Seek difference VO/X# with spaces

Posted: Thu Mar 19, 2020 11:34 am
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

Seek difference VO/X# with spaces

Posted: Thu Mar 19, 2020 12:21 pm
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.

Seek difference VO/X# with spaces

Posted: Thu Mar 19, 2020 12:27 pm
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

Seek difference VO/X# with spaces

Posted: Thu Mar 19, 2020 3:24 pm
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?

Seek difference VO/X# with spaces

Posted: Fri Mar 20, 2020 12:01 pm
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