Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INDEX on Cursor (How to do) ?
Message
 
To
04/08/2003 13:16:14
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00816541
Message ID:
00816739
Views:
27
Donald,
As the others have said the Index on statement should use the Tag option so that the index is deleted with the cursor. Assuming the no other indexes are set up in other places in your code then the interactive change should use the correct index. I prefer to specify both the table and the index that way when I'm reading through my code I know exactly what is being searched for (especially here where the index order is being set in a different method).
INDEX ON ti_num TAG ti_num

=SEEK(.txtSrch.value, "DD_TASKINFOGrd", "ti_num")
but hey that's just my preference.
HTH
Caroline

>Caroline,
>
>Will the following code use the INDEX (see InteractiveChange() method)?
>
>form_Task.scx
>===============
>Init()
> SELECT ti_num, ti_type, ti_brief, ti_task, ti_incr, ti_rev, ti_id ;
> FROM DD_TASKINFO ;
> INTO CURSOR DD_TASKINFOGrd
> INDEX ON ti_num TO ti_num
>
> Thisform.grdSrch.RecordSource = "DD_TASKINFOGrd"
> Thisform.grdSrch.COLUMN1.ControlSource = "DD_TaskINFOGrd.ti_num"
> Thisform.grdSrch.COLUMN2.ControlSource = "DD_TaskINFOGrd.ti_brief"
> Thisform.grdSrch.COLUMN3.ControlSource = "DD_TaskINFOGrd.ti_rev"
> Thisform.grdSrch.COLUMN4. ....
> Thisform.grdSrch.COLUMN5. ....
> Thisform.grdSrch.COLUMN6. ....
> Thisform.grdSrch.COLUMN7. ....
>
>*!*// Adjoining TextBox for incremental search of Grid
>txtSrch.InteractiveChange()
> SELECT DD_TASKINFOGrd
> WITH thisform
> =SEEK(.txtSrch.value)
> IF EOF()
> GO BOTTOM
> ENDIF
> .grdSrch.valid()
> ENDWITH
Caroline
Previous
Reply
Map
View

Click here to load this message in the networking platform