On Wed, 15 Jul 2009, AbeB wrote:
> problem with subindex & ads remote(only)
> #INCLUDE "ADS.CH"
> PROC MAIN()
> REQUEST ADS
> SET SERVER REMOTE  // <<-will include the entire file in the 2nd index.

You are setting remote server.

> //SET SERVER LOCAL  // <<-will include the entire file in the 2nd index.
> 
> ERASE("TEST.CDX")

Now you are deleting local file.

> DBCREATE("TEST.DBF" ,{ {"FLD1", "N", 10 , 0 }} )

Now you are creatind TEST.DBF using DBFNTX.

> USE TEST VIA "ADS" EXCLU

Now you are reopening DBF using ADS RDD which is set to remote server.
Which file do you open?

> INDEX ON FLD1  TAG TEMP

You are creating index on remote server.

> ORDSETFOCUS("TEMP")
> FOR I  := 1 TO 100
>       APPEND BLANK
>       FIELD->FLD1 := I
> NEXT
> 
> ERASE("TEMP2.IDX")

Again you are deleting local file

> GO TOP
> SKIP 50
> 
> BROWSE()

Interaction. Bad idea because we do not know what you want to present
and what is wrong.
Results may depend on user keystrokes.

> INDEX ON FLD1 TAG TEMP2 WHILE FLD1 < 9999   TO TEMP2.IDX  

Yet another remote index with quite big range over last record value.

> ORDSETFOCUS( "TEMP2")
> BROWSE()

Yet another interaction without information what is wrong.

> USE
> QUIT


I do not know what is wrong and what you want to show us.
I modified your code to eliminate mixed native and ADS RDDs,
switched to local server so FERASE() works on the same files,
changed the range to test WHILE condition and eliminated
user interactions so results can be easy compared.

   #INCLUDE "ads.ch"
   PROC MAIN()
   FIELD FLD1
   LOCAL I
   REQUEST ADS
   SET SERVER LOCAL
   rddSetDefault( "ADSCDX" )
   ? "rdd:", rddSetDefault()
   ERASE( "test.cdx" )
   DBCREATE( "test.dbf", {{"FLD1", "N", 10 , 0}} )
   USE test
   INDEX ON FLD1 TAG TEMP
   ORDSETFOCUS( "TEMP" )
   ? ORDSETFOCUS()
   FOR I  := 1 TO 100
      APPEND BLANK
      FLD1 := I
   NEXT
   ERASE("temp2.idx")
   GO TOP
   SKIP 50
   INDEX ON FLD1 TAG TEMP2 WHILE FLD1 < 99 TO temp2.idx
   ? ORDSETFOCUS()
   ? "===="
   ORDSETFOCUS( "TEMP" )
   ? ORDSETFOCUS()
   GO TOP
   ? FLD1
   GO BOTTOM
   ? FLD1
   ORDSETFOCUS( "TEMP2" )
   ? ORDSETFOCUS()
   GO TOP
   ? FLD1
   GO BOTTOM
   ? FLD1
   USE
   RETURN



And it shows:
rdd: ADSCDX
TEMP
TEMP2
====
TEMP
         1
       100
TEMP2
        51
        98

What is expected and the same as for native DBFCDX also in Clipper.
I do not know what is wrong for you and what results you expected.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to