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
 Origin Forum
 Script execution
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Catilina

Germany
Posts

Posted - 01/06/2004 :  05:05:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I have a worksheet with the date in one column and the time in another column. How do I combine both datasets into one column?

I'm using Origin 6.1.
In the knowledge database I've found a script:

getn
(Column number for date: ) date
(Column number for time: ) time
(Get column numbers);
wcol(date)+=wcol(time);
wks.col$(date).format=4;
wks.col$(date).subformat=10;

But it doesn't work. The error messages are:

Syntax Error on GETNUMBER command!
Usage: open getnumber (text1) var1 (text2) var2 .. (title)

WCOL(DATE)+=wcol(time) is a built-in function that can not be renamed

Does anybody know what's wrong?

Thanks, Catilina

Mike Buess

USA
3037 Posts

Posted - 01/06/2004 :  08:44:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Catilina,

The syntax error suggests that you are executing the getn command one line at a time from the script window. Instead you should highlight the entire script and then press Enter.

Mike Buess
Origin WebRing Member
Go to Top of Page

Catilina

Germany
Posts

Posted - 01/06/2004 :  10:24:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike,

The first error message disappears, but the second still remains.
What else can I do?

Sabine
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/06/2004 :  4:02:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That error will result when the date and time variables are not defined or are defined incorrectly. They should be the column numbers of the date and time columns. You are supposed to enter them in getn dialog. If column 1 has the dates and column 2 has the times you can skip the getn dialog like this...

date=1;
time=2;
wcol(date)+=wcol(time);
wks.col$(date).format=4;
wks.col$(date).subformat=10;

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