Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browse - Incremental Locators - How do I use it with date searches? 1

Status
Not open for further replies.

rleiman

Programmer
May 3, 2006
258
US
Hi Everyone,

I have a browse window that allows the user to sort all of the columns by clicking on the listbox headers. When the user clicks a header the locator allows the user to type using an incremental locator. One of these fields is a date field with the format @d8-.

When I type a date like 12 JUN 2006 the locator finds
3 Feb 2003 which is also the first non null value in date order.

Can you tell me how to use it in date order so I can tell this to the user?

By the way, all of this is set up without any additional coding using just the ABC templates.

Thanks.

Emad
 
Hi Emad,

Dates are stored as numbers and hence should be located with ENTRY locators only. Also, try typing in 12/06/2006.

Regards
 
Hi ShankarJ,

I tried typing the date with the forward strokes but it still did not locate it as an entry locator. Entry and Incremental locators work on all the other columns which include both numeric and character ones.

Could this be a bug?

Thanks.

Emad
 
Hi Emad,

If I am correct, only certain DATE Picture types are recognized for entry. I am not sure @d8 is one of them. Try changing the format of the Date in the List Box to @D6 and see if it makes a difference. Either way Incrememtal Locators for Date Columns are a bad idea. Entry Locators is the better option.

Regards
 
Hi ShankarJ,

I will try the @d6 later.

Thanks.

Truly,
Emad
 
Hi Emad,

I just checked the Incremental Locator on a Browse with Column Sorting against an ISAM database as well as a SQL database. Both do not locate but the SQL one returns a backend error as well. I guess SV needs to tweak the LocatorClass or BrowseClass to recognize the Column format and do a locate on a Date or Time Column ONLY if it is valid date or time. If I am able to do something I shall post it here.

Regards
 
Hi ShankarJ,

Thanks for investigating the problem.

By the way, I am using Topspeed tables.

Truly,
Emad
 
Hi Emad,

This is what I did. Create a Local variable called SEL:Locator and populate it on the window. In the Browse Definition change the Locator to Entry and override the internal locator and assign SEL:Locator. Then in the BRW1.SetSort method add after Parent call enter the following code :

C# = BRW1::SortHeader.GetSortOrder()
IF C#
?SEL:Locator{PROP:Text} = ?Browse{PROPLIST:picture, C#} ; DISPLAY(?SEL:Locator)
END

This will make sure that the Picture format of the Locator Control always matches the Column Picture format.

Try it out.

Regards
 
Hi ShankarJ,

Wow! Thanks for the code.

I will put your idea into the program.

Truly,
Emad
 
Hi Emad,

Forgot to mention. SEL:Locator is a STRING(20).

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top