×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Looking for proper embed point

Looking for proper embed point

Looking for proper embed point

(OP)
I am using Clarion 8.0. I have a form on which I have a browse list containing a list of PDF files which serves as a "pick list". One field on the form contains a choice from this browse list. I can use the BrowseReset method to position the browse list on the matching record (if a match exists), but I can only make this work by embedding the code in the Accepted embed point of a button control. I've set up the button merely to test the record positioning code - I don't really want to use a button.
What I would prefer to have happen is to have the proper record in the browse selected automatically once the window opens (i.e. using the code my test button currently executes), but have not been able to find the proper embed point to make this work. It seems it needs to be the step just before the window is ready for user interaction. I've experimented with more than a dozen possibilities with no luck.
Can anyone suggest the est embed point to accomplish this?
TIA

RE: Looking for proper embed point

It sounds like what you are looking for is a Locator. That's behaviour already built into the browse. It sounds like you already have the field you want to use as the locator. Right click on the browse, choose actions and browse box behaviour. Click on the Locator Behaviour button (which will be greyed out if your browse does not have a sort order, but I assume you do). Change the locator type to Entry, and use the control you already have set up as the new locator control.

When you put a value in that field and press enter you will be placed on that item, or on the nearest item if it exists. You can prefill it on entering the window if you like.

RE: Looking for proper embed point

Getting the browse set to a prefilled value is not obvious.

Towards the end of the window.init, put (replace the bits in angle brackets to suit) :
<BRW5::Sort0:Locator>.SetShadow('<your starting value>')
post(event:accepted,<?yourlocatorcontrol>)

RE: Looking for proper embed point

(OP)
Jon -
Thanks for your responses. Your idea almost worked for me :)
I hadn't set up a locator (more on that later), as I really wanted to get the browse list's record located without user intervention (hence my reference to having the record located "automatically").
But, I added a locator control to try your solution, but it only worked about 99% of the time. Every so often, it would "miss" the expected value by 1 position -- it would select the record above the expected one. Could not figure out why. Strange that it worked when it did.
But, your idea brought me to a solution that works ever time: I had written this code and put it on the Accepted embed point of a button, just for testing purposes:
PDF:FileName =RecVar:FileNameOnly)
If Access:PDFRecipeFiles.Fetch(PDF:ByFilename) = Level:Benign
BRW:PDFFileList.ResetFromBuffer
.
That works, but I didn't want to have to click that button every time the window opened. BUT, your solution reminded me about posting the accepted event to a control. So, at the end of the Init embed point, I added Post(Event:Accepted, ?Button:LocateFile), then hid the button control. Works like a charm.
Thanks again for your help. I hadn't ever used Tek-Tips before - glad to see there's still an active Clarion forum available.
Happy Holidays!

RE: Looking for proper embed point

Not really active, I was just here by chance looking at something that someone else had referred to.

You're much more likely to get help on the newsgroups on the clarion server @ news.softvelocity.com,

or the other place that is active is Clarionhub: https://clarionhub.com/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close