Page 1 of 1

Does Neobook have a math library?

PostPosted: Mon Aug 22, 2016 8:56 am
by steelweaver52
Hello!

I'm wondering if Neobook has a library of mathematical functions. Examples might be sin(), cos(), tan(), ATAN2(), min(), max(), round(), sqrt(), random()...you get the picture.

Thanks!

---Tom Nally, New Orleans

Re: Does Neobook have a math library?

PostPosted: Mon Aug 22, 2016 12:22 pm
by Gaev
Tom Nally:
Examples might be sin(), cos(), tan(), ATAN2(), min(), max(), round(), sqrt(), random()


1) From the Help file for the Math command ...
Syntax:
Math "formula" "decimal places" "variable"

formula
A mathematical formula. The formula can include the following operators and functions: +, -, *, /, ^, Abs, Sin, Cos, Atan, Sqr, Sqrt, Round, Trunc.


2) Separately, NeoBook also provides a Random command

3) Please explain what kind of Min()/Max() results you need ... fields in Database Records ? ... elements in Arrayed Variables ? ... other ?

Re: Does Neobook have a math library?

PostPosted: Mon Aug 22, 2016 1:48 pm
by steelweaver52
Thanks, Gaev.

Usually, the arguments for min() and max() are a list of comma-separated items. (Or, as you suggested, it could be an array.)

But what would be most helpful would be for Neosoftware to publish a comprehensive list of all function available in the Neobook package, including math functions, string functions, financial functions, and any other kind.

I wouldn't expect Neobook to have all the functions of a computer algebra system. But if Neobook had the functions associated with most implementations of BASIC, it would certainly make it more useful to me.

Thanks again!

---Tom Nally, New Orleans

Re: Does Neobook have a math library?

PostPosted: Mon Aug 22, 2016 2:51 pm
by Gaev
Tom Nally:

But what would be most helpful would be for Neosoftware to publish a comprehensive list of all function available in the Neobook package, including math functions, string functions, financial functions, and any other kind.

Apart from the previously mentioned Math and Random commands, take a look in the Help File at the chapter labelled Action Command Reference... there is a section called Strings and another called Variables.

There are no built in Financial Functions within NeoBook.

Usually, the arguments for min() and max() are a list of comma-separated items. (Or, as you suggested, it could be an array.)

If you are familiar with Javascript (or VBScript), you can develop your own functions that you can then Call from within any of your publications.

Another way to perform functions using Javascript/VBScript is to deploy BrowserExecScript.

Re: Does Neobook have a math library?

PostPosted: Tue Aug 23, 2016 5:25 am
by steelweaver52
Thanks again, Gaev.

After looking around, I think it would be accurate to say that Neobook's documentation provides no comprehensive list of native functions.

Regarding Javascript, however, are you saying that any Math Object or Math function available in this list (below) is also available in Neobook by calling a Javascript script?

http://www.w3schools.com/jsref/jsref_obj_math.asp

---Tom Nally

Re: Does Neobook have a math library?

PostPosted: Tue Aug 23, 2016 11:07 am
by Neosoft Support
The help file topic titled "Action Command Reference" contains a list of actions commands supported by NeoBook's scripting language. The Math action can be used to perform basic calculations containing the following operators and functions: +, -, *, /, ^, Abs, Sin, Cos, Atan, Sqr, Sqrt, Round, Trunc. Parentheses and variables may also be used in formulas. For example:

Math "Cos(180)" "2" "[Result]"

There are also several math related plug-ins that may be helpful:

http://www.neosoftware.com/neobook/modules/plugins/singlefile.php?cid=5&lid=99

http://www.neosoftware.com/neobook/modules/plugins/singlefile.php?cid=15&lid=193

http://www.neosoftware.com/neobook/modules/plugins/singlefile.php?cid=5&lid=22

Re: Does Neobook have a math library?

PostPosted: Tue Aug 23, 2016 12:24 pm
by Gaev
Tom Nally:

After looking around, I think it would be accurate to say that Neobook's documentation provides no comprehensive list of native functions.

If you are saying that such a list is not documented in a single page in the Help File, you are correct ... but note that the kind of users that are attracted to NeoBook (citizen developers vs. programmer types) do not look for such "helicopter views" of the capabilities of a product ... their needs are more along the lines of "how do I accomplish this particular task" that I have just encountered.

Regarding Javascript, however, are you saying that any Math Object or Math function available in this list (below) is also available in Neobook by calling a Javascript script?

http://www.w3schools.com/jsref/jsref_obj_math.asp

The short answer is Yes ... if you read the Help File section (Menu Functions >>> The Options Menu >>> Function Library), you will see that the Call command can be used to "call a Function" ... and Functions can be coded in Javascript, VBScript and NeoBook commands ... and there are facilities to read/write NeoBook variables from within these Functions.