The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Read object name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tib

Switzerland
105 Posts

Posted - 03/05/2003 :  05:52:02 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
is there a possibility to read back an object name?
It's possible to read the text,
e.g. like a button with
%A=this.text$;
type The text on this button is %A;

I was looking for something like:
%A=this.name$;
type You pressed on %A;
but it seems not to be possible. But is there a way?
Thanks,
Tilman.

Laurie

USA
404 Posts

Posted - 03/12/2003 :  10:32:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
object.name$ will set the object name but you can not Read it back. Maybe you can explain why you need this and we can think of a work around method.

OriginLab Technical Support
Go to Top of Page

rlewis

Canada
253 Posts

Posted - 03/13/2003 :  1:44:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you are running Origin 7, you can use OriginC ...
The following example was lifted from the Help-Programming section

// For this example to run, a graph window with the name "Graph1" must exist in the project.
void run_GraphObject_GetName()
{
// Create and attach a graph layer from "Graph1":
GraphLayer gl("Graph1");
GraphObject grobj;
// Loop over all the graphic objects in the layer and for each of them
// display its name:
foreach (grobj in gl.GraphObjects)
{
out_str(grobj.GetName());
}
}
Go to Top of Page

marko

Germany
112 Posts

Posted - 03/17/2003 :  05:06:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Well, and what to do in Origin 6.1 Pro?
Marko

Go to Top of Page

roland.som

Switzerland
9 Posts

Posted - 10/03/2005 :  04:02:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I have the same problem than tib, I need to get the object name.

I created a vertical line on a graph window using the draw command and then I wrote a script in the label control window, which redraws the line at a given position each time the user moves the line (Script, run after "Moved"). The problem is that I can not set the new x position with the "this.x" property, it just does not work. I have to use the "draw -n ObjectName -l -v NewX" command, and for this, I need the object name.

If I have more than one of those vertical lines, I would have to modify the script of each object manually...

Any suggestions about how to redraw the line without knowing its name?

Thanks, Roland
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 10/03/2005 :  07:06:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Roland,

It seems like you already have one solution... name the line yourself by creating it with draw -n MyLine. Another solution is to select the object with the mouse and use the labtalk command select -g O to assign its name to the string variable %O.

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000