Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Incremental search on numeric
Message
 
To
05/04/2003 04:01:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00774073
Message ID:
00774467
Views:
17
>>>>>>How might one go about this?
>>>>>>The field is: SkNo N(4,0)
>>>>>>
>>>>>>Index on SkNo Tag SkNo
>>>>>>Index on STR(SkNo,4,0) Tag SkNoA
>>>>>>
>>>>>>Data:
>>>>>> 250
>>>>>> 350
>>>>>> 680
>>>>>>6500
>>>>>>
>>>>>>Letting the user type, seek on the tag SkNo requires the full number to be typed; seek on the tag SkNoA brings you to 6500 before 680. What index could be created to get to 680 first and 6500 second?
>>>>>>
>>>>>>Thanks,
>>>>>
>>>>>padl(num,width,'0') ?
>>>>>Cetin
>>>>
>>>>Cetin,
>>>>
>>>>I thought about this. Wouldn't this then force the individual to type leading 0's?
>>>
>>>Yes, but would mean more meaningfull to them too. You could pad behind the scenes ?
>>>Cetin
>>
>>I almost feel like I should be using LOCATE FOR AllTrim(Str(SkNo,4,0)) with the order set to the SkNo tag. I'm just wanting the incremental searches to all be approximately the same speed.
>
>Tracy,
>Sorry I was late yesterday. Here's roughly what I meant saying 'padl() behind the scenes' :
>
>
>oForm = Createobject('MyForm')
>oForm.Show
>Read Events
>
>Define Class myform As Form
>  DataSession = 2
>  Top = 0
>  Left = 0
>  Height = 289
>  Width = 312
>  DoCreate = .T.
>  Caption = "Form1"
>  Name = "Form1"
>
>  Add Object text1 As TextBox With ;
>    Height = 23, Left = 84, ;
>    Top = 24, Width = 100, Name = "Text1"
>
>  Add Object grid1 As Grid With ;
>    ColumnCount = 1, Height = 204, ;
>    Left = 84, Panel = 1, ;
>    RecordSource = "sorttest", ;
>    Top = 60, Width = 176, ;
>    Name = "Grid1", ;
>    Column1.ControlSource = "sorttest.skno", ;
>    Column1.Width = 136, ;
>    Column1.Name = "Column1"
>
>  Add Object label1 As Label With ;
>    Caption = "Search", ;
>    Height = 17, Left = 12, Top = 24, ;
>    Width = 40, Name = "Label1"
>
>  Procedure Load
>  Create Cursor SORTTEST (SKNO i)
>  For ix=1 To 100000
>    Insert Into SORTTEST Values (ix)
>  Endfor
>  Locate
>  Index On SKNO Tag SKNO
>  Index On Padl(SKNO,10,'0') Tag SKNOA
>  set order to 0 && Intensify we don't need it to be current order
>Endproc
>
>  Procedure text1.InteractiveChange
>  =Seek(Padl(Trim(This.Value),10,'0'),'sorttest','sknoa')
>  With This.Parent.grid1
>    .Tag = Trans(Recno())
>    .Refresh()
>  Endwith
>Endproc
>
>  Procedure grid1.Init
>  This.SetAll('DynamicBackColor',;
>    'iif(RECNO()=VAL(this.Tag),RGB(0,255,255),RGB(255,255,255))')
>  This.Column1.header1.Caption = "SkNo"
>Endproc
>  Procedure QueryUnload
>  Clear Events
>Endproc
>Enddefine
>
Cetin

Cetin,

This doesn't accomplish what I am looking todo.
I want to type 6 and goto 680 first and 6500 second.

Tracy
Tracy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform