Jump to content
Developer Wiki and Function Reference Links ×

Get handle of known field value


michaelk

Recommended Posts

I'd try one of the ForEach calls with something very similar to the example in function reference under GetRField that said "IF GetRField = FieldValueMeLookFor THEN HandleToObjectMeLookFor := H".

If you used ForEachObject you could restrict the number of objects queried with some sort of Criteria filter. Possibly by PIO name, since if you know the value you're looking for you probably also know the name of the object it's attached to.

The 'record' parameter in GetRField(h,record,field) is the PIO's name, and field name is... well usually it's the name of the field you see in OIP.

I haven't been around much lately so there's a pretty good chance I've forgotten something, but there's plenty of other posters who'll know this routine. Hopefully they're enjoying a lovely Labour Day weekend. Just thought I'd give you something to start with until one of them comes along.

Link to comment

Charles got it pretty close.

Procedure GetObjectFromRecord;



Procedure DoIt(DoItHandle :Handle);
Begin
	Message(Date(2,2),' The Handle to the object is ',DoItHandle);
	SetSelect(DoItHandle);
End;

Begin
ForEachObject(DoIt,(('MK_Format'.'MK_Text'='Circle')));
End;

Run(GetObjectFromRecord);

The above code will loop through each object that has the specific record value. It is up to you to make sure they are unique if you need a way to get just one.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...