Creating horizontal bar graph are easy. Setting a char bar length in a text field. But there comes a time
when you need a good old vertical Graph. Aggregate multiple records into a single record and creating
A vertical Graph can be quite complex, and i need a repeatable function i could call to do it over and over again.
Creating a procedure that can recurse and loop is also potentially an issue in sailforms as could be
P passing parms in and results out.
Passing parms is solvable using global variables.
Loops were a bit more of a challenge. But solved with aloop table, containing a single whole number
With a record for each loop call you need.
The attached example shows how to make procedure into functions. It had two global variables
Row (a number that passed between the main control procedure and the need loop procedure, the serving
Being graph a text variable where the resulting graph is returned for you to do what ever you need.)
There is a demo form which show how to use the procedure function. It also has a foreground demo
but it's not practical for repeated batch calls.
I have used this same technique to create calender month views etc
Enjoy.