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
 Forum for Origin C
 Link to variables state

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
jdf726 Posted - 10/09/2012 : 07:00:17 AM
i am having a problem programatically inserting labels that contain references to worksheet data.

my code loads (from a configuration file) some text which contains references to data from a worksheet.

i used the createtextlabel function from this page http://www.originlab.com/forum/topic.asp?topic_id=8001

to create a label with this text.

the label contains stuff like %(info,"date",1), which (should) load in values from certain cells in the 'info' workbook. this works fine when i do it manually as long as the 'link to variables' checkbox is engaged in the programming control panel. the problem is, my newly created labels have this checkbox cleared.

how do i create a new label and ensure that its contents will be linked to variables?







origin 8.5.0 sr1, windows
7   L A T E S T    R E P L I E S    (Newest First)
declan.frost@yahoo.com Posted - 10/16/2012 : 03:04:55 AM
Joomla!'s built in session handling capabilities make it easy to retain values of certain variables across page accesses. This makes development much simpler because the developer no longer has to worry about losing variable values if it is left out of a form. Storing variables with sessions also makes the application cleaner and tidier since it reduces the amount of form variables, and persistent variables no longer have to be passed in either the query string (making very long URLs) or in POST variables.

http://annapolisdentalcare.com/extractions_arnold_dental_extractions_annapolis_anne_arundel_county_md.php


Penn Posted - 10/10/2012 : 05:24:09 AM
Hi,

Because different object will have different format tree, there is no document for each object's format tree currently. As I mentioned before, you need to use the GetFormat method to get the format tree, and then set a break point to see the structure of the tree for the used object.

Penn
jdf726 Posted - 10/10/2012 : 05:16:26 AM
Oh yeah, one last thing.
Is the LinkToVars option documented somewhere? (along with the rest of the 'tree' structure)

I thought I searched both the web and the origin documentation for this subject and I didn't find anything. Maybe I didn't look in the right places.

Penn Posted - 10/10/2012 : 05:14:16 AM
Hi,

Yes, you can also use the LabTalk command.

About the links problem, it is case sensitive, that is my mistake, and sorry for that. Now I fix the links in my previous reply, you can check again.

Penn
jdf726 Posted - 10/10/2012 : 05:01:29 AM
Thanks for the suggestion, I'll try that out.

In the short term, I resorted to executing the labtalk 'label' command via originc including the 'link to variables' flag '-sl'.
I then used the -px positioning command in the label labtalk command to get the positioning roughly right.

The link that you included on the positioning units doesn't seem to load. I found the page that you suggested manually though, thanks.

http://ocwiki.originlab.com/index.php?title=OCGuide:Creating_and_Accessing_Graphical_Objects#Setting_Position_and_Size

Is the 'title' URL argument in the wiki index.php page case sensitive? (the 'working' url had different capitalisation).

Cheers

jdf726


Penn Posted - 10/09/2012 : 11:31:08 PM
Hi,

Fo enable the "link to variables" checkbox, you can use the format tree, such as:

Tree tr;
tr.Root.LinkToVars.nVal = 1;
if(go.UpdateThemeIDs(tr.Root) == 0)
{
        go.ApplyFormat(tr, true, true);
}

For more details about format tree, you can use the GetFormat method to get the format tree, and then set a break point to see the tree contents.

For the unit issue, you can refer to this page.

Penn
jdf726 Posted - 10/09/2012 : 07:50:30 AM
here is the function call

i = createtextlabel('titletext', 10, 10, titletext, -1, 20);

as far as i understand the parameters are:
the 'handle' of the label to be created (object name).
the coordinates of the label, i am not sure what the units are though ;-)
the contents of the label
the typeface and font size.

one thing that is odd is that the handle text that i have specified above gets replaced with a 'thorn' character (which i recognise from when my wife was a historian), which is character alt+0254.

maybe its a bad idea to make the label name the same as the originc that holds the variable contents...

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