I need DBSKIPUNIQUE() Function

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

I need DBSKIPUNIQUE() Function

#1 Post by unixkd »

Hi Roger

I want to skip to the next unigue record in a non-unigue table. I am using ADSDBE and I tried using AdsSkipUnique( hIndex, 1 ) API but didn't work.

Thanks

Joseph

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

Re: I need DBSKIPUNIQUE() Function

#2 Post by rdonnay »

Code: Select all

FUNCTION dbSkipUnique( n )

LOCAL xValue, cLastChar, cSeek, xNewValue


  IF n > 0
    xValue := &(IndexKey(0))
    cLastChar := SubStr(xValue,LEN(xValue))
    cSeek := SubStr(xValue,1,LEN(xValue)-1)+Chr(Asc(cLastChar)+1)
    dbSeek(cSeek,.t.)
  ELSE
    xValue := &(IndexKey(0))
    dbSkip(-1)
    xNewValue := &(IndexKey(0))
    IF xNewValue == xValue .AND. !Bof()
      dbSeek(xNewValue)
      dbSkip(-1)
    ENDIF
  ENDIF

RETURN nil

The eXpress train is coming - and it has more cars.

Post Reply