Grabbing Highlighted Record from Browse 
Author Message
 Grabbing Highlighted Record from Browse

I have a window with a browse where the user can highlight a record,
click a button, and it marks that record by setting a byte value in
the database to 1. I'm doing this when the button is clicked:

   BRW1.UpdateViewRecord()
    MYF:FLAG = 1
    Relate:MyFile.Update()
   BRW1.ResetFromFile()

It seems pretty unreliable. Sometimes it will grab the correct record
and mark it properly. Other times it grabs an unmarked one at random
and marks that record.

Is there a better method that I should be using?

TIA

John



Thu, 17 Feb 2005 01:00:37 GMT  
 Grabbing Highlighted Record from Browse
I'm doing a
POST(EVENT:ScrollBottom,?Browse:1)
when the window opens. For some reason this is getting the queue
pointer and the file pointer out of sync. If I comment out the above
line, the  BRW1.UpdateViewRecord() method does grab the proper record.
Does anyone know a way around this?

TIA
John



Thu, 17 Feb 2005 21:17:57 GMT  
 Grabbing Highlighted Record from Browse
I think you want to use Choice(?List)

Quote:
> I'm doing a
> POST(EVENT:ScrollBottom,?Browse:1)
> when the window opens. For some reason this is getting the queue
> pointer and the file pointer out of sync. If I comment out the above
> line, the  BRW1.UpdateViewRecord() method does grab the proper record.
> Does anyone know a way around this?

> TIA
> John



Sat, 19 Feb 2005 23:43:52 GMT  
 Grabbing Highlighted Record from Browse
You forgot the FETCH(). Try this instead:

   BRW1.UpdateViewRecord()
   Access:MyFile.Fetch(TheKey)
    MYF:FLAG = 1
    Relate:MyFile.Update()
   BRW1.ResetFromFile()

--
--
Kind regards,
James Cooke
http://www.clarionfoundry.com - a concise technical reference for Clarion
Programmers
http://63.99.156.24/
=========================================


Quote:
> I have a window with a browse where the user can highlight a record,
> click a button, and it marks that record by setting a byte value in
> the database to 1. I'm doing this when the button is clicked:

>    BRW1.UpdateViewRecord()
>     MYF:FLAG = 1
>     Relate:MyFile.Update()
>    BRW1.ResetFromFile()

> It seems pretty unreliable. Sometimes it will grab the correct record
> and mark it properly. Other times it grabs an unmarked one at random
> and marks that record.

> Is there a better method that I should be using?

> TIA

> John



Tue, 01 Mar 2005 01:51:18 GMT  
 Grabbing Highlighted Record from Browse
UpdateViewRecord() brings the record buffer up to current already,
along with other buffers from joined tables, so a fetch shouldn't be
necessary.

On Thu, 12 Sep 2002 12:51:06 -0500, "James Cooke"

Quote:

>You forgot the FETCH(). Try this instead:

Jeff Slarve  
http://www.jssoftware.com


Tue, 01 Mar 2005 02:13:13 GMT  
 Grabbing Highlighted Record from Browse
John -

Perhaps a Browse.TakeScroll(Event:ScrollBottom) ?

On Sun, 01 Sep 2002 13:17:57 GMT, John

Quote:

>I'm doing a
>POST(EVENT:ScrollBottom,?Browse:1)
>when the window opens. For some reason this is getting the queue
>pointer and the file pointer out of sync. If I comment out the above
>line, the  BRW1.UpdateViewRecord() method does grab the proper record.
>Does anyone know a way around this?

Jeff Slarve  
http://www.jssoftware.com


Tue, 01 Mar 2005 02:15:57 GMT  
 Grabbing Highlighted Record from Browse
Jeff,

Quote:
> UpdateViewRecord() brings the record buffer up to current already,

I recently discovered that only the fields in the view were
updated in the buffer. Fields _not_ in the view contain
information from other records. Nice way to trash your file:
   BRW1.UpdateViewRecord()    !10 out of 100 fields are now
   MYF:FLAG = 1                       ! plus 1<g>
   Access:MyFile.Update()           !89 other fields trashed

--

Best regards,
Maarten
CDD3.1, C5EEb - ABC & C5.5.04EE
Certainly Clarion Developer



Tue, 01 Mar 2005 02:46:10 GMT  
 Grabbing Highlighted Record from Browse
This is {*filter*}. Does that mean a fetch DOES have to be done.

Ed Campbell


Quote:
> Jeff,

> > UpdateViewRecord() brings the record buffer up to current already,
> I recently discovered that only the fields in the view were
> updated in the buffer. Fields _not_ in the view contain
> information from other records. Nice way to trash your file:
>    BRW1.UpdateViewRecord()    !10 out of 100 fields are now
>    MYF:FLAG = 1                       ! plus 1<g>
>    Access:MyFile.Update()           !89 other fields trashed

> --

> Best regards,
> Maarten
> CDD3.1, C5EEb - ABC & C5.5.04EE
> Certainly Clarion Developer



Tue, 01 Mar 2005 03:20:43 GMT  
 Grabbing Highlighted Record from Browse
Maarten -

Although I don't write to the record in this manner, I do use
UpdateViewRecord() all of the time, and it has very reliably brought
the record buffer up to date. Maybe there's something different about
how we use it or where.



Quote:
>Jeff,

>> UpdateViewRecord() brings the record buffer up to current already,
>I recently discovered that only the fields in the view were
>updated in the buffer. Fields _not_ in the view contain
>information from other records. Nice way to trash your file:
>   BRW1.UpdateViewRecord()    !10 out of 100 fields are now
>   MYF:FLAG = 1                       ! plus 1<g>
>   Access:MyFile.Update()           !89 other fields trashed

Jeff Slarve  
http://www.jssoftware.com


Tue, 01 Mar 2005 03:23:24 GMT  
 Grabbing Highlighted Record from Browse
Hi Jeff,

Quote:
> Although I don't write to the record in this manner,

Neither do I;) I was just illustrating something.

Quote:
> UpdateViewRecord() all of the time, and it has very reliably

I detected it in a print procedure. Lets say it is an invoice.
I have a window with two browses, the InvoiceHeader
and the InvoiceItems and added the BrowsePrintButton
to InvoiceItems. In the 'before generated code'-embed
of the print-button I do a UpdateViewRecord() for the
InvoiceHeader file, since I need that for the Invoice-Report.
All InvoiceHeader-fields populated on the invoice that
were "Hot" in the InvoiceHeader-browse were correct,
all InvoiceHeader-fields that were *not* "Hot" were from
another InvoiceHeader-record.

Note: This does not proof that UpdateViewRecord() does
not work reliably. It can very well be that, between my
printbutton-embed and the actual call (which goes via the
ABC-classes), the ABC-classes messes around with my
InvoiceHeader buffer (?).
But, in the scenario described above, UpdateViewRecord()
does not lead to the expected result.

--

Best regards,
Maarten
CDD3.1, C5EEb - ABC & C5.5.04EE
Certainly Clarion Developer



Tue, 01 Mar 2005 04:13:15 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. C4b ABC - Find and highlight a certain record in a child browse

2. Moving a browse highlight bar to a record

3. Starting browse highlighting the last record

4. Deleting Highlighted Record in Browse

5. Highlight first record on the browse

6. Set highlighted record to top of browse box after locate

7. How To restrict child browse to selected parent browse record

8. how can I make the browse automatically seleect the last record in a browse

9. Color a record in a browse list box by condition of the field in that record

10. Grab records/write to file in AWK

11. Highlighted record

12. Block highlighting in a browse

 

 
Powered by phpBB® Forum Software