Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need INDEX long string.
Message
From
28/05/2003 12:06:31
 
 
To
28/05/2003 10:44:28
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00793472
Message ID:
00793571
Views:
25
>Hi Sergey,
>
>data is binary BINTOC() path:
>
>BINTOC(1)BINTOC(74)BINTOC(87)BINTOC(134)BINTOC(456)BINTOC(1232)BINTOC(3433)BINTOC(567565)BINTOC(45635653)
>
>and it is on one memo field ( it is the path of the element on one tree structure without explicit level limit, true limit is 2^9/4 levels).
>
>I need index with lenght priority, or need padr with BINTOC(0).
>
>You have see, on past, someone, what has exceeded the limit of the 240 characters with some structure of indices of indices?
>
>I need this for fast traverse graph structure ( graph is one multipath tree )
>
>Fabio

Fabio,

Can this work to avoid the long keys ?
create cursor Tree ;
   Parent I default 0, ;
   Child  I default 0, ;
)
select Tree
Index on bintoc(Parent) tag Parent  && optional
index on bintoc(Child) tag Child  && optional

index on  bintoc(Parent) + bintoc(Child) tag Down

&& depth first
Function Traverse(StartNode)

    local r
    r = recno()

    =seek(bintoc(StartNode)) 

    scan rest while( bintoc(StartNode) == bintoc(Parent) )
       =Traverse(Child)
    endscan

    go (r)
endfunc
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform