I've built a simple form (one grid, exit button) to have an equivalent of a browse. It being that simple, I kept it in a little prg. And it worked alright.
Except when I tried to run it again in a different datasession. Despite being released, the form instantiated in the datasession where it was first instantiated... well, sort of. The grid's recordsource stayed the same as the first time, even though it was not found in the current datasession. The grid would be blank.
Then I rebuilt the form as a vcx class, and all of a sudden it just works as expected - the grid assumes the current alias as its recordsource.
I've had some borderline cases before, when I couldn't be sure of the datasession (or something else?) being as expected in prg-based classes instantiated and called across datasessions. This is the first time I have something verifiable. Did anyone encounter this?
update: just setting the grid's .recordsource=alias() sufficed - it now works from prg as well. This still leaves a question - why did the grid keep the recordsource from the first instance when prg based, and not when vcx based?