Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expressions for a seek or locate and...
Message
From
16/07/2002 20:28:26
 
 
To
16/07/2002 20:10:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00679425
Message ID:
00679429
Views:
19
You can always use expressions in your index. For example, if your numeric field is say, 10 characters wide, then you can
index on Padl(numericfld, 10) + chrfld1 + chrfld2
And then do your seek the same way. Convert the numeric var and append the 2 character variables to do the seek.
Seek Padl(nVar, 10) + cVar1 + cVar2
Alan

>Ok, my problem is that I have to move the pointer to a certain a record
>in a table depending on the values of three fields (1 numeric, 2
>characters). Now, I've only used seek in cases where the expression
>is very simple (just one field).
>My questions are: can I use seek in this case? what would be the
>expressions of the index and the seek command? If this is impossible
>with seek, can I use locate instead and use an index to speed the process?
>what would be the expressions for this case?
>which one is faster locate or seek?
>
>one more question, can I use locate recursively? something like this:
>
> locate for field=var1
> do while found()
> if field2='ncc'
> this.method_Using_LocateDoWhile_with_same_table(var2)
> endif
> enddo
>
>
>TIA
Previous
Reply
Map
View

Click here to load this message in the networking platform