DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

sqr() function calculates the square root, not square

DIAdem 2020

 

I noticed that the sqr() function calculates the square root, not the square.  The pop-up help says that sqr() calculates the square root, but the help document states it calculates the square (vbs function).  The Square() alias is in the help file, but doesn't exist.  You can still calculate the square of a number using 4^2.

 

Call LogFileWrite("sqr(4) = " & Str(sqr(4),"AutoAdj"))

Result:  sqr(4) = 2

 

DIAdem already has the sqrt() function.

 

 

 

0 Kudos
Message 1 of 2
(1,801 Views)

Hey Mark,

 

Wow, you stumbled across a really old Help page that should be changed. A long Long LONG time ago, DIAdem used only Autosequence syntax, first everywhere, then in DIAdem 7.1 and beyond (when VBScript became the automation language) only in the Channel Calculator.  That's why the Help page shows ":=" in the formula syntax.  The Channel Calculator was switched over to using the VBScript evaluation engine over a decade ago, and since then any name overlaps/overloading between old DIAdem global command names and the native VBScript command names resulted in native VBScript command being called.  We really should retire the Help pages for those old commands you can only still use via calls to DIAdem's ActiveX server.

 

Sorry,

Brad Turpin

Principal Technical Support Engineer

National Instruments

0 Kudos
Message 2 of 2
(1,729 Views)