|
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.
|