scope oddity

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

scope oddity

#1 Post by reganc »

Hi guys

I've just had a problem with the use of a scope with Xbase++ 2.0 that I never had with 1.9.

In our system the account code fields in the databases are 6 characters long. We have a database that holds the header details for repeat orders and there can be multiple records for the same customer.

The index on this repeat order database is:

ACCOUNT+str(NUMBER,6)

In the repeat order setup dialog we have a browse on that database that uses scopes to stop the empty records at the top of the index being shown. I set the scope using:

DC_SetScope(0,"!")
DC_SetScope(0,"~")

The start scope is '!' as it is the first printable ASCII character.
The end scope is '~' as to my mind this is the last printable ASCII character (126) in the 0-127 ASCII range.

In 1.9, this works fine with an NTX index (I have not tried it with a CDX index at present).
In 2.0, this does not work with a CDX index.

What happens is that the browse is shown correctly. In my database there are 4 records and the below is just the data in the 2 relevant fields:

Code: Select all

Account  Number
ACT001   1
ACT001   2
ALB001   5
Z901     4
and the 1st record is highlighted when the dialog is shown.

But you cannot move the browse cursor up or down. If you move the browse cursor right to scroll the extra columns in the browse into view, the shown data in the browse clears and only one line is shown with 'rubbish' data in it.

It appears that it is not understanding the end scope value.

Has anyone else seen anything similar?

I had to change the end scope to just be 'Z' for it to work correctly but if any of our customers are using the '~' character on the front of their account codes it's gonna be a problem...
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: scope oddity

#2 Post by reganc »

Oh, and thinking about this as I was writing is making me wonder if this is perhaps CDX index related instead of v2 related...

So I'll be testing this at some point.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: scope oddity

#3 Post by reganc »

I have just switched my 1.9 program to using CDX indexes and I have the same problem.

I am guessing this must be a COLLATION problem then. Darn!
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: scope oddity

#4 Post by rdonnay »

I have just switched my 1.9 program to using CDX indexes and I have the same problem.

I am guessing this must be a COLLATION problem then. Darn!
That would be my best guess. Sorry.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: scope oddity

#5 Post by Auge_Ohr »

reganc wrote:What happens is that the browse is shown correctly.
...
But you cannot move the browse cursor up or down.
hm ... i do not think that Index or SCOPE is the Problem.
Xbase++ v2.x does have

Code: Select all

oBrowse:NavigationMode := XBPBRW_NAVIGATION_SYSTEM 
try to change to XBPBRW_NAVIGATION_1XCOMPATIBLE
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: scope oddity

#6 Post by rdonnay »

Give me a small sample program with your database and I will see what I can do.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: scope oddity

#7 Post by skiman »

Hi Regan,

Maybe the following will work?

I suppose you have a typo in your sample?

DC_SetScope(0,"!")
DC_SetScope(0,"~") -> should be 1

I would try:
DC_SetScope(0,chr(33))
DC_SetScope(1,chr(128))
Best regards,

Chris.
www.aboservice.be

reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: scope oddity

#8 Post by reganc »

skiman wrote:Hi Regan,

Maybe the following will work?

I suppose you have a typo in your sample?

DC_SetScope(0,"!")
DC_SetScope(0,"~") -> should be 1

I would try:
DC_SetScope(0,chr(33))
DC_SetScope(1,chr(128))
Chris, it was a just a typo in the above... Sorry. The real code has the 1 in the second line.

That'll teach me to cut & paste too quickly...

I am convinced it is a collation related problem.

I found a message in the newsgroups that appears to mention a similar issue:

Subject: Re: CDX + Descend...
Date: Mon, 01 Sep 2003 14:49:57 +0200
From: Steffen F. Pirsig <Steffen.Pirsig@alaska-research.com>
Newsgroups: public.xbase++.data-access
References: <3f50a6a6$1@asgcom.alaska-software.com>

but that is when the collation is set to GERMAN. I believe the collation would be set to BRITISH here but it seems the same might apply.

Not sure what we're going to do at the moment. I have yet to bring it to the attention of my manager as it does not seem to have affected any of our customers at present.

And who knows, maybe it never will as there may not ever be a customer with an account code starting with an ASCI char greater than 122 also using CDX indexes.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: scope oddity

#9 Post by reganc »

rdonnay wrote:Give me a small sample program with your database and I will see what I can do.
I will have to run this past Steve first but if he's OK with it, I'll knock something up.

Thanks.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

Post Reply