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!

BrowseObject.ResetFromBuffer

Status
Not open for further replies.

vaser

Instructor
Oct 24, 2007
4
GB
I need BrowseObjectResetFromBuffer()code from SnankarJ.
Thanks
vaser
 
Hi Vaser,

I do not understand.

The Browse Class is used to manage the ListBox in an ABC applications and it's ResetFromBuffer() method set the browse to display from the current record in the file buffer. As an example, let us assume that I'm doing a manual locate operation and SEL:Locator is the locator's local variable :

So, at the EVENT:Accepted of ?SEL:Locator, I will do :

OF ?SEL:Locator
CLEAR(POH:Record)

CASE SEL:SortBy
OF '2' ! Date
POH:Date = SEL:Locator
SET(POH:Key3,POH:Key3)
OF '3' ! Due Date
POH:Due_Dt = SEL:Locator
SET(POH:Key4,POH:Key4)
OF '4' ! Supplier
POH:Name = SEL:Locator
SET(POH:Key7,POH:Key7)
OF '5' ! Status
POH:Status = SEL:Locator
SET(POH:Key5,POH:Key5)
ELSE ! Number
POH:Ref = SEL:Locator
SET(POH:Key1,POH:Key1)
END

NEXT(POHEAD)
IF NOT ERRORCODE()
BRW:pOH.ResetFromBuffer()
END

SEL:Locator = '' ; DISPLAY(?SEL:Locator)

Hope this helps.

Regards

 
Hi Shankar,

Thank You for help, but I still have problem.
I have probably same problem like Emad with two entry locators (Your answer 28.march 2007).
I try to solve this - defining local variable SEL:Locator = CLIP(PEO:LastName) & ‘ ‘ & CLIP(PEO:FirstName) , defining Browse list and populating SEL:Locator on the Window. Selector not working satisfying to me : when I Typing just Last Name I see all PEOPLE with properly Last Name, but when I typing Last and First Name I lose locator capabilities. Can You help me?
Thanks!

VasEr

 
Hi Vaser,

What are your keys on the Table? Post your table structure and the code you are using to locate so that I can help you correctly.

Regards
 
Hi Shankar,
Sorry for late,
Here is example:
Dictionary:pEOPLE.dct
Tables:people.tps
Columns: ID(@n3), FirstName(@S20), LastName(@s20)
Keys: Key_ID(ID), Key_LastFirst(LastName, FirstName)
Locator: SEL:Locator(@s40) – formula:CLIP(SEL:LastName) & ’ ’ & CLIP(SEL:FirstName)
I wish to make browse Window like this:

Key_LastFirst ?
?(SEL:Locator) Hoskins B______
????????????????????????????????????????????????
ID ? Last and First Name
2 ? Ant Adam
3 ? Hoskins Alex
1 ??Hoskins Bob?

Thanks!
 
Hi Vaser,

Using a space separator between First & Last name will lead to problems if the Last Name has more than one word like "van Huesen". It's better to use a comma (,) separator i.e. Last Name, First Name. Assuming you are using the comma separator :

S# = INSTRING(',',SEL:Locator,1,1)
CLEAR(PEO:Record)
IF S#
PEO:LastName = SUB(SEL:Locator,1,S#-1)
PEO:FirstName = SUB(SEL:Locator,S#+1,LEN(SEL:Locator)-S#)
ELSE
PEO:LastName = SEL:Locator
END
SET(PEO:Key_LastFirst, PEO:Key_LastFirst)
NEXT(PEOPLE)

BRWn.ResetFromBuffer()

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top