>>I would like to set a breakpoint in the debugger Watch Window everytime the record count in a table changes. However, the program frequently changes DataSessions. When this happens, the value of the expression turns to "Expression cannot be evaluated" and the debugger becomes active.
>>
>>Is there some expression I can use so that the debugger doesn't become active when the datasession switches, but only when RECCOUNT('mytable') changes?
>
>Sounds like when your code switches to another datasession, you want an expression that doesn't change, so the breakpoint isn't fired.
>
>One kludgy way to do this would be to "remember" the datasession number and RECCOUNT() of your table at the start of the debug session. To do that you would need to set a couple of public memvars ( or properties of a public object ) e.g.
>
>* Insert code before your debug section:
>gnSession = SET( "DATASESSION" )
>gnRecCount = RECCOUNT( "MyTable ")
>
>SET STEP ON
>...
>
>* Then, for your breakpoint expression you could use something like
>IIF( SET( "DATASESSION" ) = gnSession, RECCOUNT( "MyTable" ), gnRecCount )
>
If there was a way to reference a table in another datasession this wouldn't be necessary, but the help for SET DATASESSION says "tables in non-current datasessions are not accessible".
Thanks. I had a feeling it would be something like that but hope springs eternal, etc. etc. etc.