Lantica Software LLC.
Learn more about Sesame Database Manager
I also, would like to compliment the Lantica team on their responsiveness and dedication. Where else can you get such quick help for a software product -- from the people who wrote it -- on Saturday and Sunday, no less. What other product is so willing to implement a new feature sometimes within days of a request?
Carl Underwood
- New England Antenna Service
 
Schedule your free demo
Schedule Your Free Live Demo
Click here!
 
Home
Order Sesame
Getting Started
Products
Support
Contact Us
Company
Downloads
Q&A™
 
 
Email Address


Note: Your email address will be used only to notify you of updates and events related to Lantica and Sesame. Your address will not be sold or used for any other purpose.


Sesame Database Manager is compatible with Symantec Q&A. Q & A users will find that Sesame uses many of the same keystrokes, the same search syntax, and almost the same programming syntax as used in a Q&A database. Sesame can also translate Q&A databases. Find out more.


Inside Sesame - The Monthly Newsletter for Sesame Database Manager
Read a FREE issue!

 

Sesame Library | Quick Sesame Mini-Reports

Posted August 2, 2002
Progress Update 8/2/2002

Quick Sesame Mini-Reports

I thought you might like to see an example of some of Sesame's new programming features and capabilities. As we've mentioned before, Mass Update in Sesame is much more powerful than it is in Q&A. In the example below, I combine Mass Update with a new function called WriteLn to produce a "mini report" on-the-fly.

WriteLn is a new-to-Sesame function which writes a line of text to a pop-up window. In the program below, I accumulate running totals while stepping through my result set, then display the totals in a pop-up WriteLn window to create a "mini report."

This Mass Update program, run against the 530 records in our AMSearch application, looks like this:

var vLiveCnt as Int
var vProspectCnt as Int
var vLiveMoney as Double
var vProspectMoney as Double

// If this is the first record, initialize the variables
If @ResultSetCurrentPosition() = 1 Then
{
vLiveCnt = 0
vProspectCnt = 0
vLiveMoney = 0
vProspectMoney = 0
}

If LiveProspect = "L" Then
{
vLiveCnt = vLiveCnt + 1
vLiveMoney = vLiveMoney + SMoney
}
Else If LiveProspect = "P" Then
{
vProspectCnt = vProspectCnt + 1
vProspectMoney = vProspectMoney + SMoney
}

// If this is the last record, pop up the final results in the WriteLn window
If @ResultSetCurrentPosition() = @ResultSetTotal() Then
{
writeln("Live / Prospect Breakdown for " + @Str(@ResultSetTotal()) + " Records")
writeln("-----------------------------------------------------------------------")
writeln("Live: " + @Str(vLiveCnt) + " records with $" + @Str(vLiveMoney))
writeln("Prospect: " + @Str(vProspectCnt) + " records with $" + @Str(vProspectMoney))
}

It produces the result shown below:

Voila! Quick Mini Reports!

Although this is a Mass Update program, it does not change any information in the database, it only collects and organizes it -- like a report.

Notice how I use variables to store interim calculation information. (In Q&A, you have to use fields for this, since Q&A doesn't support true memory variables.) In the first four lines of the program, I declare my variables and say what kind of data they are to contain. (Sesame requires all variables to be declared in advance of using them.) The Int data type is simply an integer or whole number, which I use to store my count values. I use the Double data type to store money values since these have two decimal places.

I added the "v" prefix to my variable names so they don't get confused with other data elements, such as field names (LiveProspect, SMoney) and Global Statics (a global variable you will learn about later). These prefixes are entirely optional.

@ResultSetCurrentPosition() and @ResultSetTotal() are built-in functions new to Sesame.

Finally, in a Sesame program, you can use "//" at the beginning of a line to signify a programming comment or remark.

The above is an example of a more advanced program -- one that illustrates Sesame's power and flexibility. This power won't get in your way if you don't need it, but it's available to you if you do.

Keep in mind that, with a few exceptions, you will be able to program in Sesame using all the old familiar Q&A functions, commands and syntax. When you "translate" a Q&A database to Sesame, your programming, if any, will come through as well.

Erika Yoxall, Technical Coordinator, Lantica Software, LLC

  Learn more about Sesame Database Manager
The Sbasic programing worked great and actually is easier than using macros.
  Bruce K. Stone
City Manager - City of the Village