Date Locator on browse - CW4 
Author Message
 Date Locator on browse - CW4

Does a browse support a locator on a date field/key? Mine doesn't work and
I haven't found one that does.

What is the best work around?

Thanks



Wed, 03 Oct 2001 03:00:00 GMT  
 Date Locator on browse - CW4
Quote:

> Does a browse support a locator on a date field/key? Mine doesn't work and
> I haven't found one that does.

Yes, for an entry locator. For incremental, when you enter the month as say
1 the code has no way of knowing if you mean Jan, Oct, Nov, or Dec so it
doesnt really work. Entry locator whats for all the info before jumping to
the record.
---
Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com


Wed, 03 Oct 2001 03:00:00 GMT  
 Date Locator on browse - CW4
Thanks for the reply Jim. I'm an old CPD 2 developer and the date locator
worked as expected there. I thought I may have been missing something.



Quote:


> > Does a browse support a locator on a date field/key? Mine doesn't work
and
> > I haven't found one that does.

> Yes, for an entry locator. For incremental, when you enter the month as
say
> 1 the code has no way of knowing if you mean Jan, Oct, Nov, or Dec so it
> doesnt really work. Entry locator whats for all the info before jumping
to
> the record.
> ---
> Jim Kane  - TeamTopSpeed
> Productive Software Solutions
> Can't Find that Message?
> Get Organized, Get ForKeeps!
> www.fkeeps.com



Thu, 04 Oct 2001 03:00:00 GMT  
 Date Locator on browse - CW4
G'day Ridge/Jim!



Quote:
>> Does a browse support a locator on a date field/key? Mine doesn't work and
>> I haven't found one that does.

>Yes, for an entry locator. For incremental, when you enter the month as say
>1 the code has no way of knowing if you mean Jan, Oct, Nov, or Dec so it
>doesnt really work. Entry locator whats for all the info before jumping to
>the record.

I had the same problem back in CW2. If you are using the Clarion
chain, and are willing to hack the templates, you can change
CTLBROW.TPW to achieve this. I have already re-hacked my C5 Clarion
templates, so I know this still works.

Search for the:
%InstancePrefix:AlertKey ROUTINE

Search down until you find:

        #IF(%BrowseLocatorType = 'Incremental')
        IF KEYCODE() = BSKey

Beneath this:
          IF %BrowsePrefix:LocatorLength
            %BrowsePrefix:LocatorLength -= 1
            %BrowsePrefix:LocatorValue =
SUB(%BrowsePrefix:LocatorValue,1,%BrowsePrefix:LocatorLength)
            %BrowseLocatorName = %BrowsePrefix:LocatorValue

Add this:
            IF %BrowsePrefix:LocatorValue[1] = '%%' THEN         !SPG
              YY# = %BrowsePrefix:LocatorValue[2:3]              !SPG
              MM# = %BrowsePrefix:LocatorValue[4:5]              !SPG
              DD# = %BrowsePrefix:LocatorValue[6:7]              !SPG
              %BrowseLocatorName = DATE(MM#,DD#,YY#)             !SPG
            END                                                  !SPG

Repeat in the section below this:
        ELSIF KEYCODE() = SpaceKey

and:
        ELSIF CHR(KEYCHAR())

Now, to set the locator, you can type %990418 to set the date to 18th
April 1999. The new code turns it back into a long, and retrieves and
correctly highlights the desired record, in date order. To make this
even better, you can work in with, say, the TinTools calendar control
to let the user pick a date off a calendar, then set the locator
string in the %YYMMDD format, and let the browse do the rest.

Oh ... and do make backups of CTLBROW.TPW and REGISTRY.TRF first.

HTH
--
Steve Greenwood (aka Lurch)
HiCaliber Software



Thu, 04 Oct 2001 03:00:00 GMT  
 Date Locator on browse - CW4
Hi,
    On the "Entry" locator, does one prevent the record from comming up
after they hit "Enter" instead of TAB?

Aditya


Quote:
> G'day Ridge/Jim!



> >> Does a browse support a locator on a date field/key? Mine doesn't work
and
> >> I haven't found one that does.

> >Yes, for an entry locator. For incremental, when you enter the month as
say
> >1 the code has no way of knowing if you mean Jan, Oct, Nov, or Dec so it
> >doesnt really work. Entry locator whats for all the info before jumping
to
> >the record.

> I had the same problem back in CW2. If you are using the Clarion
> chain, and are willing to hack the templates, you can change
> CTLBROW.TPW to achieve this. I have already re-hacked my C5 Clarion
> templates, so I know this still works.

> Search for the:
> %InstancePrefix:AlertKey ROUTINE

> Search down until you find:

>         #IF(%BrowseLocatorType = 'Incremental')
>         IF KEYCODE() = BSKey

> Beneath this:
>           IF %BrowsePrefix:LocatorLength
>             %BrowsePrefix:LocatorLength -= 1
>             %BrowsePrefix:LocatorValue =
> SUB(%BrowsePrefix:LocatorValue,1,%BrowsePrefix:LocatorLength)
>             %BrowseLocatorName = %BrowsePrefix:LocatorValue

> Add this:
>             IF %BrowsePrefix:LocatorValue[1] = '%%' THEN         !SPG
>               YY# = %BrowsePrefix:LocatorValue[2:3]              !SPG
>               MM# = %BrowsePrefix:LocatorValue[4:5]              !SPG
>               DD# = %BrowsePrefix:LocatorValue[6:7]              !SPG
>               %BrowseLocatorName = DATE(MM#,DD#,YY#)             !SPG
>             END                                                  !SPG

> Repeat in the section below this:
>         ELSIF KEYCODE() = SpaceKey

> and:
>         ELSIF CHR(KEYCHAR())

> Now, to set the locator, you can type %990418 to set the date to 18th
> April 1999. The new code turns it back into a long, and retrieves and
> correctly highlights the desired record, in date order. To make this
> even better, you can work in with, say, the TinTools calendar control
> to let the user pick a date off a calendar, then set the locator
> string in the %YYMMDD format, and let the browse do the rest.

> Oh ... and do make backups of CTLBROW.TPW and REGISTRY.TRF first.

> HTH
> --
> Steve Greenwood (aka Lurch)
> HiCaliber Software




Fri, 05 Oct 2001 03:00:00 GMT  
 Date Locator on browse - CW4
G'day Aditya!

On Mon, 19 Apr 1999 12:32:42 -0400, "Aditya Arora"

Quote:

>    On the "Entry" locator, does one prevent the record from comming up
>after they hit "Enter" instead of TAB?

I must admit my users have complained of the same thing, so now might
be a good time for me to tackle it too.

I suspect the trick lies in using ALIAS to set "Enter" to "Tab" when
the locator is Selected, and switch it back when Accepted.

Best Regards
--
Steve Greenwood (aka Lurch)
HiCaliber Software



Fri, 05 Oct 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Showing locator value on browse - CW4

2. Locator Fields in CW4

3. Locator in CW4 Beta 2 using Clarion File Driver

4. Date locator

5. Date field in Locator ??

6. Date as incremental locator

7. Date locator

8. Date locator in a SQL Table

9. Date as a locator?

10. Date Fields as Locators Fixed!

11. Date Fields as locators

12. Locator on a browse

 

 
Powered by phpBB® Forum Software