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
 Save a Table to be Used in Multiple Graphs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Mulvenna

Germany
46 Posts

Posted - 08/16/2013 :  08:47:01 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I currently have a script that outputs about 30 pdfs. I am trying to minimize the length of the script. A huge portion is taken up by making and filling tables for each output file even though there are actually only three different tables.

Is there a way of creating a table, saving it and simply inserting it when required instead of having to remake the table every time?

Thanks

greg

USA
1378 Posts

Posted - 08/26/2013 :  10:05:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Since table objects on a graph create a link to an actual Worksheet, it would be problematic to add the same link to multiple graphs.

Maybe having the code to create a table, position it and fill the values would be useful:

// This creates the table object on your graph
add_table_to_graph cols:=3 rows:=2 title:="My Table 1" tab:=tablename$;
// Sample positioning - top left of layer
%(tablename$).x = X1 + %(tablename$).DX / 2;
%(tablename$).y = Y2 - %(tablename$).DY / 2;
// Get named object into shorter string register
%A = tablename$;
// Now fill the table
for(tcol = 1;tcol <= 3;tcol++)
{
for(trow = 1;trow <= 2;trow++)
{
%B = Row $(trow), Col $(tcol);
%A!cell(trow,tcol)$=%B;
}
}
// Refresh
doc -uw;
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