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 developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

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]

Create your own formula debugger

Robert AlbrittonSolutions By Design, Inc.
Robert Albritton is from Solutions By Design, Inc., a Lotus Business Partner and 1999 Lotus Beacon Award winner.
Craig Lordan, Project Manager, Lotus
Craig is the Project Manager for the Lotus Developer Domain. He started at Lotus in January 1998, first working in the Notes/Domino documentation group. In August 1999, he joined Iris Associates to be a writer and then Content Manager for Notes.net. In previous jobs, he was a technical writer at EDS and Harper & Shuman (which has been gobbled up by some company called Deltek). He holds a Business Communication degree from Bentley College in Waltham, Mass. and is still looking for a nice frame for it. When he's not working, Craig is usually spending time with his wife, or watching his tape of last night's Late Show with David Letterman.

Summary:  This tip shows how to make it easier to use @Prompts in formulas as breakpoints for debugging by using an environment variable to tell formulas to display or ignore the prompts.

Date:  01 Dec 1999
Level:  Intermediate

Activity:  3693 views
Comments:  

When trying to resolve formula coding issues, developers typically use @Prompts to display information at different points in the formula. You then need to remove all those @Prompts when all the debugging work is done, or when you want to see how the formula is working without the debug prompts.

You make using the @Prompts easier by creating your own formula debugger. You can use an environment variable to tell formulas to display or ignore the prompts. Also, on a system where the environment variable is not set at all, your debug prompts do not appear.

Note: This formula debugger will work in all versions of Notes. If you have Notes R5, you can also try an undocumented, beta version formula debugger within the Notes client. To try it, press and hold down Ctrl-Shift, then choose File - Tools - Debug LotusScript.

Set the environment variable using a SmartIcon

You can create a SmartIcon to set the environment variable, which allows you to toggle your formula debugger.

Create a SmartIcon (File - Preferences -SmartIcon Settings) that uses the following formula:

				
    list1 := "Yes" : "No" : "";     
    list2 := "No" : "Yes" : "Yes";     
    list := "OFF" : "ON" : "ON";     
    status := @Environment("AllDebug");     
    neg := status = "No" : "";     
    choice := @Prompt([YESNO]; "Change Prompt";
    "You are about to turn your formula debugger to:
    " + @Replace(status; list1; list) +
     @Char(13) + @Char(13) + "Do you wish to continue?");     
    @If(choice;     
        @SetEnvironment("AllDebug"; @Replace(status; list1; list2));         
        "")

Once the SmartIcon is created, clicking it produces the following message:


Figure 1. Formula debugger on
Formula debugger on

If you turn the debugger on, you can click the SmartIcon again to shut it off:


Figure 2. Formula debugger off
Formula debugger off

Using the environment variable in your formulas

In your formula codes, begin with:

debug := @Environment("AllDebug") = "Yes";

Then, whenever the you need to check values, create a section similar to the following:

				
    @If(debug;    
        @Do(        
            @Prompt([OK]; "variable1"; variable1);            
            @Prompt([OK]; "variable2"; variable2);            
            @Prompt([OK]; "variable3"; variable3);            
            ...);
        "");

When the formula debugger is "On", the prompts will display. When it is "Off", they won't.


About the authors

Robert Albritton is from Solutions By Design, Inc., a Lotus Business Partner and 1999 Lotus Beacon Award winner.

Craig is the Project Manager for the Lotus Developer Domain. He started at Lotus in January 1998, first working in the Notes/Domino documentation group. In August 1999, he joined Iris Associates to be a writer and then Content Manager for Notes.net. In previous jobs, he was a technical writer at EDS and Harper & Shuman (which has been gobbled up by some company called Deltek). He holds a Business Communication degree from Bentley College in Waltham, Mass. and is still looking for a nice frame for it. When he's not working, Craig is usually spending time with his wife, or watching his tape of last night's Late Show with David Letterman.

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 developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

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

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Lotus
ArticleID=12814
ArticleTitle=Create your own formula debugger
publish-date=12011999
author1-email=
author1-email-cc=
author2-email=
author2-email-cc=

Table of contents

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers