>Hi,
>
>I have a function that uses XFRX to convert a report to a PDF format.
>
>The report to be converted to PDF has multiple bands. XFRX handle it fine but the cursor names that are used for the bands have to be in scope inside the MyXFRX() function. And I used local variable. For example:
>
>local Band1Cursor, Band2Cursor
>Band1Cursor = sys(2015)
>Band2Cursor = sys(2015)
>
>
>With the above scenario the MyXFRX function gives an error that variable Band1Cursor does not exist.
>
>The solution - so far - is to either make the variables Private or hard coded. That is, do not use variables but instead use names like CUR_Band1, CUR_band2
>
>Which approach would be a better practice?
>
>TIA
You are saying "have to be in scope inside MyXRFX() function". Any variable declared as LOCAL or PRIVATE, inside that function would be in scope of that function. So using LOCAL is fine. The error you are getting doesn't make sense.
Also, I think hard coding a cursor name is always fine. Cursor names are private to the data session that they are created in and their file names are sys(2015) values implicitly.