|
| Table Functions |
 |
Sun, 9 Mar 2008 09:42:12 +1100 |
I just discovered the table functions in Ventura. One of them in particular,
DAYS360 (which calculates the number of days between two specified dates)
would be invaluable to me if only it had a wider range of dates! I
understand that it only works for the years 1900-2099. My question is this:
is it possible to extend this range somehow (by the use of a script, for
example)? If there is a script, where do I find/buy it? I am working on a
project, which is primarily based in the 19th century, so dates down to 1800
would be very useful to me. Up until now, I have been using my trusty old HP
19BII calculator, but I would prefer something like DAYS 360 within Ventura,
if I could.
Apologies for the comparison-shopping, but could one of you InDesign CS3
users tell me if it has a similar function to DAYS360?
|
| Post Reply
|
| Re: Table Functions |
 |
Tue, 11 Mar 2008 09:09:34 -060 |
Here's a simple script I just wrote (easy to modify for your needs). (You can
edit it in Notepad if you don't have the Corel Script editor installed.)
If you have a table with at least 3 columns, place a date in one column, another
in the next column, and plant your cursor in the third. This script will replace
the first paragraph in the cell with the number of days from the first to the
second date.
-- Eric
[C_TECH Volunteer]
Check out the Ventura FAQ at:
http://www.draw.nu/venturafaq/
or download a PDF copy at:
http://www.fhcomm.com/VenturaFAQ.pdf
|
| Post Reply
|
 |
| Re: Table Functions |
 |
Wed, 12 Mar 2008 07:51:46 -060 |
bbsydney wrote:
> I have not tried it, so perhaps I should not be asking yet, but will this
> script self-update the result if one of the dates is changed, or will it
> need to be run again?
No. There's no way to add a table function to Ventura. The script literaly just
looks in the previous two cells and puts the difference into the third.
Also, can it be applied to a column of cells in a long
> table, to perform the calculations without having to run the script
manually
> on a row after row after row basis?
It could be modified to do this pretty easily. Wait, I've got a better
idea.......Here the attached script will insert values for all cells you have
selected.
-- Eric
[C_TECH Volunteer]
Check out the Ventura FAQ at:
http://www.draw.nu/venturafaq/
or download a PDF copy at:
http://www.fhcomm.com/VenturaFAQ.pdf
|
| Post Reply
|
 |
| Re: Table Functions |
 |
Wed, 12 Mar 2008 10:49:33 +110 |
Thanks for the script, and for the effort in writing it! It works very well.
A couple of questions though:
There seems to be no problems when it comes to calculating the number of
days within a few years of each other. Leap years, however, introduce errors
over longer periods of time. For example, according to the script, March 12,
1877 to March 12, 2008 = 47847days. According to my HP 19BII calculator =
47815days. (32days less, presumably due to a leap year every 4 years) Can
this be solved somehow?
I have not tried it, so perhaps I should not be asking yet, but will this
script self-update the result if one of the dates is changed, or will it
need to be run again? Also, can it be applied to a column of cells in a long
table, to perform the calculations without having to run the script manually
on a row after row after row basis?
|
| Post Reply
|
| Re: Table Functions |
 |
Wed, 12 Mar 2008 14:45:55 +110 |
Please disregard my previous post about questioning this script, when it
comes to leap years. It is accurate!! I should have read my HP 19BII manual,
before sending it. As it turns out, my calculator supports 3 different ways
of calculating the number of days:
360D (uses a 360 day calendar based on 30 day months)
365D (uses a 365 day calendar but ignores leap years)
DAYS (uses an actual calendar and recognises leap years)
So, in my previous example of March 12, 1877 to March 12, 2008 the days are:
360D = 47160 days
365D = 47815 days
DAYS = 47847days
My questions in the final paragraph still stand, however, and are open to
comment.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|