Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Combining complex @formulas with LotusScript

Gary Steele, Principal CLP and Senior Development Consultant , ITNET (UK) LTD
Gary Steele is a Principal CLP and Senior Development Consultant for ITNET (UK) LTD. ITNET is one of the UK's leading outsourcing suppliers of combined information technology, and business process management. They have specific experience in the local government, process manufacturing, retail, chemical and financial services sectors. Gary is currently working on a land registration project for one of the UK's largest city councils.

Summary:  This tip describes a form-based method for combining The @formulas with LotusScript. It works by creating a form called function worksheet that contains all the complex @formulas which is called by the LotusScript ComputeWithForm method.

Date:  02 Nov 1998
Level:  Advanced

Activity:  5385 views
Comments:  

The @formula language can do some wonderful things, but you may find times when you need to combine @formulas with LotusScript. A common solution is to either use the Evaluate keyword, or to rewrite the formula as a LotusScript function. However, although these solutions work well for simple or singular @functions, they can be difficult to code for complex multiple formulas (such as, "legacy" R3 macros) or nested @DbLookups that use their results to provide the parameters for further lookups.

This tip describes an easier, form-based method for combining the code. The way it works is that you create a form called "function worksheet" that contains all the complex multiple @formulas that you want to use with LotusScript in the database. The input fields should be editable fields, with defaults to Null. The output fields should be computed fields, and they should contain the complex @formulas that will act on the input fields. The output fields are set to compute Null if there are no input values.

In your LotusScript code, create a document and set the form name to "function worksheet." Then, when you need to apply your @formulas, simply set the input values, ComputeWithForm, then extract the output results and use them in your LotusScript. Obviously, you do not need to save the worksheet once you have extracted the values, and you can even use LotusScript as a shell to perfom @formula loops.

Generally, you can use this tip with all @functions that you can use with the Evaluate statement. DbLookups may require a slight modification in resolving server name and path arguments because an @DbName doesn't work in Evaluate. To overcome this, place two input fields, such as DbServer and DbPath, on the "function worksheet" and resolve them with LotusScript prior to the ComputeWithForm.


About the author

Gary Steele is a Principal CLP and Senior Development Consultant for ITNET (UK) LTD. ITNET is one of the UK's leading outsourcing suppliers of combined information technology, and business process management. They have specific experience in the local government, process manufacturing, retail, chemical and financial services sectors. Gary is currently working on a land registration project for one of the UK's largest city councils.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Lotus
ArticleID=12821
ArticleTitle=Combining complex @formulas with LotusScript
publish-date=11021998
author1-email=
author1-email-cc=