Hi,
Variables are placeholders, and can make a formula more efficient and easier to read.
Variables can be named with whatever name you want. The only rules are that they must start with a letter, and may not be the same name as a built-in function.
Your variable name can't be "sum", or "len", or "length", as all of these are built in funtions
"i" is very common, usually used as a counter.
I used "nm" to stand for "Name"
There are 3 scopes to variables - Local, Global, and Shared
Local variables are available only in the formula that is being executed- their values cannot be used in other formulas.
Because of that, the same Local variable name can be used in multiple formulas without any problems.
Global variables are the default variable scope.
If you forget to define a scope, it will be Global by default.
Global variables that are set in one formula can be read and used by another formula.
Shared variables are used to pass values from a subreport back to the main report. (or vice versa)
the Shared scope forces the formula to be executed in the WhilePrintingRecords pass.
I would suggest that you read George Peck's book, "The Complete Reference" for whatever version of Crystal that you're using.
Bob Suruncle