Lotus Sandbox (1999-2007) <- domquery.info -> FeedBack & Questions
@Formula validator / evaluator

Sandbox sample submitted by Ragnar Schierholz.

A toolbar icon that validates formula syntax and evaluates formulas
Category:Tools
Audience:Application Developer
Product:Notes/Domino
Release:6.0 (5.0 with slight modifications)
Platform:All Supported Platforms
Date Posted:02/20/2003
File Name:FormualValidator.txt
File Size:492 bytes

Click here to download

Detailed Description:
This formula asks for a custom @formula as input and checks the syntax. If the formula is syntactically correct, it is being executed and the result is displayed. If not, the error message along with the column and the erroneous code snippet is displayed.

Since the original formula uses the new @CheckFormulaSyntax formula introduced with Notes 6, it won't run under R5. A stripped version is available for R5, with reduced functionality (i.e. no syntax check, thus clumsy error handling).

Code:
formula := @Prompt ( [OkCancelEdit]; "Evaluate"; "Enter a formula"; "" );
check := @CheckFormulaSyntax ( formula );
@If ( @Elements ( check ) = 1;
@Do (
result := @Eval ( formula );
@If ( @Elements ( result ) = 1;
@Prompt ( [Ok]; "Result"; @Text ( result ) );
@Prompt ( [Ok]; "Result"; @Implode ( result; " : " ) )
)
);
@Prompt ( [Ok]; "Errors in formula"; check[1] + " (" + check[3] + "): " +
check[6] )
)

Code for R5 (not tested):
formula := @Prompt ( [OkCancelEdit]; "Evaluate"; "Enter a formula"; "" );
result := @Eval ( formula );
@If ( @Elements ( result ) = 1;
@Prompt ( [Ok]; "Result"; @Text ( result ) );
@Prompt ( [Ok]; "Result"; @Implode ( result; " : " ) )
)




All Sandbox downloads are licensed as-is, unsupported, and non-warranted.

Review this download

Reviews
@Formula validator / evaluator (Submitted by Ragnar Schierholz - 20.02.2003)
comment Shift-F9 works, too! (Submitted by John L Smart - 26.02.2003)
rating: 4 stars Very Good (Submitted by Oliver Keim - 07.03.2003)
comment Correction - no R5 version possible (Submitted by Ragnar Schierholz - 25.02.2003)
comment Here's an agent to do this (Submitted by Grant R Lindsay - 06.03.2003)
rating: 4 stars very good (Submitted by Oliver Keim - 07.03.2003)
rating: 4 stars Modified for multiple re-use/troubleshooting (Submitted by Jonathan Hart - 13.02.2004)
[Replication or Save Conflict]


Document options
Print this page
Print view

 Search
Advanced Search

  Sandbox views
By Application Name
By Category
By Product
By Audience
By Date
By Submitter
Conferences

  Resources
developerWorks: Lotus Downloads
alphaWorks Downloads