You could make it work the way you want to if you rearrange it and add a bit.
>printrep()
>
declare variables PRIVATE (note this moved)
>store 0 to numvar1,numvar2
>store '' to chrvar1, chrvar2
>extrrepdata()
>call report (making use of these variables)
>
>In my 'printrep()' method I call the method to make the actual cursor. In this method ('extrrepdata()') I declare these variables (which I also need for the report) because I need them here also for my select statements PRIVATE. But that gives problems.
The PUBLIC keyword actually creates variables of those names.
PRIVATE only says "if you see this variable name created within this routine, don't overwrite the one which existed in the routines which called this one. Hide them, and make a new variable with this name instead." It doesn't actually create the variable, it just saves you from accidentally changing the value of the variable with the same name in the routine you came from.
HTH,
Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing