SEEK or WHAT.. the return of SEEK 
Author Message
 SEEK or WHAT.. the return of SEEK

My original post on the topic of using or not using SEEK.......

Subject:
SEEK .... or WHAT?
Date:
1999/08/18
Author:

I have looked for an example of code that will allow for doing a SEEK
but with 2 parameters. Like..
SEEK( var1, var2 )
so that var1 is found, the record pointer is in postion, and then the
next parameter is sought from that position forward, and upon finding
var2 then the record pointer points to the record that has both
parameters. The index file is indexed to employee number.
_______________________________________________

And I got some good ideas from the replies BUT, that has given rise to a
more pernicious problem.  Turns out that conceptually I can relate
building an index like so...

INDEX ON EMPNO+STR(DESCEND(DATE)) TO HOLIDAY1

then a SEEK will get the "right" record. BUT I need to also somehow
weave a NOT into the mix for an hours code... so I get the records by
EMPNO and by DATE, and finally by NOT certain hours codes.
psuedo code......
INDEX ON EMPNO+STR(DESCEND(DATE))+HRS_CODE!= ' w, x ,y z '

I could even use the unique clause to build an index of only those
records I wish too, let me know if I'm barking up the right conceptual
tree! I dont have much documentation on Clipper, that is part of my
problem. Books are hard to come by.
Any help appreicated.
Thanks for all the help!!!!

Henry Williams

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK

Quote:

> My original post on the topic of using or not using SEEK.......

> Subject:
> SEEK .... or WHAT?
> Date:
> 1999/08/18
> Author:

> I have looked for an example of code that will allow for doing a SEEK
> but with 2 parameters. Like..
> SEEK( var1, var2 )
> so that var1 is found, the record pointer is in postion, and then the
> next parameter is sought from that position forward, and upon finding
> var2 then the record pointer points to the record that has both
> parameters. The index file is indexed to employee number.
> _______________________________________________

> And I got some good ideas from the replies BUT, that has given rise to
a
> more pernicious problem.  Turns out that conceptually I can relate
> building an index like so...

> INDEX ON EMPNO+STR(DESCEND(DATE)) TO HOLIDAY1

> then a SEEK will get the "right" record. BUT I need to also somehow
> weave a NOT into the mix for an hours code... so I get the records by
> EMPNO and by DATE, and finally by NOT certain hours codes.
> psuedo code......
> INDEX ON EMPNO+STR(DESCEND(DATE))+HRS_CODE!= ' w, x ,y z '

> I could even use the unique clause to build an index of only those
> records I wish too, let me know if I'm barking up the right conceptual
> tree! I dont have much documentation on Clipper, that is part of my
> problem. Books are hard to come by.
> Any help appreicated.
> Thanks for all the help!!!!

> Henry Williams

Hey BrainBoy, it SET FILTER!!!!!!!!!!!!!!!!!!

But Wait I need...

SET FILTER TO HRS_CODE = "R" .OR. "F" .OR. "x"

and the compiler is puking on the line above.....

Anybody know how to do this the right way???

New to Clipper and Learning more everyday.

Henry Williams

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK
SET FILTER TO HRS_CODE="R" .OR. HRS_CODE ="F" .OR. HRS_CODE ="x"
Quote:



> > My original post on the topic of using or not using SEEK.......

> > Subject:
> > SEEK .... or WHAT?
> > Date:
> > 1999/08/18
> > Author:

> > I have looked for an example of code that will allow for doing a SEEK
> > but with 2 parameters. Like..
> > SEEK( var1, var2 )
> > so that var1 is found, the record pointer is in postion, and then the
> > next parameter is sought from that position forward, and upon finding
> > var2 then the record pointer points to the record that has both
> > parameters. The index file is indexed to employee number.
> > _______________________________________________

> > And I got some good ideas from the replies BUT, that has given rise to
> a
> > more pernicious problem.  Turns out that conceptually I can relate
> > building an index like so...

> > INDEX ON EMPNO+STR(DESCEND(DATE)) TO HOLIDAY1

> > then a SEEK will get the "right" record. BUT I need to also somehow
> > weave a NOT into the mix for an hours code... so I get the records by
> > EMPNO and by DATE, and finally by NOT certain hours codes.
> > psuedo code......
> > INDEX ON EMPNO+STR(DESCEND(DATE))+HRS_CODE!= ' w, x ,y z '

> > I could even use the unique clause to build an index of only those
> > records I wish too, let me know if I'm barking up the right conceptual
> > tree! I dont have much documentation on Clipper, that is part of my
> > problem. Books are hard to come by.
> > Any help appreicated.
> > Thanks for all the help!!!!

> > Henry Williams

> Hey BrainBoy, it SET FILTER!!!!!!!!!!!!!!!!!!

> But Wait I need...

> SET FILTER TO HRS_CODE = "R" .OR. "F" .OR. "x"

> and the compiler is puking on the line above.....

> Anybody know how to do this the right way???

> New to Clipper and Learning more everyday.

> Henry Williams

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK

Quote:

> Hey BrainBoy, it SET FILTER!!!!!!!!!!!!!!!!!!

> But Wait I need...

> SET FILTER TO HRS_CODE = "R" .OR. "F" .OR. "x"
> and the compiler is puking on the line above.....
> Anybody know how to do this the right way???

1. Filter is veeeeery sloooooow !
2a.  SET FILTER TO HRS_CODE $ "RFX"
2b.  SET FILTER TO ( HRS_CODE = "R" .OR. HRS_CODE = "F" .OR. HRS_CODE = "X" )

Sorry, I have not enough time, right now, to explaine how to do it with index.
I'll post it tomorrow.

Damir



Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK

Quote:

> INDEX ON EMPNO+STR(DESCEND(DATE))+HRS_CODE!= ' w, x ,y z '

INDEX ON EMPNO+STR(DESCEND(DATE)) FOR ! HRS_CODE $ "wxyz"
--
David G. Holm, Managing Member
Joint Software Development L.L.C
3134 Niles Rd  Suite D
St Joseph  MI  49085
(616)556-9600 Fax: 556-9950


Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK
Shouldn't you use .....DESCEND(DTOS(DATE)).....?
Fred Zuckerman

San Diego, CA, USA
Quote:
>INDEX ON EMPNO+STR(DESCEND(DATE)) FOR ! HRS_CODE $ "wxyz"



Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK


Quote:

> > INDEX ON EMPNO+STR(DESCEND(DATE))+HRS_CODE!= ' w, x ,y z '

> INDEX ON EMPNO+STR(DESCEND(DATE)) FOR ! HRS_CODE $ "wxyz"
> --
> David G. Holm, Managing Member
> Joint Software Development L.L.C
> 3134 Niles Rd  Suite D
> St Joseph  MI  49085
> (616)556-9600 Fax: 556-9950

Using..
INDEX ON EMPNO+STR(DESCEND(DATE)) FOR ! HRS_CODE $ "wxyz"

I get an errorC2005 Statement not recognized, match failed at 'FOR'

:(

H.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK

This did the trick.

INDEX ON EMPNO+STR(DESCEND(DATE)) TO HOLIDAY1
SET FILTER TO HRS_CODE="R".OR.HRS_CODE="F".OR.HRS_CODE="X"

:)

Henry

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK
I would consider adding a field that would indicate the hours code
status you are desiring. For instance, DAY_HOURS (or whatever it is
you're segregating) could be a one character code, "T" or "F" and then
you could index on DAY_HOURS + EMPNO + DESCEND( DTOS( DATE_FLD ) ).
That way, you could easily examine records that are Day Hours and those
that are not Day Hours. Of course, what you actually do may depend on
how critical it is to have this special view.

Richard


Quote:

> My original post on the topic of using or not using SEEK.......

> Subject:
> SEEK .... or WHAT?
> Date:
> 1999/08/18
> Author:

> I have looked for an example of code that will allow for doing a SEEK
> but with 2 parameters. Like..
> SEEK( var1, var2 )
> so that var1 is found, the record pointer is in postion, and then the
> next parameter is sought from that position forward, and upon finding
> var2 then the record pointer points to the record that has both
> parameters. The index file is indexed to employee number.
> _______________________________________________

> And I got some good ideas from the replies BUT, that has given rise
to a
> more pernicious problem.  Turns out that conceptually I can relate
> building an index like so...

> INDEX ON EMPNO+STR(DESCEND(DATE)) TO HOLIDAY1

> then a SEEK will get the "right" record. BUT I need to also somehow
> weave a NOT into the mix for an hours code... so I get the records by
> EMPNO and by DATE, and finally by NOT certain hours codes.
> psuedo code......
> INDEX ON EMPNO+STR(DESCEND(DATE))+HRS_CODE!= ' w, x ,y z '

> I could even use the unique clause to build an index of only those
> records I wish too, let me know if I'm barking up the right conceptual
> tree! I dont have much documentation on Clipper, that is part of my
> problem. Books are hard to come by.
> Any help appreicated.
> Thanks for all the help!!!!

> Henry Williams

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK
Partial cut & paste from original reply with a few mods.  I still
think rolling yer own seek function gives you the most flexibility.
And it's fun to play with codeblocks.

How about rolling yer own seek function?  Perhaps something like:

Example:
myseek(ctod("01/10/1999"),"EMPLOYEE","DATE_FLD",;
        {||EMPLOYEE->HRS_CODE!= ' w, x ,y z '})

function myseek(p1,file,field,bValid)
local ret:=.F.

if (file)->(dbseek(p1,.F.))
    while (file)->(field)==p1
        if eval(bValid)
            ret:=.T.
            exit
        endif
        skip
    end
endif
return ret

This function (off the top of my head & untested) will return .T. if
the first and second parameters are found, otherwise it will return
F..

HTH

Mike

Quote:

>My original post on the topic of using or not using SEEK.......

>Subject:
>SEEK .... or WHAT?
>Date:
>1999/08/18
>Author:

>I have looked for an example of code that will allow for doing a SEEK
>but with 2 parameters. Like..
>SEEK( var1, var2 )
>so that var1 is found, the record pointer is in postion, and then the
>next parameter is sought from that position forward, and upon finding
>var2 then the record pointer points to the record that has both
>parameters. The index file is indexed to employee number.
>_______________________________________________

>And I got some good ideas from the replies BUT, that has given rise to a
>more pernicious problem.  Turns out that conceptually I can relate
>building an index like so...

>INDEX ON EMPNO+STR(DESCEND(DATE)) TO HOLIDAY1

>then a SEEK will get the "right" record. BUT I need to also somehow
>weave a NOT into the mix for an hours code... so I get the records by
>EMPNO and by DATE, and finally by NOT certain hours codes.
>psuedo code......
>INDEX ON EMPNO+STR(DESCEND(DATE))+HRS_CODE!= ' w, x ,y z '

>I could even use the unique clause to build an index of only those
>records I wish too, let me know if I'm barking up the right conceptual
>tree! I dont have much documentation on Clipper, that is part of my
>problem. Books are hard to come by.
>Any help appreicated.
>Thanks for all the help!!!!

>Henry Williams

>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.



Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK

Quote:

>Partial cut & paste from original reply with a few mods.  I still
>think rolling yer own seek function gives you the most flexibility.
>And it's fun to play with codeblocks.

>How about rolling yer own seek function?  Perhaps something like:

>Example:
>myseek(ctod("01/10/1999"),"EMPLOYEE","DATE_FLD",;
> {||EMPLOYEE->HRS_CODE!= ' w, x ,y z '})

>function myseek(p1,file,field,bValid)
>local ret:=.F.

>if (file)->(dbseek(p1,.F.))
>    while (file)->(field)==p1
>        if eval(bValid)
>            ret:=.T.
>            exit
>        endif
>        skip
>    end
>endif
>return ret

>This function (off the top of my head & untested) will return .T. if
>the first and second parameters are found, otherwise it will return
>F..

>HTH

>Mike

Thanks for your reply. I have this project breathing down my neck, and
unfortunately it's a quick and dirty job. I was advised against trying to
error trap printer errors for example. This code has to work a little while
longer and then are updating to something WIN based.
So I haven't had the opportunity to explore the delicate topology of code
blocks. Hell I can't even use TBROWSE yet BUT I've only been at Clipper for
13 days now!
Like I said structured programming with no frills. AT ALL. Anyway the
project has about 20 different .prg files, tons of uncommented code (I like
to comment almost every line. I just do it when I 'm coding. It's easy
enough!)  and enough globals to make Einstein puke. But I'm glad to have the
project, it is a challenge.

Thanks again..

Henry



Mon, 04 Feb 2002 03:00:00 GMT  
 SEEK or WHAT.. the return of SEEK

Quote:

> Using..
> INDEX ON EMPNO+STR(DESCEND(DATE)) FOR ! HRS_CODE $ "wxyz"

> I get an errorC2005 Statement not recognized, match failed at 'FOR'

If you insist on index like this, try:
INDEX ON EMPNO+STR(DESCEND(DATE)) FOR !( HRS_CODE $ "wxyz" )

Damir



Tue, 05 Feb 2002 03:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Seeking routine to return elapsed wall-clock time

2. Seeking beta testers for Smalltalk ODBMS

3. seek wrapper for 11!:1 window previewer

4. APL employment opportunities sought

5. seek idioms for Emacs online J doc

6. Seek way to go from, say AV(y), to double e[][]

7. Seek help using lrx

8. seek advice on mac vs 486 for apl

9. Seek examples of lev and dex

10. Seek examples of lev and dex

11. Seeking examples of APL magic

12. Seek intermediate application using LinkJ

 

 
Powered by phpBB® Forum Software