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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Read object name

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
tib Posted - 03/05/2003 : 05:52:02 AM
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.
5   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 10/03/2005 : 07:06:02 AM
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
roland.som Posted - 10/03/2005 : 04:02:53 AM
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
marko Posted - 03/17/2003 : 05:06:57 AM
Well, and what to do in Origin 6.1 Pro?
Marko

rlewis Posted - 03/13/2003 : 1:44:33 PM
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());
}
}
Laurie Posted - 03/12/2003 : 10:32:22 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000