Alpha Video Training
Results 1 to 3 of 3

Thread: <tbl>.fetch_find() and goto()

  1. #1
    "Certified" Alphaholic
    Real Name
    Richard Coleman
    Join Date
    Oct 2000
    Location
    Franklin, TN
    Posts
    1,206

    Default <tbl>.fetch_find() and goto()

    The following is a quote from the chm.

    "If <TBL>.FETCH_FIND() is successful, the found record is retrieved and its Record_Number is returned. If no exact match is found, a negative number corresponding to the record number of the closest matching record is returned."

    I know that the correct record will be displayed on a form if the exact search date is found. And that it will bring up the 'first' exact match in the table according to the index sort order.

    BUT:

    My problem is with "closest matching record". Does that mean the next date in order in the table?

    If 'fetch_find' is asked to find a date and there is no exact date to match, in the table being searched; am I correct in assuming that it will find the next date in order (regular or inverted sequencing) and return that record number as a negative value. eg if rec # 456 is the next record after the search value then -456 would be returned.????? By using a trap method to catch the negative number, and then by using '<tbl>.fetch_goto(456)'; I can then get to that record.

    D

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default

    I just tested it and that is what I observed.
    Quote Originally Posted by dik_coleman
    The following is a quote from the chm.

    "If <TBL>.FETCH_FIND() is successful, the found record is retrieved and its Record_Number is returned. If no exact match is found, a negative number corresponding to the record number of the closest matching record is returned."

    I know that the correct record will be displayed on a form if the exact search date is found. And that it will bring up the 'first' exact match in the table according to the index sort order.

    BUT:

    My problem is with "closest matching record". Does that mean the next date in order in the table?

    If 'fetch_find' is asked to find a date and there is no exact date to match, in the table being searched; am I correct in assuming that it will find the next date in order (regular or inverted sequencing) and return that record number as a negative value. eg if rec # 456 is the next record after the search value then -456 would be returned.????? By using a trap method to catch the negative number, and then by using '<tbl>.fetch_goto(456)'; I can then get to that record.

    D

  3. #3
    "Certified" Alphaholic
    Real Name
    Richard Coleman
    Join Date
    Oct 2000
    Location
    Franklin, TN
    Posts
    1,206

    Default

    Ok, that's what I thought too.

    Try to run the script in the enclosed zip.
    No matter what date you enter (on correct weekday) it goes to the first record and the recno() is 1 not -1.
    Trapping for negative rec # does not work ----IN MY SCRIPT...

    Does that mean I have it right--- by no means, I could have many errors ..

    Just need an answer so I can trap for 'not correct' records.

    D

    forget it for now -- found the problem -- just a stupid mistake
    D
    Last edited by dik_coleman; 03-24-2006 at 01:49 PM.

Similar Threads

  1. tbl.fetch_find()
    By Zod Mansour in forum Alpha Five Version 6
    Replies: 2
    Last Post: 11-01-2004, 08:10 AM
  2. tbl.fetch_find()
    By Zod Mansour in forum Alpha Five Version 6
    Replies: 3
    Last Post: 10-20-2004, 01:24 PM
  3. fetch_find
    By geoff m in forum Alpha Five Version 5
    Replies: 6
    Last Post: 05-27-2004, 08:04 AM
  4. WANTED tbl.fetch_find() failure marker
    By Greg Fong in forum Alpha Five Version 4
    Replies: 2
    Last Post: 03-03-2002, 10:03 AM
  5. Cpy Flds in currnt tbl & post to other tbl
    By Danny Marx in forum Alpha Five Version 4
    Replies: 8
    Last Post: 08-24-2000, 10:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •