Source language: Translate to:


Questions about using NeoBook's scripting language

Moderator: Neosoft Support


Postby Alex » Sat Dec 23, 2006 10:48 am


It is possible to have when in the AddressBook v5 there is Date of Birth, I entry the date and it calcls automaticaly the age ?


Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Gaev » Sat Dec 23, 2006 11:18 am


Files with the extension DBF are used to store database records in a specific format (dBase) ... the NeoBookDB plugin enables you to create, add, change and delete records in the database (dbf file) ... so there is no facility to do any calculations automatically ... but NeoBookDB allows you to do with record fields anything that you can normally do with NeoBook [variables] ... e.g. SetVar "[myDBF.FName]" "Alex".

You don't say what you mean by "age" ... is it in Years, Months and days or just in "Number of Days" ? ... the former can be accomplished by coding your own subroutine (comparing days, months and years separately) ... for the latter, NeoBook has this convenient command ...
Code: Select all
DateToNum "date" "format" "variable"
... which (according to the Help file) ...
Convert a formatted date to a number that can be used in mathematical calculations. The result, a numeric date, represents the number of days since December 30, 1899.
... so you can use it

- against the "Date of Birth" field in your database record and store the result in [daysDOB]
- against "Today's Date" and store the result in [daysToday]
- subtract [daysDOB] from [daysToday] to get the the age in "number of days"
User avatar
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Alex » Wed Dec 27, 2006 4:14 am



Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest